EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

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

Subject: [Bug 1956459] [NEW] epicsThreadTest crashes on vxWorks 6.9.0
From: Dirk Zimoch via Core-talk <core-talk at aps.anl.gov>
To: core-talk at aps.anl.gov
Date: Wed, 05 Jan 2022 13:03:35 -0000
Public bug reported:

Since commit 8fdaa13 "errlog: eltc() re-add flush", epicsThreadTest (and
thus epicsRunLibComTests) crashes on vxWorks 6.9.0 (but not on 6.7!) on
my mv5100 PPC IOC:

------------------------------------
epicsThreadTest  > logfile

program
Exception current instruction address: 0x00000004
Machine Status Register: 0x0208b032
Condition Register: 0x84000882

trcStack aborted: error in top frame
------------------------------------

Unfortunately the stack is so corrupted that it is not tracable.
The faulty address 0x00000004 hints to a dereferenced NULL pointer.

After the test, the logfile contains:
------------------------------------

***** epicsThreadTest *****
1..15
# System has 1 CPUs
ok  1 - ncpus > 0
# main() thread 0x51a8c0
not ok  2 - Join delayed parent (0 seconds) # TODO Thread join doesn't work
ok  3 - Join tests #1 completed
not ok  4 - Join delayed parent (0 seconds) # TODO Thread join doesn't work
ok  5 - Join tests #2 completed
ok  6 - pget == pset
ok  7 - thread.getPriority() == epicsThreadGetPriority(self)
ok  8 - pget == pset
ok  9 - thread.getPriority() == epicsThreadGetPriority(self)
ok 10 - pget == pset
ok 11 - thread.getPriority() == epicsThreadGetPriority(self)
not ok 12 - infoB.didSomething
not ok 13 - infoA.didSomething
not ok 14 - threadA epicsThreadIsOkToBlock() = 1280
not ok 15 - threadB epicsThreadIsOkToBlock() = 6279168
------------------------------------

It ends just before the test results are printed.

My analysis shows that the crash is most likely related to the fact that
epicsThreadMustJoin() is non-functional on vxWorks 6.9.0 and thus
testOkToBlock() exits before the test threads finish. This takes the
local variables infoA and infoB out of context while the test threads
are still using them. This overwrites local variables (or the call
stack) in the next function eltc().

The solution is to make infoA and infoB static (or global). Or skip the
whole test #ifndef EPICS_THREAD_CAN_JOIN.

** Affects: epics-base
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of EPICS
Core Developers, which is subscribed to EPICS Base.
Matching subscriptions: epics-core-list-subscription
https://bugs.launchpad.net/bugs/1956459

Title:
  epicsThreadTest crashes on vxWorks 6.9.0

Status in EPICS Base:
  New

Bug description:
  Since commit 8fdaa13 "errlog: eltc() re-add flush", epicsThreadTest
  (and thus epicsRunLibComTests) crashes on vxWorks 6.9.0 (but not on
  6.7!) on my mv5100 PPC IOC:

  ------------------------------------
  epicsThreadTest  > logfile

  program
  Exception current instruction address: 0x00000004
  Machine Status Register: 0x0208b032
  Condition Register: 0x84000882

  trcStack aborted: error in top frame
  ------------------------------------

  Unfortunately the stack is so corrupted that it is not tracable.
  The faulty address 0x00000004 hints to a dereferenced NULL pointer.

  After the test, the logfile contains:
  ------------------------------------

  ***** epicsThreadTest *****
  1..15
  # System has 1 CPUs
  ok  1 - ncpus > 0
  # main() thread 0x51a8c0
  not ok  2 - Join delayed parent (0 seconds) # TODO Thread join doesn't work
  ok  3 - Join tests #1 completed
  not ok  4 - Join delayed parent (0 seconds) # TODO Thread join doesn't work
  ok  5 - Join tests #2 completed
  ok  6 - pget == pset
  ok  7 - thread.getPriority() == epicsThreadGetPriority(self)
  ok  8 - pget == pset
  ok  9 - thread.getPriority() == epicsThreadGetPriority(self)
  ok 10 - pget == pset
  ok 11 - thread.getPriority() == epicsThreadGetPriority(self)
  not ok 12 - infoB.didSomething
  not ok 13 - infoA.didSomething
  not ok 14 - threadA epicsThreadIsOkToBlock() = 1280
  not ok 15 - threadB epicsThreadIsOkToBlock() = 6279168
  ------------------------------------

  It ends just before the test results are printed.

  My analysis shows that the crash is most likely related to the fact
  that epicsThreadMustJoin() is non-functional on vxWorks 6.9.0 and thus
  testOkToBlock() exits before the test threads finish. This takes the
  local variables infoA and infoB out of context while the test threads
  are still using them. This overwrites local variables (or the call
  stack) in the next function eltc().

  The solution is to make infoA and infoB static (or global). Or skip
  the whole test #ifndef EPICS_THREAD_CAN_JOIN.

To manage notifications about this bug go to:
https://bugs.launchpad.net/epics-base/+bug/1956459/+subscriptions


Navigate by Date:
Prev: Re: breaktable name incompatibilities Michael Davidsaver via Core-talk
Next: Build completed: EPICS Base 7 base-7.0-454 AppVeyor via Core-talk
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  <2022
Navigate by Thread:
Prev: Re: breaktable name incompatibilities Michael Davidsaver via Core-talk
Next: Build completed: EPICS Base 7 base-7.0-454 AppVeyor via Core-talk
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  <2022
ANJ, 05 Jan 2022 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·