RTEMS task var lock compromised in thread show function

Bug #1628323 reported by Jeff Hill
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
EPICS Base
Fix Released
Low
mdavidsaver
3.14
Fix Released
Low
mdavidsaver
3.15
Fix Released
Low
mdavidsaver
3.16
Fix Released
Low
mdavidsaver

Bug Description

I see that this code

void epicsThreadShow (epicsThreadId id, unsigned int level)
{
    struct taskVar *v;

    if (!id) {
        epicsThreadShowInfo (NULL, level);
        return;
    }
    taskVarLock ();
    for (v = taskVarHead ; v != NULL ; v = v->forw) {
        if ((rtems_id)id == v->id) {
            epicsThreadShowInfo (v, level);
            return;
        }
    }
    taskVarUnlock ();
    fprintf(epicsGetStdout(),"*** Thread %x does not exist.\n", (unsigned int)id);
}

needs a fix like this otherwise we can see (we have observed) a system lock up when epicsThreadShow is called on RTEMS

bzr diff src/libCom/osi/os/RTEMS/osdThread.c
=== modified file 'src/libCom/osi/os/RTEMS/osdThread.c'
--- src/libCom/osi/os/RTEMS/osdThread.c 2016-09-09 20:01:33 +0000
+++ src/libCom/osi/os/RTEMS/osdThread.c 2016-09-27 23:38:44 +0000
@@ -672,6 +672,7 @@
     for (v = taskVarHead ; v != NULL ; v = v->forw) {
         if ((rtems_id)id == v->id) {
             epicsThreadShowInfo (v, level);
+ taskVarUnlock ();
             return;
         }
     }

Jeff Hill (johill-lanl)
Changed in epics-base:
importance: Undecided → High
status: New → Confirmed
Revision history for this message
mdavidsaver (mdavidsaver) wrote :

Yup, looks like this has been broken for quite some time.

Revision history for this message
mdavidsaver (mdavidsaver) wrote :
Andrew Johnson (anj)
no longer affects: epics-base/3.13
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.