traceroute generates bus error. mmap(0x7016a000, 14016, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7016a000 close(3) = 0 munmap(0x7001c000, 35947) = 0 getpagesize() = 0x2000 brk(0) = 0x267c0 brk(0x267e0) = 0x267e0 brk(0x28000) = 0x28000 getpid() = 32182 open("/etc/nsswitch.conf", O_RDONLY) = 3 fstat64(3, {st_mode=S_IFREG|0644, st_size=604, ...}) = 0 mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7001a000 read(3, "# Copyright 1999-2002 Gentoo Tec"..., 8192) = 604 read(3, "", 8192) = 0 close(3) = 0 munmap(0x7001a000, 8192) = 0 open("/etc/ld.so.cache", O_RDONLY) = 3 fstat64(3, {st_mode=S_IFREG|0644, st_size=35947, ...}) = 0 mmap(NULL, 35947, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7001c000 close(3) = 0 open("/lib/v9/libnss_db.so.2", O_RDONLY) = -1 ENOENT (No such file or directory) stat64("/lib/v9", 0xefffeaf8) = -1 ENOENT (No such file or directory) open("/lib/libnss_db.so.2", O_RDONLY) = -1 ENOENT (No such file or directory) stat64("/lib", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0 open("/usr/lib/v9/libnss_db.so.2", O_RDONLY) = -1 ENOENT (No such file or directory) stat64("/usr/lib/v9", 0xefffeaf8) = -1 ENOENT (No such file or directory) open("/usr/lib/libnss_db.so.2", O_RDONLY) = -1 ENOENT (No such file or directory) stat64("/usr/lib", {st_mode=S_IFDIR|0755, st_size=24576, ...}) = 0 munmap(0x7001c000, 35947) = 0 open("/etc/ld.so.cache", O_RDONLY) = 3 fstat64(3, {st_mode=S_IFREG|0644, st_size=35947, ...}) = 0 mmap(NULL, 35947, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7001c000 close(3) = 0 open("/lib/libnss_files.so.2", O_RDONLY) = 3 read(3, "\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0\3\0\2\0\0\0\1\0\0\37"..., 1024) = 1024 fstat64(3, {st_mode=S_IFREG|0755, st_size=52927, ...}) = 0 mmap(NULL, 108224, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x70170000 mprotect(0x7017a000, 67264, PROT_NONE) = 0 mmap(0x70180000, 49152, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0x70180000 close(3) = 0 munmap(0x7001c000, 35947) = 0 open("/etc/protocols", O_RDONLY) = 3 nfssvc(0x3) = 0 nfssvc(0x3) = 0 fstat64(3, {st_mode=S_IFREG|0644, st_size=1846, ...}) = 0 mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7001a000 read(3, "# /etc/protocols:\n# $Id: protoco"..., 8192) = 1846 close(3) = 0 munmap(0x7001a000, 8192) = 0 open("/dev/null", O_RDONLY) = 3 open("/dev/null", O_RDONLY) = 4 open("/dev/null", O_RDONLY) = 5 socket(PF_INET, SOCK_RAW, IPPROTO_ICMP) = -1 EPERM (Operation not permitted) write(2, "traceroute: icmp socket: Operati"..., 49traceroute: icmp socket: Operation not permitted ) = 49 exit(1)
I get the same thing, "Bus Error". How did you get all that output, though?, some debugging mode?
strace does it :) a nice tool ltrace could also do some nice output
Look at traceroute.c (main source): At lines 299--300, hou will see struct sockaddr_in whereto; /* Who to try to reach */ struct sockaddr_in wherefrom; /* Who we are */ Later on, in main() at 364, you will see register struct sockaddr_in *from = (struct sockaddr_in*)&wherefrom; register struct sockaddr_in *to = (struct sockaddr_in *)&whereto; Later yet, you will see some calls like this one at 717: setsin(from, al->addr); and finally setsin() at 1340 in its entirety is void setsin(register struct sockaddr_in *sin, register u_int32_t addr) { memset(sin, 0, sizeof(*sin)); #ifdef HAVE_SOCKADDR_SA_LEN sin->sin_len = sizeof(*sin); #endif sin->sin_family = AF_INET; sin->sin_addr.s_addr = addr; /* <<<<<< BUS ERROR HERE >>>>>> */ } The bus error is on the comment; the problem is that the 'struct sockaddr' is not necessarily aligned in such a way that a 'struct sockaddr_in' can overlay it and hope to have the fields nicely laid out for sparc.
There is a patch that corrects this. It won't currently apply nicely. Working on getting it to apply by re-generating the patch.
*** traceroute.c.orig Tue Oct 22 08:09:05 2002 --- traceroute.c Tue Oct 22 08:10:48 2002 *************** *** 294,305 **** u_int32_t gwlist[NGATEWAYS + 1]; int s; /* receive (icmp) socket file descriptor */ int sndsock; /* send (udp/icmp) socket file descriptor */ ! struct sockaddr whereto; /* Who to try to reach */ ! struct sockaddr wherefrom; /* Who we are */ int packlen; /* total length of packet */ int minpacket; /* min ip packet size */ int maxpacket = 32 * 1024; /* max ip packet size */ int pmtu; /* Path MTU Discovery (RFC1191) */ u_int pausemsecs; --- 294,305 ---- u_int32_t gwlist[NGATEWAYS + 1]; int s; /* receive (icmp) socket file descriptor */ int sndsock; /* send (udp/icmp) socket file descriptor */ ! struct sockaddr_storage whereto; /* Who to try to reach */ ! struct sockaddr_storage wherefrom; /* Who we are */ int packlen; /* total length of packet */ int minpacket; /* min ip packet size */ int maxpacket = 32 * 1024; /* max ip packet size */ int pmtu; /* Path MTU Discovery (RFC1191) */ u_int pausemsecs;