Stuck on pthread_cond_waitSolved

Hi,

I am using the latest version of TurboActivate shared library. On exit my application is getting stuck with the following stack trace. Am i doing anything wrong.

#0 pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185#1 0x00000000005255da in boost::condition_variable::wait(boost::unique_lock<boost::mutex>&) ()#2 0x00000000005256e9 in boost::thread::join_noexcept() ()#3 0x000000000051c5db in TA_LIB_NS::GlobalVars::~GlobalVars() ()#4 0x00007f3d4a60bb69 in __run_exit_handlers (status=0, listp=0x7f3d4a9986c8 <__exit_funcs>, run_list_atexit=run_list_atexit@entry=true) at exit.c:77#5 0x00007f3d4a60bbb7 in __GI_exit (status=<optimized out>) at exit.c:99#6 0x00007f3d4a5f43dc in __libc_start_main (main=0x4418de <main>, argc=2, argv=0x7ffc6342a668, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffc6342a658) at ../csu/libc-start.c:300#7 0x000000000043fba9 in _start ()

, edited

GLIBC_2.3.2 is 16 years old. It would be heading off to college next year.

Use a modern compiler. GCC 8.0 or newer. Or use the dynamic version of TurboActivate.

I am using gcc 9.2. And I have tried the shared library version too. It gets stuck at the same place. I had a previous version of static library, which works flawlessly.

Much more information is needed: https://wyday.com/limelm/help/faq/#useful-reports

OS, OS version, OS architecture, code, parameters passed, return codes, reproducibility, etc., etc., etc., etc.

I am still facing this issue with latest version of TurboActivate dynamic library.

There are two modes through which I can run my application. First is by directly running the binary and the second one is by daemonizing the binary. Somehow I am facing this issue only when I stop my app while it is running as a daemon. Here is my stack trace

#0 pthread_cond_wait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185#1 0x00007fe2a1f6a3ca in ?? () from /usr/local/lib/libTurboActivate.so#2 0x00007fe2a1f6a4d9 in ?? () from /usr/local/lib/libTurboActivate.so#3 0x00007fe2a1f0d731 in ?? () from /usr/local/lib/libTurboActivate.so#4 0x00007fe2a0baa36a in __cxa_finalize (d=0x7fe2a21baae0) at cxa_finalize.c:56#5 0x00007fe2a1efef43 in ?? () from /usr/local/lib/libTurboActivate.so#6 0x00007ffd7e247b10 in ?? ()#7 0x00007fe2a32dedf7 in _dl_fini () at dl-fini.c:235

I have not been able to find a solution through the following link https://wyday.com/limelm/help/faq/#useful-reports

Please help

That FAQ isn't a solution, it's a detailed list of things we need (as I stated after I pasted the link: "OS, OS version, OS architecture, code, parameters passed, return codes, reproducibility, etc., etc., etc., etc.")

Can you make a simple reproducible example for us? We haven't been able to reproduce this.

Sorry for the misinterpretation. Here are the details of the entire scenario.

TurboActivate Version: 4.3.1.0Architecture of the build: x64Operating System: Ubuntu 16.04.6 LTS (x86_64)gcc version: 5.4glibc version: 2.23

Code Example

limelm_code.c

void *license_check() { //license related checks}

calling_code.c

void some_function() { pthread_t license_thread; pthread_create(&license_thread, NULL, &license_check, NULL);}

My license code CMakeLists.txt contains the following code snippet.add_library(limelm_lib STATIC limelm_code.c)//dynamic version of TurboActivatetarget_link_libraries(limelm_lib TurboActivate pthread rt)

My calling code CMakeLists.txt contains the following code snippet.add_library(calling_code STATIC calling_code.c)target_link_libraries(calling_code limelm_lib TurboActivate pthread rt)

Everything seems to work fine when I run my application normally as binary. The application can start and stop without any errors. After I daemonize my application it wont stop on exit. I have already attached the backtrace in my previous comment. Do let me know if anything else is needed.

This has been solved in TA 4.3.2, out now. Make sure to call TA_Cleanup() to release any resources being used before attempting to cleanly exit your app.

Hi Wyatt,Can you add TA_Cleanup to TurboActivate.h?

Yeah, well push out a fixed release with the updated header on Tuesday.

4.3.2.1 is out with the updated header.