Shutdown order problem ("epicsMutexLock failed" on client exit)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
EPICS Base |
Fix Released
|
Wishlist
|
Andrew Johnson |
Bug Description
From Chris Slominski
I have downloaded EPICS base 3.14.7 and built it under the provided 'hpux-parisc' setting of $EPICS_HOST_ARC. All built fine. I built a test client program that performs a couple channel access fetches and prints the results. The test program works fine when I build against our existing EPICS 3.13.2 installation, but there is a problem running with the newer EPICS version. The program performs the channels access operations correctly, but the signal value prints are sometimes followed by "epicsThreadOnceOsd epicsMutexLock failed" written to the command shell. I suspect the message is generated when I close the channel and exit the program. The number of times the message is written varies from zero to two. More often it is zero, and only once have I seen two. Can anyone explain to me what this message means, and what I need to do to correct it?
Additional information:
This occurs in this code
void epicsThreadOnce
{
int status;
epicsThread
status = mutexLock(
if(status) {
exit(-1);
}
if (*id == 0) { /* 0 => first call */
*id = -1; /* -1 => func() active */
/* avoid recursive locking */
status = pthread_
status = mutexLock(
*id = +1; /* +1 => func() done (see epicsThreadOnce() macro defn) */
}
status = pthread_
checkStatus
}
Original Mantis Bug: mantis-207
http://
The failure is reported in the POSIX version of epicsThreadOnceOsd. I suspect that there are orderly shutdown issues (some facility has shutdown prior to when a facility that is using it has shutdown). If you know how to use debuggers and can obtain a stack trace you might be able to speed up the debugging process.