EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

2002  2003  2004  2005  <20062007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 2002  2003  2004  2005  <20062007  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: "Jeff Hill" <[email protected]>
To: "'Ralph Lange'" <[email protected]>, "'EPICS Core Talk'" <[email protected]>, "'Eric Norum'" <[email protected]>
Cc: "'Ralf Hartmann'" <[email protected]>
Date: Tue, 22 Aug 2006 15:23:24 -0600

Agree with Eric's comment. 

So you might have a closer look at ifreq_size ensuring that it's functioning
properly implemented for your ARM RTEMS. See examples below.

Jeff

----------------------------------------
Find 'ifreq_size' in
'D:\users\hill\R3.14.dll_hell_fix\epics\base\src\libCom\osi\os\alpha\osdSock
.h' :
D:\users\hill\R3.14.dll_hell_fix\epics\base\src\libCom\osi\os\alpha\osdSock.
h(70): #define ifreq_size(pifreq) (sizeof(pifreq->ifr_name))
Found 'ifreq_size' 1 time(s).
----------------------------------------
Find 'ifreq_size' in
'D:\users\hill\R3.14.dll_hell_fix\epics\base\src\libCom\osi\os\cygwin32\osdS
ock.h' :
D:\users\hill\R3.14.dll_hell_fix\epics\base\src\libCom\osi\os\cygwin32\osdSo
ck.h(73): #define ifreq_size(pifreq) (sizeof(pifreq->ifr_name))
Found 'ifreq_size' 1 time(s).
----------------------------------------
Find 'ifreq_size' in
'D:\users\hill\R3.14.dll_hell_fix\epics\base\src\libCom\osi\os\Darwin\osdSoc
k.h' :
D:\users\hill\R3.14.dll_hell_fix\epics\base\src\libCom\osi\os\Darwin\osdSock
.h(80): #define ifreq_size(pifreq) ((pifreq)->ifr_addr.sa_len +
sizeof((pifreq)->ifr_name))
Found 'ifreq_size' 1 time(s).
----------------------------------------
Find 'ifreq_size' in
'D:\users\hill\R3.14.dll_hell_fix\epics\base\src\libCom\osi\os\default\osdNe
tIntf.c' :
D:\users\hill\R3.14.dll_hell_fix\epics\base\src\libCom\osi\os\default\osdNet
Intf.c(42):     size = ifreq_size ( pifreq );
Found 'ifreq_size' 1 time(s).
----------------------------------------
Find 'ifreq_size' in
'D:\users\hill\R3.14.dll_hell_fix\epics\base\src\libCom\osi\os\hpux\osdSock.
h' :
D:\users\hill\R3.14.dll_hell_fix\epics\base\src\libCom\osi\os\hpux\osdSock.h
(81): #define ifreq_size(pifreq) (sizeof(pifreq->ifr_name))
Found 'ifreq_size' 1 time(s).
----------------------------------------
Find 'ifreq_size' in
'D:\users\hill\R3.14.dll_hell_fix\epics\base\src\libCom\osi\os\Linux\osdSock
.h' :
D:\users\hill\R3.14.dll_hell_fix\epics\base\src\libCom\osi\os\Linux\osdSock.
h(93): #define ifreq_size(pifreq) (sizeof(pifreq->ifr_name))
Found 'ifreq_size' 1 time(s).
----------------------------------------
Find 'ifreq_size' in
'D:\users\hill\R3.14.dll_hell_fix\epics\base\src\libCom\osi\os\RTEMS\osdSock
.h' :
D:\users\hill\R3.14.dll_hell_fix\epics\base\src\libCom\osi\os\RTEMS\osdSock.
h(99): #define ifreq_size(pifreq) (pifreq->ifr_addr.sa_len +
sizeof(pifreq->ifr_name))
Found 'ifreq_size' 1 time(s).
----------------------------------------
Find 'ifreq_size' in
'D:\users\hill\R3.14.dll_hell_fix\epics\base\src\libCom\osi\os\sgi\osdSock.h
' :
D:\users\hill\R3.14.dll_hell_fix\epics\base\src\libCom\osi\os\sgi\osdSock.h(
77): #define ifreq_size(pifreq) (sizeof(pifreq->ifr_name))
Found 'ifreq_size' 1 time(s).
----------------------------------------
Find 'ifreq_size' in
'D:\users\hill\R3.14.dll_hell_fix\epics\base\src\libCom\osi\os\solaris\osdSo
ck.h' :
D:\users\hill\R3.14.dll_hell_fix\epics\base\src\libCom\osi\os\solaris\osdSoc
k.h(92): #define ifreq_size(pifreq) (sizeof(pifreq->ifr_name))
Found 'ifreq_size' 1 time(s).
----------------------------------------
Find 'ifreq_size' in
'D:\users\hill\R3.14.dll_hell_fix\epics\base\src\libCom\osi\os\sun4\osdSock.
h' :
D:\users\hill\R3.14.dll_hell_fix\epics\base\src\libCom\osi\os\sun4\osdSock.h
(145): #define ifreq_size(pifreq) (sizeof(pifreq->ifr_name))
Found 'ifreq_size' 1 time(s).
----------------------------------------
Find 'ifreq_size' in
'D:\users\hill\R3.14.dll_hell_fix\epics\base\src\libCom\osi\os\VMS\osdSock.h
' :
D:\users\hill\R3.14.dll_hell_fix\epics\base\src\libCom\osi\os\VMS\osdSock.h(
170): #define ifreq_size(pifreq) (sizeof(pifreq->ifr_name))
Found 'ifreq_size' 1 time(s).
----------------------------------------
Find 'ifreq_size' in
'D:\users\hill\R3.14.dll_hell_fix\epics\base\src\libCom\osi\os\vxWorks\osdSo
ck.h' :
D:\users\hill\R3.14.dll_hell_fix\epics\base\src\libCom\osi\os\vxWorks\osdSoc
k.h(93): #   define ifreq_size(pifreq) (pifreq->ifr_addr.sa_len +
sizeof(pifreq->ifr_name))
D:\users\hill\R3.14.dll_hell_fix\epics\base\src\libCom\osi\os\vxWorks\osdSoc
k.h(95): #   define ifreq_size(pifreq) sizeof(*pifreq)
Found 'ifreq_size' 2 time(s).
Search complete, found 'ifreq_size' 13 time(s). (12 files.)

