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 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 <2018> 2019 2020 2021 2022 2023 2024 |
<== Date ==> | <== Thread ==> |
---|
Subject: | Re: EDM X/Y Plot segfaults |
From: | Bruce Hill <[email protected]> |
To: | Eric Norum <[email protected]> |
Cc: | Gregory Portmann <[email protected]>, Michael Chin <[email protected]>, EPICS Tech-Talk <[email protected]> |
Date: | Wed, 23 May 2018 18:15:31 -0700 |
Hi Eric, We use xygraph for many displays at SLAC and generally it works well without crashing. However, recently one of our developers found a repeatable crash related to xygraph that she suggested may be related to your crash. The crash scenario she found involves one screen running an xygraph w/ several traces, each w/ 8k x and y arrays. If we then try to open or execute another screen w/ 6 xygraph's, each w/ 8 similar traces, it would crash every time. gdb stack trace wasn't exactly the same as yours and would vary as to where it crashed, but it always involved a NULL yPvData[i]. Cutting back on the number of xygraphs in the 2nd screen or the number of traces appears to make the crash less likely, and if I remove enough of them, it can succeed. My hypothesis re the root cause is that the xygraph is redrawing before all the PV's have reconnected. To address this, I added tests for NULL xPvData[i] and NULL yPvData[i] at the top of genXyVector() and genChronoVector(). If EDMDEBUGMODE is set to a non-zero value it prints an error msg each time xygraph would have crashed. With this patch we can run the full test screens and see 4 or 5 of the NULL yPvData error msgs. The trace isn't drawn if xPvData[i] or yPvData[i] is NULL, but it doesn't crash and subsequent trace updates work ok. I don't know if this patch will fix your issue, but the patch is attached if you want to give it a try. Cheers, - Bruce On 05/09/2018 11:38 AM, Eric Norum
wrote:
-- Bruce Hill Member Technical Staff SLAC National Accelerator Lab 2575 Sand Hill Road M/S 10 Menlo Park, CA 94025 |
diff --git a/baselib/xygraph.cc b/baselib/xygraph.cc index f655342..f4b0e1b 100644 --- a/baselib/xygraph.cc +++ b/baselib/xygraph.cc @@ -6291,6 +6291,19 @@ int ctl; if ( ctl ) return; + if ( xPvData[i] == NULL ) + { + if ( debugMode() ) + printf( "xyGraphClass::genChronoVector: trace %d NULL xPvData\n", i ); + return; + } + if ( yPvData[i] == NULL ) + { + if ( debugMode() ) + printf( "xyGraphClass::genChronoVector: trace %d NULL yPvData\n", i ); + return; + } + yi = 0; if ( y2Scale[i] ) yi = 1; @@ -6576,6 +6589,19 @@ int ctl; if ( ctl ) return; + if ( xPvData[i] == NULL ) + { + if ( debugMode() ) + printf( "xyGraphClass::genXyVector: trace %d NULL xPvData\n", i ); + return; + } + if ( yPvData[i] == NULL ) + { + if ( debugMode() ) + printf( "xyGraphClass::genXyVector: trace %d NULL yPvData\n", i ); + return; + } + yi = 0; if ( y2Scale[i] ) yi = 1;