Jeff Hill wrote:
> Till,
>
> I think that we already eradicated that one along the way to the next
> R3.14 release. See attached. Nevertheless, thanks for the heads up.
>
> Jeff
Jeff.
>From the attached diff it is not obvious to me what your fix is
- would you mind giving me a hint, please?
I am not sure if 8byte alignment is enough
(e.g. optimized code on PPC/altivec may need 16 bytes.)
IMHO, it would be best to preserve the alignment
returned by malloc()
-- Till
>
>
> ----------------------------
> Revision : 1.23
> Date : 2002/1/15 20:2:45
> Author : 'jhill'
> State : 'Exp'
> Lines : +2 -2
> Description :
> fixed to preserve 8 byte alignment
>
> cvs diff -r 1.23 -r 1.22 tsFreeList.h (in directory
> D:\users\hill\epicsDvl\epics\base\src\libCom\cxxTemplates\)
> Index: tsFreeList.h
> ===================================================================
> RCS file:
> /net/phoebus/epicsmgr/cvsroot/epics/base/src/libCom/cxxTemplates/tsFreeL
> ist.h,v
> retrieving revision 1.23
> retrieving revision 1.22
> diff -r1.23 -r1.22
> 2c2
> < /* $Id: tsFreeList.h,v 1.23 2002/01/15 20:02:45 jhill Exp $
> ---
> > /* $Id: tsFreeList.h,v 1.22 2002/01/15 16:46:11 jhill Exp $
> 75d74
> < char pad[ sizeof ( T ) ];
> 76a76
> > char pad[ sizeof ( T ) ];
>
> *****CVS exited normally with code 1*****
>
> > -----Original Message-----
> > From: [email protected]
> > [mailto:[email protected]] On Behalf Of Till Straumann
> > Sent: Thursday, April 04, 2002 9:04 PM
> > To: [email protected]
> > Cc: [email protected]
> > Subject: ca_test bus error on solaris-sparc-gnu + fix
> >
> > Hi all.
> >
> > We got a SIGBUS (due to an alignment violation)
> > running ca_test (and other apps)
> >
> > EPICS: 3.14.0.beta1
> > system: solaris-sparc-gnu
> > compiler: egcs-2.91.66
> >
> > I found that
> >
> > void *
> > tsFreeList<T,N,DEBUG_LEVEL>::allocate(size_t)
> >
> > may return improperly aligned memory:
> > Because 'items' are declared
> >
> > union {
> > tsFreeListItem<T,...> *pNext;
> > char pad[sizeof(T)];
> > }
> >
> > the compiler only makes sure 'items' fulfill
> > the alignment requirements of pNext.
> >
> > However, 'items' may need stricter alignment
> > (which goes unnoticed because the 'item' pointer
> > is later cast to (void*)): e.g. it may contain a double
> > which on sparc needs to be 8byte aligned...
> >
> > The proposed fix is to put the 'items' into a
> > chunk first, so they get the chunk's alignment.
> >
> > Unfortunately, this fix breaks binary compatibility
> > - everything needs to be rebuilt.
> >
> > Regards,
> >
> > -- Till
- Replies:
- Re: ca_test bus error on solaris-sparc-gnu + fix Andrew Johnson
- RE: ca_test bus error on solaris-sparc-gnu + fix Jeff Hill
- References:
- RE: ca_test bus error on solaris-sparc-gnu + fix Jeff Hill
- Navigate by Date:
- Prev:
waveform record question Pedro Gigoux
- Next:
Re: ca_test bus error on solaris-sparc-gnu + fix Andrew Johnson
- 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
- Navigate by Thread:
- Prev:
RE: ca_test bus error on solaris-sparc-gnu + fix Jeff Hill
- Next:
Re: ca_test bus error on solaris-sparc-gnu + fix Andrew Johnson
- 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
|