EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  <20142015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  <20142015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: 3.15 assertion failure from dbLock.c on IOC exit
From: Andrew Johnson <[email protected]>
To: <[email protected]>
Date: Fri, 25 Jul 2014 18:01:45 -0500
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 07/25/2014 12:43 PM, Michael Davidsaver wrote:
> The small change to the startup order allows the hello.db example
> to shutdown.

>> diff --git a/src/ioc/misc/iocInit.c b/src/ioc/misc/iocInit.c 
>> index 5f3d505..5e950af 100644 --- a/src/ioc/misc/iocInit.c +++
>> b/src/ioc/misc/iocInit.c @@ -135,8 +135,8 @@ static int
>> iocBuild_2(void) initDevSup(); 
>> initHookAnnounce(initHookAfterInitDevSup);
>> 
>> -    initDatabase(); dbLockInitRecords(pdbbase); +
>> initDatabase(); dbBkptInit(); 
>> initHookAnnounce(initHookAfterInitDatabase);

Is this change actually correct? ... No, it's not, it gives me one
lock-set per record even when there are DB links connecting all my
records together. This is from a test database with lots of DB links
in it:

> epics> dblsr * 1 globalLock 0x24c7ac0 lockSetModifyLock 0x24c7b30 
> Lock Set 1 1 members epicsMutexId 0x24c7c50 Not Locked 
> anj:seq-compat Lock Set 2 1 members epicsMutexId 0x24c7c80 Not
> Locked anj:seq-new Lock Set 3 1 members epicsMutexId 0x24da5a0 Not
> Locked anj:so0 Lock Set 4 1 members epicsMutexId 0x24da680 Not
> Locked anj:so1 Lock Set 5 1 members epicsMutexId 0x24da760 Not
> Locked anj:so2 Lock Set 6 1 members epicsMutexId 0x24da840 Not
> Locked anj:so3 Lock Set 7 1 members epicsMutexId 0x24da920 Not
> Locked anj:so4 Lock Set 8 1 members epicsMutexId 0x24daa00 Not
> Locked anj:so5 Lock Set 9 1 members epicsMutexId 0x24daae0 Not
> Locked anj:so6 Lock Set 10 1 members epicsMutexId 0x24dabc0 Not
> Locked anj:so7 Lock Set 11 1 members epicsMutexId 0x24daca0 Not
> Locked anj:so8 Lock Set 12 1 members epicsMutexId 0x24dad80 Not
> Locked anj:so9 Lock Set 13 1 members epicsMutexId 0x24dae60 Not
> Locked anj:soA Lock Set 14 1 members epicsMutexId 0x24daf40 Not
> Locked anj:soB Lock Set 15 1 members epicsMutexId 0x24db020 Not
> Locked anj:soC Lock Set 16 1 members epicsMutexId 0x24db100 Not
> Locked anj:soD Lock Set 17 1 members epicsMutexId 0x24db1e0 Not
> Locked anj:soE Lock Set 18 1 members epicsMutexId 0x24db2c0 Not
> Locked anj:soF Lock Set 19 1 members epicsMutexId 0x24db3a0 Not
> Locked anj:select epics> dbpr anj:seq-new 1 ASG:
> BKPT: 00            DESC:               DISA: 0 DISP: 0
> DISS: NO_ALARM      DISV: 1             DLY0: 0.2 DLY1: 0.2
> DLY2: 0.2           DLY3: 0.2           DLY4: 0.2 DLY5: 0.2
> DLY6: 0.2           DLY7: 0.2           DLY8: 0.2 DLY9: 0.2
> DLYA: 0.2           DLYB: 0.2           DLYC: 0.2 DLYD: 0.2
> DLYE: 0.2           DLYF: 0.2           DO0: 0 DO1: 0
> DO2: 0              DO3: 0              DO4: 0 DO5: 0
> DO6: 0              DO7: 0              DO8: 0 DO9: 0
> DOA: 0              DOB: 0              DOC: 0 DOD: 0
> DOE: 0              DOF: 0              DOL0:CONSTANT DOL1:CONSTANT
> DOL2:CONSTANT       DOL3:CONSTANT       DOL4:CONSTANT DOL5:CONSTANT
> DOL6:CONSTANT       DOL7:CONSTANT       DOL8:CONSTANT DOL9:CONSTANT
> DOLA:CONSTANT       DOLB:CONSTANT       DOLC:CONSTANT DOLD:CONSTANT
> DOLE:CONSTANT       DOLF:CONSTANT       DTYP: <nil> EVNT:
> FLNK:CONSTANT 0     LNK0:DB_LINK anj:so0.PROC NPP NMS LNK1:DB_LINK
> anj:so1.PROC NPP NMS       LNK2:DB_LINK anj:so2.PROC NPP NMS
>  LNK3:DB_LINK anj:so3.PROC NPP NMS       LNK4:DB_LINK anj:so4.PROC
> NPP NMS LNK5:DB_LINK anj:so5.PROC NPP NMS       LNK6:DB_LINK
> anj:so6.PROC NPP NMS LNK7:DB_LINK anj:so7.PROC NPP NMS
> LNK8:DB_LINK anj:so8.PROC NPP NMS LNK9:DB_LINK anj:so9.PROC NPP NMS
> LNKA:DB_LINK anj:soA.PROC NPP NMS LNKB:DB_LINK anj:soB.PROC NPP NMS
> LNKC:DB_LINK anj:soC.PROC NPP NMS LNKD:DB_LINK anj:soD.PROC NPP NMS
> LNKE:DB_LINK anj:soE.PROC NPP NMS LNKF:DB_LINK anj:soF.PROC NPP NMS
> NAME: anj:seq-new   OFFS: 0 PACT: 0             PHAS: 0
> PINI: NO            PREC: 0 PRIO: LOW           PUTF: 0
> RPRO: 0             SCAN: Passive SDIS:CONSTANT       SELL:DB_LINK
> anj:select NPP NMS         SELM: Specified SELN: 1
> SEVR: INVALID       SHFT: 0             STAT: UDF TPRO: 0
> TSE: 0              TSEL:CONSTANT       UDF: 1 UDFS: INVALID
> VAL: 0 epics>


