Languages and Scripting
cancel
Showing results for 
Search instead for 
Did you mean: 

semaphore error that is due to TLS symbol error ??

Ma_Ta
Occasional Advisor

semaphore error that is due to TLS symbol error ??

Hello.

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

$ myapp&
[1] 26360
$ /usr/lib/dld.sl: Thread Local Storage mismatch symbol for: sem_destroy
/usr/lib/dld.sl: 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.

regards,
Takanobu Maekawa

 

 

 

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

1 REPLY
Highlighted
Ma_Ta
Occasional Advisor

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

well,
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...

regards,

Takanobu Maekawa