celix
celix copied to clipboard
Deadlock on celix_frameworkFactory_destroyFramework
When no open requests are present, the celix_frameworkFactory_destroyFramework has a chance of deadlocking.
Thread 1 "generic_journal" received signal SIGINT, Interrupt.
0x00007fe06102bfd7 in pthread_join () from /lib64/libpthread.so.0
(gdb) thread apply all bt
Thread 10 (Thread 0x7fe06073c700 (LWP 55610)):
#0 0x00007fe06102e9f5 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1 0x00007fe06234948c in celixThreadCondition_wait (cond=0xc046e8, mutex=0xc04728) at _localwork/Programming/build_tooling/lib_builder/celix/celix-src/libs/utils/src/celix_threads.c:156
#2 0x00007fe06351d373 in fw_eventDispatcher (fw=0xc04580) at _localwork/Programming/build_tooling/lib_builder/celix/celix-src/libs/framework/src/framework.c:2275
#3 0x00007fe06102ae65 in start_thread () from /lib64/libpthread.so.0
#4 0x00007fe060d5388d in clone () from /lib64/libc.so.6
Thread 1 (Thread 0x7fe063f85ec0 (LWP 55600)):
#0 0x00007fe06102bfd7 in pthread_join () from /lib64/libpthread.so.0
#1 0x00007fe062349210 in celixThread_join (thread=..., retVal=0x0) at _localwork/Programming/build_tooling/lib_builder/celix/celix-src/libs/utils/src/celix_threads.c:69
#2 0x00007fe06351d80e in frameworkActivator_stop (userData=0x0, context=0xc128b0) at _localwork/Programming/build_tooling/lib_builder/celix/celix-src/libs/framework/src/framework.c:2381
#3 0x00007fe06351a3e9 in fw_stopBundle (framework=0xc04580, bundle=0xc15cb0, record=true) at _localwork/Programming/build_tooling/lib_builder/celix/celix-src/libs/framework/src/framework.c:1131
#4 0x00007fe063519008 in framework_stop (framework=0xc04580) at _localwork/Programming/build_tooling/lib_builder/celix/celix-src/libs/framework/src/framework.c:701
#5 0x00007fe06352da6c in celix_frameworkFactory_destroyFramework (fw=0xc04580) at _localwork/Programming/build_tooling/lib_builder/celix/celix-src/libs/framework/src/celix_framework_factory.c:44
#6 0x0000000000415142 in IntegrationTestSuite::~IntegrationTestSuite (this=0xc03510, __in_chrg=<optimized out>) at GenericJournalAdminIntegrationTests.cc:57
...
Can you check if this is solved in the pull request #147. Not merged in develop?
Still reproducible on develop.
Thread 2 (Thread 0x7c0439983700 (LWP 32284)):
#0 futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x5e3c33a36ed0) at ../sysdeps/unix/sysv/linux/futex-internal.h:80
#1 __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x5e3c33a36e80, cond=0x5e3c33a36ea8) at pthread_cond_wait.c:508
#2 __pthread_cond_wait (cond=0x5e3c33a36ea8, mutex=0x5e3c33a36e80) at pthread_cond_wait.c:638
#3 0x00007c043b1bd934 in celixThreadCondition_wait (cond=0x5e3c33a36ea8, mutex=0x5e3c33a36e80) at /home/oipo/Programming/celix-apache/libs/utils/src/celix_threads.c:156
#4 0x00007c043b1e7380 in fw_bundleEntry_waitTillNotUsed (entry=0x5e3c33a36e70) at /home/oipo/Programming/celix-apache/libs/framework/src/framework.c:82
#5 0x00007c043b1ecd65 in framework_shutdown (framework=0x5e3c33a36110) at /home/oipo/Programming/celix-apache/libs/framework/src/framework.c:2063
#6 0x00007c043ae1a669 in start_thread (arg=<optimized out>) at pthread_create.c:479
#7 0x00007c043ad40323 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
Thread 1 (Thread 0x7c0439986a00 (LWP 32201)):
#0 futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x5e3c33a36220) at ../sysdeps/unix/sysv/linux/futex-internal.h:80
#1 __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x5e3c33a361d0, cond=0x5e3c33a361f8) at pthread_cond_wait.c:508
#2 __pthread_cond_wait (cond=0x5e3c33a361f8, mutex=0x5e3c33a361d0) at pthread_cond_wait.c:638
#3 0x00007c043b1bd934 in celixThreadCondition_wait (cond=0x5e3c33a361f8, mutex=0x5e3c33a361d0) at /home/oipo/Programming/celix-apache/libs/utils/src/celix_threads.c:156
#4 0x00007c043b1ecbb2 in framework_waitForStop (framework=0x5e3c33a36110) at /home/oipo/Programming/celix-apache/libs/framework/src/framework.c:2027
#5 0x00007c043b1ffc52 in celix_frameworkFactory_destroyFramework (fw=0x5e3c33a36110) at /home/oipo/Programming/celix-apache/libs/framework/src/celix_framework_factory.c:45
#6 0x00005e3c3243c6f4 in TEST_GROUP_CppUTestGroupCelixBundleContextBundlesTests::teardown (this=0x5e3c33a3a450) at /home/oipo/Programming/celix-apache/libs/framework/test/bundle_context_bundles_tests.cpp:58
#7 0x00005e3c32462fd2 in PlatformSpecificSetJmpImplementation ()
#8 0x00005e3c3246040e in Utest::run() ()
#9 0x00005e3c3246297f in UtestShell::runOneTestInCurrentProcess(TestPlugin*, TestResult&) ()
#10 0x00005e3c32462fd2 in PlatformSpecificSetJmpImplementation ()
#11 0x00005e3c32460507 in UtestShell::runOneTest(TestPlugin*, TestResult&) ()
#12 0x00005e3c3245fab7 in TestRegistry::runAllTests(TestResult&) ()
#13 0x00005e3c32455009 in CommandLineTestRunner::runAllTests() ()
#14 0x00005e3c324550f9 in CommandLineTestRunner::runAllTestsMain() ()
#15 0x00005e3c3245525d in CommandLineTestRunner::RunAllTests(int, char const**) ()
#16 0x00005e3c324329f2 in main (argc=1, argv=0x7fff83c55198) at /home/oipo/Programming/celix-apache/libs/framework/test/run_tests.cpp:25
This only happens when an assert throws in a lambda, such as when using celix_framework_useBundle in bundle_context_bundles_test.cpp:162.