pthread_rwlock_unlock change the signal mask! (278 Views)
Reply
Visitor
Changho
Posts: 4
Registered: ‎06-03-2013
Message 1 of 7 (278 Views)

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

Please use plain text.
Visitor
Changho
Posts: 4
Registered: ‎06-03-2013
Message 2 of 7 (273 Views)

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

 

Please use plain text.
Acclaimed Contributor
Dennis Handly
Posts: 24,754
Registered: ‎03-06-2006
Message 3 of 7 (257 Views)

Re: pthread_rwlock_unlock change the signal mask!

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

Please use plain text.
Visitor
Changho
Posts: 4
Registered: ‎06-03-2013
Message 4 of 7 (241 Views)

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?

Please use plain text.
Occasional Visitor
blade_runner
Posts: 1
Registered: ‎06-03-2013
Message 5 of 7 (232 Views)

Re: pthread_rwlock_unlock change the signal mask!

[ Edited ]

$ cc pthread_rwlock.c -o pthread_rwlock -lpthread

$ ./pthread_rwlock

sigmask error - -2 (line:57)

Please use plain text.
Visitor
Changho
Posts: 4
Registered: ‎06-03-2013
Message 6 of 7 (218 Views)

Re: pthread_rwlock_unlock change the signal mask!

Yes, it's just what I'm asking.
It seems like pthread library bug.
Please use plain text.
Acclaimed Contributor
Dennis Handly
Posts: 24,754
Registered: ‎03-06-2006
Message 7 of 7 (209 Views)

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.

Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation