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"?)
- Replies:
- Re: osiSockDiscoverBroadcastAddresses(): pointer not word-aligned? Eric Norum
- References:
- osiSockDiscoverBroadcastAddresses(): pointer not word-aligned? Ralph Lange
- Re: osiSockDiscoverBroadcastAddresses(): pointer not word-aligned? Eric Norum
- Re: osiSockDiscoverBroadcastAddresses(): pointer not word-aligned? Ralph Lange
- Re: osiSockDiscoverBroadcastAddresses(): pointer not word-aligned? Eric Norum
- Navigate by Date:
- Prev:
Re: osiSockDiscoverBroadcastAddresses(): pointer not word-aligned? Eric Norum
- Next:
Re: osiSockDiscoverBroadcastAddresses(): pointer not word-aligned? Eric Norum
- Index:
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: osiSockDiscoverBroadcastAddresses(): pointer not word-aligned? Eric Norum
- Next:
Re: osiSockDiscoverBroadcastAddresses(): pointer not word-aligned? Eric Norum
- Index:
2002
2003
2004
2005
<2006>
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
|