#3 SING 1.1 dumps core on Solaris 8

open
nobody
None
5
2014-08-24
2003-06-05
No

SING 1.1 dumps core with a BUS error on Solaris 8. It
happens when it is compiled with gcc and Sun's Forte
C++ 6U2:

Reading sing
core file header read successfully
Reading ld.so.1
Reading libnsl.so.1
Reading libresolv.so.2
Reading libsocket.so.1
Reading libc.so.1
Reading libdl.so.1
Reading libmp.so.2
Reading libc_psr.so.1
Reading nss_files.so.1
program terminated by signal BUS (invalid address
alignment)
Current function is build_ip
617 ip_p->ip_src.s_addr = orig;
(/opt/SUNWspro/bin/../WS6U2/bin/sparcv9/dbx)

The solution is to use memcpy instead of a straight
assignment in sing.c at line 617:

memcpy(&(ip_p->ip_src.s_addr), &orig, sizeof(orig));
memcpy(&(ip_p->ip_dst.s_addr),
&(packet.destino.sin_addr.s_addr),
sizeof(packet.destino.sin_addr.s_addr));

This should have no effects on other platforms.

Thanks and take care,

Stefaan
<mailto: Stefaan.Eeckels@ecc.lu>

Discussion