Intel® oneAPI Threading Building Blocks
Ask questions and share information about adding parallelism to your applications when using this threading library.

TBB failed to destroy TLS storage: Invalid argument Aborted

jiapei1001
Beginner
877 Views
I'm using OpenCV subversion-R5234built upon tbb 3.0 . When I tried to run one of my application, I got the following error message, but I've got no idea why is it so?
terminate called after throwing an instance of 'std::runtime_error'
what(): TBB failed to destroy TLS storage: Invalid argument
Aborted
Well, I'm using Ubuntu 11.04 upgraded from Ubunt 10.10 ...
Any suggestions?
Best Regards
Pei
0 Kudos
4 Replies
Alexey-Kukanov
Employee
877 Views
This message means that TBB was unable to delete a thread-local key it used, i.e. that pthread_key_delete() call returned an error. The solution to throw an exception might be considered too harmful for the problem, but that's the way it is, for now. Note that destruction of the TLS key only happens when TBB shuts down completely, i.e. either when the process completes or the library is unloaded. The last scenario, unfortunately, is known to be a tough nut for us: we already fixed some bugs related to that, but I'm afraid some more may still lurk there.
0 Kudos
tdgs
Beginner
877 Views
I am experiencing this behaviour as well. The program works fine, but throws this error and abort in the end. The problem is I am trying to use my program in a script, and I want to access its exit code. Any workaround or fixes?
Thanks!
0 Kudos
SergeyKostrov
Valued Contributor II
877 Views
I could only assume that a problem happens in a method that releases resources before an application exits.

Did you try to look at:

...
void governor::release_resources()
{
...
int status = theTLS.destroy();
...
}
...

and try to step-into 'theTLS.destroy' method to understand what is going on and why it returns non-zero.
0 Kudos
Anton_M_Intel
Employee
877 Views

An error during destruction of the internal thread local storage will no longer results in an exception in the next stable release of TBB.

0 Kudos
Reply