1834935 Members
2535 Online
110071 Solutions
New Discussion

Hang in mutex operations

 
SOLVED
Go to solution
Midhun Chandran
Occasional Contributor

Hang in mutex operations

Hi,

I am seeing the problem on HP-UX 11i.
$uname -a
HP-UX chittor B.11.11 U 9000/800 812920600 unlimited-user license

I am seeing simailar hangs in the two code snippets below:


do {
rc = semop(mutex->interproc->filedes, &proc_mutex_op_on, 1);
} while (rc < 0 && errno == EINTR);



for (waited = 0; mutexp->locked != 0; waited = 1) {
ret = pthread_cond_wait(&mutexp->cond, &mutexp->mutex);
/*
* !!!
* Solaris bug workaround:
* pthread_cond_wait() sometimes returns ETIME -- out
* of sheer paranoia, check both ETIME and ETIMEDOUT.
* We believe this happens when the application uses
* SIGALRM for some purpose, e.g., the C library sleep
* call, and Solaris delivers the signal to the wrong
* LWP.
*/
if (ret != 0 && ret != EINTR &&
#ifdef ETIME
ret != ETIME &&
#endif
ret != ETIMEDOUT) {
(void)pthread_mutex_unlock(&mutexp->mutex);
return (ret);
}
}


In both the cases, the semop and pthread_cond_wait calls are getting
continously interrupted causing the loops to use all the CPU available.

I was wondering if this could be a patch issue. Could you please
guide me to the required patch, if there is any, for this particular problem ?

Thanks,
Midhun.
3 REPLIES 3
Massimo Bianchi
Honored Contributor

Re: Hang in mutex operations

Hi,
I found two patches:

s700_800 11.11 HP DCE/9000 1.8 DCE Client IPv6 patch (PHSS_27258)

99 Patch N/A s700_800 11.11 HP DCE/9000 1.8 Server/DevTools cum. patch (PHSS_27259)

Since i don't understand clearly your C code, i just pass the info.

HTH,
Massimo
Cheryl Griffin
Honored Contributor
Solution

Re: Hang in mutex operations

Check your pthreads patch as well:
PHCO_27632 s700_800 11.11 Pthread enhancement and fixes
http://www2.itrc.hp.com/service/cki/patchDocDisplay.do?patchId=PHCO_27632
"Downtime is a Crime."
Bill McNAMARA_1
Honored Contributor

Re: Hang in mutex operations

you'd be much better off asking this type of question at: http://www.hp.com/go/developers
check their forums sections:
http://h21007.www2.hp.com/dspp/comm/comm_Community_Home_IDX/1,1273,,00.html
It works for me (tm)