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  <20182019  2020  2021  2022  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  <20182019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: Problem with autosave module making it crash at random basis.
From: "Mooney, Tim M." <[email protected]>
To: "Konrad, Martin" <[email protected]>, Abdalla Ahmad <[email protected]>, "[email protected]" <[email protected]>
Date: Mon, 16 Apr 2018 19:32:25 +0000

Hi Abdalla,

Have you tried running a more recent version of autosave?  Since the version tagged "synApps_5_6" (which is also tagged R4-8),

I found a string buffer being overrun, and went through systematically, replacing strcpy with strncpy, strcat with strncat, and sprintf with snprintf.

You could rule buffer overrun out as a cause by running R5-6-2 or later.


Tim Mooney ([email protected]) (630)252-5417
Beamline Controls Group (www.aps.anl.gov)
Advanced Photon Source, Argonne National Lab


From: [email protected] <[email protected]> on behalf of Konrad, Martin <[email protected]>
Sent: Monday, April 16, 2018 1:03:21 PM
To: Abdalla Ahmad; [email protected]
Subject: Re: Problem with autosave module making it crash at random basis.
 
Hi Abdalla,
> The first 2 lines are the IOC shell output before the segmentation
> fault happened.
Seems like it's happening in this line:

https://github.com/epics-modules/autosave/blob/synApps_5_6/asApp/src/save_restore.c#L1371

I can think of 3 reasons why it might crash:

1. Invalid file descriptor out_fd
2. Invalid C string SRversion - which BTW seems to contain a wrong
version number ;-)
3. Invalid C string datetime

(2) Seems unlikely as SRversion is a pointer to a constant string.
Regarding (3): This gets populated in [1]. Note that the whole function
has been rewritten recently [2]. I'm wondering if this is because
someone else ran into problems... Missing 0-termination for example
might cause a segfault. You might want to try the latest version of
fGetDateStr.c. I would also recommend to run your IOC in the debugger so
you can inspect these variables after the IOC crashed (or turn on core
files).

-Martin

[1]
https://github.com/epics-modules/autosave/blob/synApps_5_6/asApp/src/fGetDateStr.c
[2]
https://github.com/epics-modules/autosave/commit/39d1dcbfbbf0971dc6fd6f13b0e77d65e21b577c#diff-101e75ddd0243986d9009539b0f7ece1

--
Martin Konrad
High Performance Controls Team Leader
Facility for Rare Isotope Beams
Michigan State University
640 South Shaw Lane
East Lansing, MI 48824-1321, USA
Tel. 517-908-7253
Email: [email protected]

Replies:
RE: Problem with autosave module making it crash at random basis. Abdalla Ahmad
References:
Re: Problem with autosave module making it crash at random basis. Konrad, Martin

Navigate by Date:
Prev: Re: Possible deadlock issue with asyn layer? Mark Davis
Next: Re: Possible deadlock issue with asyn layer? Pearson, Matthew R.
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  <20182019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: Problem with autosave module making it crash at random basis. Konrad, Martin
Next: RE: Problem with autosave module making it crash at random basis. Abdalla Ahmad
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  <20182019  2020  2021  2022  2023  2024 
ANJ, 17 Apr 2018 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·