crash on shutdown w/

Bug #1560200 reported by mdavidsaver on 2016-03-21
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

Found an fixed crash on IOC shutdown caused by a combination of the new link support and unittesting changes in 3.16.01. dbCloseLinks() in iocInit.c was changed to do a partial cleanup of DB_LINKs. This frees the link private structs to avoid a leak, but doesn't break up the locksets as this would be a waste of time.

The fix is to restore the previous behavior and only cleanup CA_LINKs unless run in "isolated" (unittest) mode.

The crash occurs (at least) within dbProcess() when the half disconnected DB_LINK is traversed.

> #0 0x00007ffff6c900e8 in dbLockSetAddrTrace (precord=0x6e0d90) at ../../../src/ioc/db/dbLock.c:987
> #1 0x00007ffff6c90eff in dbProcess (precord=0x6e0d90) at ../../../src/ioc/db/dbAccess.c:471
> #2 0x00007ffff6c90e7b in dbScanPassive (pfrom=0x6af7f0, pto=0x6e0d90) at ../../../src/ioc/db/dbAccess.c:447
> #3 0x00007ffff6ca25a5 in dbDbScanFwdLink (plink=0x6af9f8) at ../../../src/ioc/db/dbLink.c:430
> #4 0x00007ffff6ca2d99 in dbScanFwdLink (plink=0x6af9f8) at ../../../src/ioc/db/dbLink.c:690
> #5 0x00007ffff6cb000e in recGblFwdLink (precord=0x6af7f0) at ../../../src/ioc/db/recGbl.c:222
> #6 0x00007ffff6f1ae2a in process (prec=0x6af7f0) at ../../../src/std/rec/calcRecord.c:135
> #13 0x00007ffff6cb4361 in dbCaTask (arg=0x0) at ../../../src/ioc/db/dbCa.c:1052

When this happens, the main thread is in dbCloseLinks().

> #5 0x00007ffff679f59e in epicsMutexLock (pmutexNode=0x6b8cf0) at ../../../src/libCom/osi/epicsMutex.cpp:150
> #6 0x00007ffff6c8e4f7 in dbScanLock (precord=0x6b00d0) at ../../../src/ioc/db/dbLock.c:197
> #7 0x00007ffff6cd2056 in doCloseLinks (pdbRecordType=0x659d40, precord=0x6b00d0, user=0x0)
    at ../../../src/ioc/misc/iocInit.c:641
> #8 0x00007ffff6cd1b25 in iterateRecords (func=0x7ffff6cd1fc2 <doCloseLinks>, user=0x0)
    at ../../../src/ioc/misc/iocInit.c:462
> #9 0x00007ffff6cd223c in iocShutdown () at ../../../src/ioc/misc/iocInit.c:690
> #10 0x00007ffff6cd22ce in exitDatabase (dummy=0x0) at ../../../src/ioc/misc/iocInit.c:715
> #11 0x00007ffff6799882 in epicsExitCallAtExitsPvt (pep=0x60a9c0) at ../../../src/libCom/misc/epicsExit.c:97
> #12 0x00007ffff6799948 in epicsExitCallAtExits () at ../../../src/libCom/misc/epicsExit.c:115
> #13 0x00007ffff6799b8c in epicsExit (status=0) at ../../../src/libCom/misc/epicsExit.c:185
> #14 0x00000000004044d7 in main (argc=0, argv=0x7fffffffe040) at ../softMain.cpp:240

Andrew Johnson (anj) on 2017-06-02
Changed in epics-base:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers