Languages and Scripting
Showing results for 
Search instead for 
Do you mean 

semaphore error that is due to TLS symbol error ??

Occasional Advisor

semaphore error that is due to TLS symbol error ??

[ Edited ]


as soon as the application I made run,
it causes error and being terminated as bellow.

$ myapp&
[1] 26360
$ /usr/lib/ Thread Local Storage mismatch symbol for: sem_destroy
/usr/lib/ No such file or directory

I'm sure I use semaphore functions:
sem_init(),sem_wait(),sem_post() and sem_destroy().

And the program is a deamon application
and uses pthread functions and
precompiled by Pro*C for using Oracle.

I can't understand what the above error message does mean,
but it is possible there are some keywords or linker setting missed.
(but I use -lrt option to cc.)

If you know thare are some possibilities about this problem, please tell me.

Takanobu Maekawa




Moved from HP-UX Technical Documentation to HP-UX > languages

Occasional Advisor

Re: semaphore error that is due to TLS symbol error ??

I remembered I used a user-defined TLS valiable.
So I commented it out, the problem didn't happen.

Therefore, it is much possible to misuse TLS.
But althouth I read the TLS section in pthread(3T)in man page,
I can't find where I was wrong.

Simply I use TLS global valiable in a file as bellow,

__thread ERRSTRUCT errSt;
(ERRSTRUCT is a user-defined struct type)

If you know the right way to use TLS,
please tell me.I'm really confused...


Takanobu Maekawa