> -----Original Message-----
> From: Ralph Lange [mailto:[email protected]]
> Sent: Tuesday, August 22, 2006 8:42 AM
> To: Jeff Hill; EPICS Core Talk; Eric Norum
> Cc: Ralf Hartmann
> Subject: osiSockDiscoverBroadcastAddresses(): pointer not word-aligned?
> 
> Hi Jeff, hi Eric,
> 
> a colleage of mine is trying to get EPICS running on RTEMS running on an
> ARM v4t.
> 
> The system crashes with a alignment fault in in BSD network stack
> function in_control() which gets a struct ifreq pointer. This pointer is
> created in osiSockDiscoverBroadcastAddresses(), where you create an
> array of such structures by calloc()ing 100 times the size of an struct
> ifreq (line 87).
> Then you step through the array. When you call socket_ioctl() to get the
> broadcast address (line 177), that call causes the crash down in the BSD
> stack, because at that point the pointer pifreq is not word-aligned.
> 
> We think that somehow within the array the single struct ifreq entries
> are not word-aligned - which sounds not very likely looking at the ifreq
> definition, or that your stepping algorithm in ifreqNext() (line 38 ff.)
> returns a wrong address which is odd.
> 
> Any ideas?
> 
> What was the reason for using the ifreqNext() function instead of just
> stepping with sizeof (struct ifreq)?
> 
> Clueless,
> Ralph & Ralf


Replies:
Re: osiSockDiscoverBroadcastAddresses(): pointer not word-aligned? Ralph Lange
References:
osiSockDiscoverBroadcastAddresses(): pointer not word-aligned? Ralph Lange

Navigate by Date:
Prev: Re: osiSockDiscoverBroadcastAddresses(): pointer not word-aligned? Eric Norum
Next: Re: osiSockDiscoverBroadcastAddresses(): pointer not word-aligned? Ralph Lange
Index: 2002  2003  2004  2005  <20062007  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? Andrew Johnson
Next: Re: osiSockDiscoverBroadcastAddresses(): pointer not word-aligned? Ralph Lange
Index: 2002  2003  2004  2005  <20062007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 02 Feb 2012 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·