EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  <20212022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  <20212022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: Trying to use elauncher: _main_ thread failed
From: "Johnson, Andrew N. via Tech-talk" <tech-talk at aps.anl.gov>
To: "Crisp, Daniel" <CrispD at nscl.msu.edu>
Cc: "Barofsky, Daniel" <barofsky at nscl.msu.edu>, EPICS tech-talk <tech-talk at aps.anl.gov>
Date: Mon, 6 Dec 2021 22:36:39 +0000
Hi Daniel,

On Dec 6, 2021, at 3:03 PM, Crisp, Daniel via Tech-talk <tech-talk at aps.anl.gov> wrote:

I don't see much documentation about what we call 'elauncher' here, so I'm thinking it might be something site specific?

Seems likely, or shared from some other site; I don’t recognize if myself.


In any case, It's what we use to add PVs that trigger python scripts to our IOCs. I've attached the source code we add to our src/ folder. We also have an elaunchSupport.dbd file that simply contains two lines 'device(bo, INST_IO, devLauncher, "Launcher")'' and 'variable(launcherVerbose, int)'.

You must also be loading a .db file with a bo record for each elauncher instance in the IOC.


I'm getting an error when attempting to start the IOC, and I'm wondering if someone here could enlighten me as to the problem:

A call to 'assert(prec->out.type == INST_IO)' by thread '_main_' failed in ../launcher.c line 80.
Dumping a stack trace of thread '_main_':

This is the code which is asserting, from your launcher.c file, plus a few lines afterwards…

    assert(prec->out.type == INST_IO);

    dbInitEntry(pdbbase, &entry);

    dbFindRecord(&entry, prec->name); /* can't fail */

    if(dbFindInfo(&entry, "cmd")==0) {
        priv->cmd = epicsStrDup(dbGetInfoString(&entry));
    } else {
        priv->cmd = epicsStrDup(prec->out.value.instio.string);
    }

The assertion says that the record’s OUT field must be populated with an INST_IO address (a string that starts with an @ symbol) which can be used to set the command to be run. However the code also allows an info tag called “cmd” to be used to set that command instead.

My guess is that at least one of your elauncher bo records doesn’t have its OUT field set at all. Presumably someone saw that they could use an info(cmd, "command") tag instead, but they didn’t realize that the assert was there and still has to pass for the IOC to initialize, so you need to add this line to any record that uses the info tag:

    field(OUT, "@")

Alternatively could move the assert() statement into the else {} block above, so the OUT field type would only get checked if no info tag is present.

HTH,

- Andrew

-- 
Complexity comes for free, simplicity you have to work for.


References:
Trying to use elauncher: _main_ thread failed Crisp, Daniel via Tech-talk

Navigate by Date:
Prev: Re: Infinite FLNK loop Johnson, Andrew N. via Tech-talk
Next: Re: CentOS Alternatives Han Lee via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  <20212022  2023  2024 
Navigate by Thread:
Prev: Trying to use elauncher: _main_ thread failed Crisp, Daniel via Tech-talk
Next: Re: Trying to use elauncher: _main_ thread failed Hu, Yong via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  <20212022  2023  2024 
ANJ, 07 Dec 2021 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·