I suggest using gdb to figure out where it is hung the first time you launch it using Python.
I see you are loading URLDriver.db. That is not what is distributed with ADURL, which is URLDriver.template. How does it differ?
Mark
From: Tech-talk <tech-talk-bounces at aps.anl.gov>
On Behalf Of Simon Rose via Tech-talk
Sent: Thursday, April 2, 2020 4:31 AM
To: tech-talk at aps.anl.gov
Subject: Consistently inconsistent behaviour when testing ADURL
Hello –
We have been seeing some strange behavior when testing ADURL. Note that we are building our EPICS modules in a docker environment that runs conda, so we can ensure consistent behavior across builds. We also
use an environment similar to that at PSI with a require module that dynamically loads other EPICS modules.
We use a python script to test the startup of an IOC. Essentially it runs the IOC in a subprocess, waits a little while, sends the command “exit”, and then inspects the output to see if there were any problems.
Anyhow, what happens--consistently!--is that the first time you run this test after the ADUrl module is built is that it hangs when trying to read the stdout from the subprocess. You can then break out of
it, and then running it a second (or third, or fourth, etc.) time exits as expected. Consistently.
The startup script that causes the issue is the following:
require adurl
require busy
epicsEnvSet("IOC", "iocURLTest")
epicsEnvSet("TOP", ".")
epicsEnvSet("PREFIX", "URL1:")
epicsEnvSet("EPICS_CA_MAX_ARRAY_BYTES","64000000")
epicsEnvSet("PORT", "URL1")
URLDriverConfig("$(PORT)", 0, 0)
dbLoadRecords("$(adurl_DIR)/db/URLDriver.db","P=$(PREFIX),R=cam1:,PORT=$(PORT),ADDR=0,TIMEOUT=1")
iocInit()
If we remove the dbLoadRecords call, however, it works as expected.
To summarize:
- If you use the python wrapper to run the IOC using the above script, it hangs the first time. If you run it again (and again, and again), it exits as expected.
- If you instead begin by running the IOC directly from the command line, it runs as expected. If you follow this by using the python wrapper, then it also runs and exits as
expected.
- The first run (and all subsequent ones) succeeds if you comment out the dbLoadRecords() line.
The above suggests that something funny happens the first time you run dbLoadRecords(), but I do not have any idea what that is.
We have a workaround at the moment, but this is just so mysterious and we would like to understand what exactly is happening here.
Thanks in advance,
Cheers,
Simon Rose
Software Engineer
European Spallation Source