The dbLockInitRecords() routine looks at all the links in each record
that have plink->type == DB_LINK and calls dbLockSetMerge() as it
finds them. However the plink->type gets converted from PV_LINK to
DB_LINK in initDatabase() by doResolveLinks() -> dbInitLink() ->
dbDbInitLink().

Maybe we should move the dbLockSetMerge() call from
dbLockInitRecords() into dbDbInitLink()? We already adjust lock-sets
in the dbDbAddLink() and dbDbRemoveLink() routines, so it makes a lot
of sense to put it there. Have to be careful to adjust dbDbAddLink()
which was calling dbDbInitLink() but now I get the right result:

> epics> dblsr * 1 globalLock 0x1be5a20 lockSetModifyLock 0x1be5a90 
> Lock Set 2 19 members epicsMutexId 0x1be5be0 Not Locked 
> anj:seq-new anj:seq-compat anj:select anj:so1 anj:so2 anj:so3 
> anj:so4 anj:so5 anj:so6 anj:so7 anj:so8 anj:so9 anj:soA anj:so0 
> anj:soB anj:soC anj:soD anj:soE anj:soF

Fix committed.

- - Andrew

- -- 
Advertising may be described as the science of arresting the human
intelligence long enough to get money from it. -- Stephen Leacock
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJT0uHZAAoJENMGEg7qy0V2Fm4IAII8d6nJ5HQOv9BmmvKAOlSA
o8+LFGARne5GOFOaY5SUBH4EZJvkQelyANDPgJG6p1pP/iNojLQpYuz+vnVd4eTo
N26WykTv/4FYGxiVy8JiKqZVpAM5fx9lR0bx8n9gs858/8/y+jzQ6Lb2tHU2Z6kD
VafjUlcg9PFlZU+kXMW2wKBQ48R6bBalNalXhYy0nnRqCn+VyTZmYYYLuzcnpy1n
l7WT83qD49wVUSvbw6kynkTjKRsmZESboOxrbVqc0gBihRDFgAS2H+pUJyyERUJ4
6eH0itd8lSWgjq9fwfhdeh1x44M0zT826/Rdx5ZBgOmPVdUEC2f2f1CNOaH21Iw=
=dQfE
-----END PGP SIGNATURE-----

Replies:
Re: 3.15 assertion failure from dbLock.c on IOC exit Michael Davidsaver
References:
3.15 assertion failure from dbLock.c on IOC exit Andrew Johnson
Re: 3.15 assertion failure from dbLock.c on IOC exit Michael Davidsaver
Re: 3.15 assertion failure from dbLock.c on IOC exit Michael Davidsaver

Navigate by Date:
Prev: Re: 3.15 assertion failure from dbLock.c on IOC exit Michael Davidsaver
Next: Re: 3.15 assertion failure from dbLock.c on IOC exit Michael Davidsaver
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  <20142015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: 3.15 assertion failure from dbLock.c on IOC exit Michael Davidsaver
Next: Re: 3.15 assertion failure from dbLock.c on IOC exit Michael Davidsaver
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  <20142015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 28 Jul 2014 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·