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  <20082009  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  <20082009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: assert caveat
From: Andrew Johnson <[email protected]>
To: Till Straumann <[email protected]>
Cc: EPICS Techtalk <[email protected]>
Date: Tue, 14 Oct 2008 08:23:50 -0500 (CDT)
Hi Till,

On Fri, 10 Oct 2008, Till Straumann wrote:

My guess is that a lot of code would break if ever compiled
with -DNDEBUG...

I agree, thanks for pointing this out. I have grepped through the source tree and identified several places where we *must* fix this (but unfortunately you're too late for this to happen before R3.14.10), and more where a fix is desirable but not necessarily essential (because the code is for test purposes only).


These are highly suspect and should be fixed:

ca/nciu.cpp: assert ( this->cacCtx.destroyIO (
ca/comQueSend.h: assert ( pComBuf->push ( val ) );
ca/repeater.cpp: assert ( osiSockAttach() );
gdd/smartGDDPointer.h: assert ( ! this->pValue->reference () );
gdd/smartGDDPointer.h: assert ( ! this->pValue->reference () );
gdd/smartGDDPointer.h: assert ( ! this->pValue->reference () );
gdd/smartGDDPointer.h: assert ( ! this->pValue->unreference () );
gdd/smartGDDPointer.h: assert ( ! pNewValue->reference () );
libCom/osi/os/vxWorks/osdThread.c: assert(semTake(epicsThreadOnceMutex,WAIT_FOREVER)==OK);
libCom/osi/os/vxWorks/osdThread.c: assert(semTake(epicsThreadOnceMutex,WAIT_FOREVER)==OK);
libCom/osi/epicsEvent.h:#define epicsEventMustWait(ID) assert((epicsEventWait ((ID))==epicsEventWaitOK))
libCom/osi/epicsMutex.h:#define epicsMutexMustLock(ID) assert((epicsMutexLock((ID))==epicsMutexLockOK))



The test programs that also do this are:


ca/acctst.c
libCom/cxxTemplates/test/tsBTreeBench.cc
libCom/cxxTemplates/test/resourceLibTest.cc
libCom/cxxTemplates/test/tsBTreeTest.cc

These should be modified to use the epicsUnitTest framework instead of assert.

Unless someone finds a serious problem in the R3.14.10-RC2 release we won't have the opportunity to fix these before the final R3.14.10 release (I don't regard these as serious enough by themselves to stop the release since as long as you don't define NDEBUG there is no problem with the existing code), but we definitely want to get rid of these incorrect usages of assert().

- Andrew


References:
assert caveat Till Straumann

Navigate by Date:
Prev: How have folks been dealing with the Channel Archiver's 2GB index file limit? Tom Cumming
Next: Re: How have folks been dealing with the Channel Archiver's 2GB index file limit? Maren Purves
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  <20082009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: assert caveat Benjamin Franksen
Next: LvEPICS on USB Key pre-release Mauro Giacchini
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  <20082009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 02 Sep 2010 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·