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: Heinz Junkes via Tech-talk <tech-talk at aps.anl.gov>
To: Mark Rivers <rivers at cars.uchicago.edu>
Cc: Heinz Junkes via Tech-talk <tech-talk at aps.anl.gov>
Date: Thu, 28 Sep 2023 06:52:59 +0200
Hi Mark,

You are right, of course, and I found the place in the program code tonight as well:


The error is generated by NDArray.cpp:

"NDArray.cpp"  line 224

/** Calls NDArrayPool::release() for this object; decreases the reference count for this array. */
int NDArray::release()
{
  const char *functionName = "NDArray::release";

  if (!pNDArrayPool) {
    printf("%s: WARNING, no owner\n", functionName);
    return(ND_ERROR);
  }
  return(pNDArrayPool->release(this));
}

Unfortunately I don't understand why pNDArrayPool doesn't exist?

NDArray::NDArray()
  : referenceCount(0), pNDArrayPool(0), pDriver(0),
    uniqueId(0), timeStamp(0.0), ndims(0), dataType(NDInt8),
    dataSize(0),  pData(0)
{

Your reference to memory corruption is of course good. I run the software on a M2 (aarch64). Possibly this leads to the problem.

My first "quick shot" to mutexes was guided by the error message "no owner”.  I have had problems in the past with mutexes
 that were released from from a different thread than the one that had taken the mutex.

"Mutexes have ownership, unlike semaphores. Only the thread that locked a mutex, (that is, the owner of the mutex), should unlock it.”
e
Danke Heinz

> On 27. Sep 2023, at 23:35, Mark Rivers <rivers at cars.uchicago.edu> wrote:
>
> Hi Heinz,
>
>> NDArray::release: WARNING, no owner
>
> That message means that NDArray.pNDArrayPool is 0.  That could be a memory corruption problem.  What leads you to think that it might be a mutex problem?
>
> Mark
>
>
> -----Original Message-----
> From: Tech-talk <tech-talk-bounces at aps.anl.gov> On Behalf Of Heinz Junkes via Tech-talk
> Sent: Wednesday, September 27, 2023 8:30 AM
> To: Heinz Junkes via Tech-talk <tech-talk at aps.anl.gov>
> Subject: Running area detector simulator IOC on OS X aarch64 (M2) , segmentation fault
>
> Hello,
> I am trying to test on a new MAC with M2 processor areadetector.
> I was able to build it and start a simulator IOC. But when I start the simulator camera I get a segmentation fault. I haven't searched further for the error and wanted to ask here first if someone has alrerady  seen this (and maybe solved it).
>
> epics> dbpf 13SIM1:cam1:Acquire 1
> NDArray::release: WARNING, no owner
> DBF_STRING:         "Acquire"
> ./start_epics: line 2: 31835 Segmentation fault: 11  ../../bin/darwin-aarch64/simDetectorApp st.cmd.darwin
>
>
> I guess it has something to do with Apple's lack of (limited) support for POSIX mutexes?
>
> Danke Heinz
>

Attachment: smime.p7s
Description: S/MIME cryptographic signature


Replies:
Re: Running area detector simulator IOC on OS X aarch64 (M2) , segmentation fault Mark Rivers via Tech-talk
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

Navigate by Date:
Prev: RE: Running area detector simulator IOC on OS X aarch64 (M2) , segmentation fault Mark Rivers via Tech-talk
Next: Re: Running area detector simulator IOC on OS X aarch64 (M2) , segmentation fault 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 
Navigate by Thread:
Prev: RE: Running area detector simulator IOC on OS X aarch64 (M2) , segmentation fault Mark Rivers via Tech-talk
Next: Re: Running area detector simulator IOC on OS X aarch64 (M2) , segmentation fault 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, 28 Sep 2023 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·