Downloads  |  Buy

Stuck on pthread_cond_wait [Solved]

Stuck on pthread_cond_wait [Solved]

Postby shounakb » September 27th, 2019, 7:56 am

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 ()
Last edited by shounakb on February 10th, 2020, 4:54 am, edited 1 time in total.
shounakb
 
Posts: 13
Joined: August 20th, 2018, 2:17 am

Re: Stuck on pthread_cond_wait

Postby Wyatt » September 27th, 2019, 8:04 am

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.
User avatar
Wyatt
Site Admin
 
Posts: 6384
Joined: July 11th, 2007, 10:30 pm
Location: New Hampshire

Re: Stuck on pthread_cond_wait

Postby shounakb » September 27th, 2019, 8:22 am

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.
shounakb
 
Posts: 13
Joined: August 20th, 2018, 2:17 am

Re: Stuck on pthread_cond_wait

Postby Wyatt » September 27th, 2019, 8:29 am

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.
User avatar
Wyatt
Site Admin
 
Posts: 6384
Joined: July 11th, 2007, 10:30 pm
Location: New Hampshire

Re: Stuck on pthread_cond_wait

Postby shounakb » February 10th, 2020, 5:26 am

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
shounakb
 
Posts: 13
Joined: August 20th, 2018, 2:17 am

Re: Stuck on pthread_cond_wait

Postby Wyatt » February 10th, 2020, 2:36 pm

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.
User avatar
Wyatt
Site Admin
 
Posts: 6384
Joined: July 11th, 2007, 10:30 pm
Location: New Hampshire

Re: Stuck on pthread_cond_wait

Postby shounakb » February 12th, 2020, 2:11 am

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

TurboActivate Version: 4.3.1.0
Architecture of the build: x64
Operating System: Ubuntu 16.04.6 LTS (x86_64)
gcc version: 5.4
glibc 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 TurboActivate
target_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.
shounakb
 
Posts: 13
Joined: August 20th, 2018, 2:17 am

Re: Stuck on pthread_cond_wait

Postby Wyatt » May 21st, 2020, 1:12 pm

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.
User avatar
Wyatt
Site Admin
 
Posts: 6384
Joined: July 11th, 2007, 10:30 pm
Location: New Hampshire

Re: Stuck on pthread_cond_wait [Solved]

Postby gtopala » May 23rd, 2020, 5:10 pm

Hi Wyatt,
Can you add TA_Cleanup to TurboActivate.h?
gtopala
 
Posts: 15
Joined: April 26th, 2015, 8:45 am
Location: Toronto, Canada

Re: Stuck on pthread_cond_wait [Solved]

Postby Wyatt » May 24th, 2020, 6:38 am

Yeah, we’ll push out a fixed release with the updated header on Tuesday.
User avatar
Wyatt
Site Admin
 
Posts: 6384
Joined: July 11th, 2007, 10:30 pm
Location: New Hampshire

Next

Return to LimeLM, TurboActivate, & TurboFloat Support