cancel
Showing results for 
Search instead for 
Did you mean: 

problem using posix_threads

problem using posix_threads

The error I got when I compile the code are:

ld: (Warning) Unsatisfied symbol "_Unwind_SetIP" in file /usr/lib/hpux64/libCsup.so.1
ld: (Warning) Unsatisfied symbol "_Unwind_SetGR" in file /usr/lib/hpux64/libCsup.so.1
ld: (Warning) Unsatisfied symbol "_Unwind_GetIP" in file /usr/lib/hpux64/libCsup.so.1
ld: (Warning) Unsatisfied symbol "_Unwind_GetGR" in file /usr/lib/hpux64/libCsup.so.1
ld: (Warning) Unsatisfied symbol "__uc_get_rsebs" in file /usr/lib/hpux64/libunalign.so.1
ld: (Warning) Unsatisfied symbol "_Unwind_RaiseException" in file /usr/lib/hpux64/libCsup.so.1
ld: (Warning) Unsatisfied symbol "__uc_get_cfm" in file /usr/lib/hpux64/libunalign.so.1
ld: (Warning) Unsatisfied symbol "__uc_get_frs" in file /usr/lib/hpux64/libunalign.so.1
ld: (Warning) Unsatisfied symbol "__uc_set_rsebs" in file /usr/lib/hpux64/libunalign.so.1
ld: (Warning) Unsatisfied symbol "__uc_get_grs" in file /usr/lib/hpux64/libunalign.so.1
ld: (Warning) Unsatisfied symbol "__uc_set_frs" in file /usr/lib/hpux64/libunalign.so.1
ld: (Warning) Unsatisfied symbol "__uc_set_grs" in file /usr/lib/hpux64/libunalign.so.1
ld: (Warning) Unsatisfied symbol "_Unwind_GetRegionStart" in file /usr/lib/hpux64/libCsup.so.1
ld: (Warning) Unsatisfied symbol "__uc_get_um" in file /usr/lib/hpux64/libunalign.so.1
ld: (Warning) Unsatisfied symbol "__uc_get_ar" in file /usr/lib/hpux64/libunalign.so.1
ld: (Warning) Unsatisfied symbol "__uc_get_cr" in file /usr/lib/hpux64/libunalign.so.1
ld: (Warning) Unsatisfied symbol "__uc_set_um" in file /usr/lib/hpux64/libunalign.so.1
ld: (Warning) Unsatisfied symbol "__uc_get_ip" in file /usr/lib/hpux64/libunalign.so.1
ld: (Warning) Unsatisfied symbol "__uc_set_ip" in file /usr/lib/hpux64/libunalign.so.1
ld: (Warning) Unsatisfied symbol "_Unwind_Resume" in file /usr/lib/hpux64/libApiDS64.sl
ld: (Warning) Unsatisfied symbol "_Unwind_GetLanguageSpecificData" in file /usr/lib/hpux64/libCsup.so.1

And the compiling arguments I am using are:

cc -o mysqlbackup $(FILES) $(INC) -lpthread -mt -D_REENTRANT -I. -O +DD64 +DSitanium2 /usr/lib/hpux64/libApiDS64.sl

This works fine on none HP-UX systems, but on HP-UX, the function:
pthread_join( threads[loop*2], (void **) &rc[loop*2]);

core dumps, and replacing this with:

pthread_join( threads[loop*2+1], (void **) NULL);

causes the TSM to have corrupted data...

Please help me, I am stucked here.

Regards Tomas
5 REPLIES
Dennis Handly
Acclaimed Contributor

Re: problem using posix_threads

>The error I got when I compile the code are:

These are link errors, not compile. This indicates you haven't read how to mix C with aC++ shlibs:
http://docs.hp.com/en/14487/distributing.htm#linking

In particular, -lunwind is missing. Or you should be linking with aCC.

>And the compiling arguments I am using are:

/usr/lib/hpux64/libApiDS64.sl should be replaced by just -lApiDS64.

>on HP-UX, the function core dumps:
pthread_join(threads[loop*2], (void**)&rc[loop*2]);

What is the type of rc? It better be a void* or long array/pointer.

>replacing this with:
pthread_join(threads[loop*2+1], (void**)NULL);

I'm not sure why you are using loop*2+1?
It is ok that value_ptr is NULL.

Re: problem using posix_threads

Thanks Dennis,

I changed the linking to what you mentioned, which removed the errors above.
And also the "hint" you gaved me with the "join" problems is now solved.

Even though that I send a integer from the pthread_exit, and that the pthread_join recieve this as an integer, it seams that the type is somewhat long anyway?
Maybee I should have put some castings in the exit and join.

Anyway I changed the recieving "rc[]" from an integer type to a long which solved that part.

Now the remaining problem looks more as a ibm TSM related problem.

Many many thanks
Dennis Handly
Acclaimed Contributor

Re: problem using posix_threads

>Even though that I send a integer from the pthread_exit

No, you send a void* to pthread_exit.

>pthread_join receive this as an integer

No, it receives it as a void*.

>it seams that the type is somewhat long anyway?

long and void* have the same size.

Re: problem using posix_threads

Everything work now after the last casting corrections in the code.
Many thanks.
Dennis Handly
Acclaimed Contributor

Re: problem using posix_threads

>Everything work now

If you are happy with your answers, please read the following about reopening threads and assigning points:
http://forums.itrc.hp.com/service/forums/helptips.do?#41
http://forums.itrc.hp.com/service/forums/helptips.do?#33