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  2021  2022  <20232024  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  2021  2022  <20232024 
<== Date ==> <== Thread ==>

Subject: RE: Running area detector simulator IOC on OS X aarch64 (M2) , segmentation fault
From: Mark Rivers via Tech-talk <tech-talk at aps.anl.gov>
To: Heinz Junkes <junkes at fhi-berlin.mpg.de>, Érico Nogueira Rolim <erico.rolim at lnls.br>
Cc: "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov>
Date: Wed, 4 Oct 2023 20:56:21 +0000

Hi Heinz,

 

I ran the C++ demangler on your stack trace.  This is the call stack:

 

NDArrayPool::release(NDArray*)
simDetector::computeImage()

simDetector::simTask()

simTaskC(void*)

 

So, the error occurs when simDetector::computeImage calls NDArray::release().  Unfortunately, the offset in the stack trace is in bytes, not line numbers.  But the error must be either in the 4 lines beginning here:

https://github.com/areaDetector/ADSimDetector/blob/997c4c9b5576605caf99cc91a80725934ff71504/simDetectorApp/src/simDetector.cpp#L627

 

or in this line:

https://github.com/areaDetector/ADSimDetector/blob/997c4c9b5576605caf99cc91a80725934ff71504/simDetectorApp/src/simDetector.cpp#L696

 

I realized this is because pBackground_, pRamp_, and pPeak_ are not initialized to NULL in the constructor, so it can deference an uninitialized NDArray pointer.

 

I am embarrassed to see that there was an outstanding 1.5 year old Pull Request from Gary Yandell that fixes this exact problem.

 

I have merged that PR.  I suspect it will fix your problem.

 

Mark

 

 

 

From: Tech-talk <tech-talk-bounces at aps.anl.gov> On Behalf Of Heinz Junkes via Tech-talk
Sent: Wednesday, October 4, 2023 3:19 PM
To: Érico Nogueira Rolim <erico.rolim at lnls.br>
Cc: tech-talk at aps.anl.gov
Subject: Re: Running area detector simulator IOC on OS X aarch64 (M2) , segmentation fault

 

Hi Érico,

 

i have now tried the whole thing on darwin-x86 and get this:

 

 

epics> save_restore:write_save_file: Backup file (./autosave/auto_settings.savB) bad or not found.  Writing a new one. [231004-221444]

dbpf 13SIM1:cam1:Acquire 1

DBF_STRING:         "Acquire"

NDArrayPool:release ERROR, reference count < 0 pArray=0x7fa034009508

Thread SimDetTask (0x60000306dd40) can't proceed, suspending.

Dumping a stack trace of thread 'SimDetTask':

epics> [       0x10883c300]: /Users/junkes/EPICS/epics-base/lib/darwin-x86/libCom.3.22.1.dylib(epicsStackTrace+0x70)

[       0x10882d25e]: /Users/junkes/EPICS/epics-base/lib/darwin-x86/libCom.3.22.1.dylib(cantProceed+0xae)

[       0x107195e97]: /Users/junkes/EPICS/epics-support/areaDetector/ADCore/lib/darwin-x86/libADBase.dylib(_ZN11NDArrayPool7releaseEP7NDArray+0x167)

[       0x107120f82]: /Users/junkes/EPICS/epics-support/areaDetector/ADSimDetector/lib/darwin-x86/libsimDetector.dylib(_ZN11simDetector12computeImageEv+0x672)

[       0x1071234a6]: /Users/junkes/EPICS/epics-support/areaDetector/ADSimDetector/lib/darwin-x86/libsimDetector.dylib(_ZN11simDetector7simTaskEv+0x156)

[       0x1071247b9]: /Users/junkes/EPICS/epics-support/areaDetector/ADSimDetector/lib/darwin-x86/libsimDetector.dylib(_ZL8simTaskCPv+0x9)

[       0x10883780b]: /Users/junkes/EPICS/epics-base/lib/darwin-x86/libCom.3.22.1.dylib(start_routine+0x14b)

[    0x7ff8141381d3]: /usr/lib/system/libsystem_pthread.dylib(_pthread_start+0x7d)

[    0x7ff814133bd3]: /usr/lib/system/libsystem_pthread.dylib(thread_start+0xf)

 

 

 



On 28. Sep 2023, at 15:59, Érico Nogueira Rolim <erico.rolim at lnls.br> wrote:

 

Hi,

 

If getting a traceback via a debugger is an option, then you can also attempt to set a watchpoint for the pNDArrayPool member of the NDArray object, in order to find out when it gets set to 0.

 

Cheers,

Érico

 

On 28/09/2023 10:18, Mark Rivers via Tech-talk wrote:

Hi Heinz,

 

Some questions:

  • Have any images been collected before this error?
  • What plugins are running?
  • What happens if you disable all plugins before starting acquisition?
  • Can you get a traceback when NDArray::release is called and NDArray.pNDArrayPool is 0?  

Mark

 

 

 

Aviso Legal: Esta mensagem e seus anexos podem conter informações confidenciais e/ou de uso restrito. Observe atentamente seu conteúdo e considere eventual consulta ao remetente antes de copiá-la, divulgá-la ou distribuí-la. Se você recebeu esta mensagem por engano, por favor avise o remetente e apague-a imediatamente.

Disclaimer: This email and its attachments may contain confidential and/or privileged information. Observe its content carefully and consider possible querying to the sender before copying, disclosing or distributing it. If you have received this email by mistake, please notify the sender and delete it immediately.

 


References:
Running area detector simulator IOC on OS X aarch64 (M2) , segmentation fault Heinz Junkes via Tech-talk
RE: Running area detector simulator IOC on OS X aarch64 (M2) , segmentation fault Mark Rivers via Tech-talk
Re: Running area detector simulator IOC on OS X aarch64 (M2) , segmentation fault Heinz Junkes via Tech-talk
Re: Running area detector simulator IOC on OS X aarch64 (M2) , segmentation fault Mark Rivers via Tech-talk
Re: Running area detector simulator IOC on OS X aarch64 (M2) , segmentation fault Érico Nogueira Rolim via Tech-talk
Re: Running area detector simulator IOC on OS X aarch64 (M2) , segmentation fault Heinz Junkes via Tech-talk

Navigate by Date:
Prev: Re: Running area detector simulator IOC on OS X aarch64 (M2) , segmentation fault Heinz Junkes via Tech-talk
Next: Provision for alying sound file in CS-Studio Anindya Roy 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  2021  2022  <20232024 
Navigate by Thread:
Prev: Re: Running area detector simulator IOC on OS X aarch64 (M2) , segmentation fault Heinz Junkes via Tech-talk
Next: Warning when building ADLightField for windows-x64 with VS2022 Mark Rivers 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  2021  2022  <20232024 
ANJ, 05 Oct 2023 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·