BladeSystem Forums have moved here
To make BladeSystem information easier to find, we have moved the BladeSystem forums here, to Servers and Operating Systems.
Languages and Scripting
Showing results for 
Search instead for 
Do you mean 

pthread_rwlock_unlock change the signal mask!

Highlighted
Visitor

pthread_rwlock_unlock change the signal mask!

[ Edited ]

I have a problem with using pthread_rwlock API.

I think it changes the signal mask abnormally.

Test program source file attached. (Just change the extension to c.)

Shortly, It just uses pthread_rwlock_rdlock -> pthread_rwlock_rdlock -> pthread_rwlock_unlock.

The last pthread_rwlock_unlock called, SIGUSR2 signal is blocked unexpectedly.

 

 

P.S. This thread has been moevd from HP-UX > General to HP-UX > languages - Hp forum moderator

6 REPLIES
Visitor

Re: pthread_rwlock_unlock change the signal mask!

pthread library version is like this.

 

$ /usr/sbin/swlist -l patch | grep pthread

# PHCO_39298                            1.0            pthread library Japanese manpage cumulative patch

# PHCO_41407                            1.0            pthread library cumulative patch

 

Acclaimed Contributor

Re: pthread_rwlock_unlock change the signal mask!

Have you tried using tusc to see if it changes the signal mask?

Visitor

Re: pthread_rwlock_unlock change the signal mask!

I don't know the location of signal masking info in memory.
I just can not help to check the result of pthread_sigmask() call.
(Please refer to my source code.)

 

Could you tell me more specifically?

Occasional Visitor

Re: pthread_rwlock_unlock change the signal mask!

[ Edited ]

$ cc pthread_rwlock.c -o pthread_rwlock -lpthread

$ ./pthread_rwlock

sigmask error - -2 (line:57)

Visitor

Re: pthread_rwlock_unlock change the signal mask!

Yes, it's just what I'm asking.
It seems like pthread library bug.
Acclaimed Contributor

Re: pthread_rwlock_unlock change the signal mask!

>I don't know the location of signal masking info in memory.

 

You run tusc to trace the system calls.  I only see sigprocmask.  In fact if I remove pthread_sigmask and replace by sigprocmask I get the same bad thing.  But the only syscall is sigprocmask with SIG_BLOCK and NULL for the set parm.

 

I have no idea how the mask can change without a syscall?  Unless it is stored in user space?

It gets changed to: 0xff7ff843fffffff3

 

It looks like you need to contact Support and file a bug.

The recommended libpthread patch is PHCO_42326 but I don't see any fixes for this.