2002 2003 2004 2005 <2006> 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 | Index | 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: osiSockDiscoverBroadcastAddresses(): pointer not word-aligned? |
From: | Ralph Lange <[email protected]> |
To: | Eric Norum <[email protected]> |
Cc: | Jeff Hill <[email protected]>, EPICS Core Talk <[email protected]>, Ralf Hartmann <[email protected]> |
Date: | Tue, 22 Aug 2006 18:26:57 +0200 |
Nah. Sorry. Darn. calloc() is working - our assert had the big bug right in the expression :-) You were obviously much closer -Doing the printout in ifreqNext() that you suggested, we find the size of the first structure coming up is 70 (dec), which is not divisible by 4, which leads to the pointer to the second structure being misaligned.
Who decides the size of the ifreq structure and doesn't pad correctly? Or should we do the padding up there?
Ralph & Ralf Eric Norum wrote:
That sounds like a pretty big bug in the newlib library or the underlying RTEMS memory allocator!Or heap-space corruption....... On Aug 22, 2006, at 10:55 AM, Ralph Lange wrote:We're now at a point where we can see that the calloc() that creates the array returns an odd pointer. Are we right that this is a faulty implementation of calloc()? (Which is supposed to "return a pointer aligned to suit any type of variable"?)