EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  <20072008  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  <20072008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: EPICS/RTEMS bug in osdPoolStatus.c
From: Kate Feng <[email protected]>
To: [email protected]
Date: Mon, 11 Jun 2007 10:04:03 -0400
EPICS  OSI Release : 3.14.x   ( at least 3.14.6 and up )
File : src/libCom/osi/os/RTEMS/osdPoolStatus.c

Problem :
"return (malloc_free_space() > 50000 + contiguousBlockSize);"
will falsely return true when RTEMS function call
malloc_free_space() returns -1, which actually indicates
an internal RTEMS error such as corrupted heap,or illegal
region id etc.  Since neither EPICS nor RTEMS prints out
the error condition, this kind of error could be hard to be
debugged.


FIX : src/libCom/osi/os/RTEMS/osdPoolStatus.c
return ( ((int) malloc_free_space()) > 50000 + contiguousBlockSize);

Or I actually preferred  something like :

/*
 * osiSufficentSpaceInPool ()
 */
epicsShareFunc int epicsShareAPI osiSufficentSpaceInPool ( size_t
contiguousBlockSize )
{
  int free;

  if ( (free=malloc_free_space())==-1)
     return(0);
  if ( free < 100000 + contiguousBlockSize) {
    printf("Largest free space available : 0x%x,  requested
contiguousBlockSize : 0x%x\n",
    free, contiguousBlockSize);
    return(0);
  }
  return(1);
}

Besides, RTEMS should print out what the internal error message is.

Regards,
Kate


Replies:
Re: EPICS/RTEMS bug in osdPoolStatus.c Till Straumann

Navigate by Date:
Prev: Re: IK320 problem Juraj Krempasky
Next: Re: IK320 problem Ronald L. Sluiter
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  <20072008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: RE: IK320 problem Shepherd, EL (Emma)
Next: Re: EPICS/RTEMS bug in osdPoolStatus.c Till Straumann
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  <20072008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 10 Nov 2011 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·