Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ping suicide: sys: trap: divide error pc=0x00003953c

31 views
Skip to first unread message

ROuNIN

unread,
Mar 9, 2009, 5:38:06 AM3/9/09
to
Hello all,
I would like to learn how to fix this in the ping C code, I am new to
plan9 and C

ip/ping -r -f www.google.com
sending 32 64 bytes messages 0 ms apart to icmp!www.google.com!1
ping 238: suicide: sys: trap: divide error pc=0x00003953
term% 0: rrt 38841 us, avg rtt 38841 us, ttl = 128

ROuNIN

Kenji Arisawa

unread,
Mar 9, 2009, 7:15:53 AM3/9/09
to
Hello,

ip/ping -r -f www.google.com
io% ip/ping -r -f www.google.com
sending 32 64 byte messages 0 ms apart to icmp!www.google.com!1
ping 34691: suicide: sys: trap: divide error pc=0x00003953
0: rtt 9797 µs, avg rtt 9797 µs, ttl = 245
io% ps
...
arisawa 34679 0:00 0:00 128K Pread tcp17010
arisawa 34691 0:00 0:00 140K Broken ping
arisawa 34695 0:00 0:00 140K Pread ping
arisawa 34696 0:00 0:00 192K Pread ps
io% acid 34691
/proc/34691/text:386 plan 9 executable

/sys/lib/acid/port
/sys/lib/acid/386
acid: lstk()
nrand(n=0x0)+0x18 /sys/src/libc/port/nrand.c:13
slop=0xa39fb2cf
sender(msglen=0x40,n=0x20,interval=0x0,fd=0x6)+0x151 /sys/src/cmd/ip/
ping.c:268
seq=0xef0c4ef8
buf=0x0
icmp=0xdffeed0e
me=0x0
mev4=0x501a8c0
i=0x1
r=0x22b78
main(argv=0xdfffefa0,argc=0x1)+0x212 /sys/src/cmd/ip/ping.c:571
interval=0x0
msglen=0x40
nmsg=0x20
_argc=0x66
_args=0xdfffefb8
ds=0x11534
fd=0x6
_main+0x31 /sys/src/libc/386/main9.s:16
acid:
echo kill > /proc/34691/ctl
io% cat /sys/src/libc/port/nrand.c
#include <u.h>
#include <libc.h>

#define MASK 0x7fffffffL

int
nrand(int n)
{
long slop, v;

if(n < 0)
return n;
slop = MASK % n;
do
v = lrand();
while(v <= slop);
return v % n;
}


Think that where and why nrand(0) is executed and fix the problem.

Kenji Arisawa

erik quanstrom

unread,
Mar 9, 2009, 9:33:43 AM3/9/09
to
since it doesn't make sense to both send packets
as fast as possible and to delay randomly between
packets, i think this case is just disallowed.

/n/sources/plan9//sys/src/cmd/ip/ping.c:532,537 - ping.c:532,541
break;
} ARGEND;

+ if(flood && rint){
+ fprint(2, "-f and -r are not compatable\n");
+ usage();
+ }
if(msglen < proto->iphdrsz + ICMP_HDRSIZE)
msglen = proto->iphdrsz + ICMP_HDRSIZE;
if(msglen < 64)

and

/n/sources/plan9//sys/man/8/ping:83,89 - ping:83,91
adds the IP source and destination addresses to each report.
.TP
.B f
- send messages as fast as possible (flood).
+ send messages as fast as possible (flood). This flag
+ is not compatable with
+ .BR -r .
.TP
.B i
sets the time between messages
/n/sources/plan9//sys/man/8/ping:104,110 - ping:106,114
.TP
.B r
randomizes the delay with a minimum extra delay of 0 ms and a
- maximum extra delay of the selected interval.
+ maximum extra delay of the selected interval. This flag
+ is not compatable with
+ .BR -f .
.TP
.B s
sets the length of the message to be

0 new messages