traceroute-1.4a12 Bus Error (core dumped)

traceroute-1.4a12 Bus Error (core dumped)

Post by Sam Adam » Wed, 02 May 2001 12:49:51



Posted this msg to the tcp/ip group but hasn't had much
follow-ups. so i am hopeful this group may be more appropriate.

I am having trouble running traceroute under Sun Ultrasparc Solaris 2.6.
i got a SIGSEGV and
        Bus Error (core dumped)
the version of traceroute is traceroute-1.4a12, built from src at
ftp.ee.lbl.gov. (setuid is not an issue and i did this as root.)

gdb shows it failed at
    Program received signal SIGSEGV, Segmentation fault.
    0x13298 in findsaddr (to=0x27364, from=0x2730a) at ./findsaddr-mib.c:180
    180             from->sin_addr.s_addr = rl2->gate;

added a breakpoint at line# 180 above couldn't print from->sin_addr.s_addr:
    Breakpoint 1, findsaddr (to=0x27364, from=0x2730a) at ./findsaddr-mib.c:180
    180             from->sin_addr.s_addr = rl2->gate;

    (gdb) print from->sin_addr.s_addr #expands to from->sin_addr._S_un._S_addr
    There is no member named s_addr.
    (gdb)

but i am able to print
    (gdb) print from->sin_addr.S_un.S_addr # w/o leading "_" as "_S_un._S_addr"
    $1 = 0
    (gdb)

this doesn't match "struct in_addr" definition in
/usr/include/netinet/in.h, which defines
                _S_un._S_addr
instead of  
                 S_un.S_addr

  | struct in_addr {
  |     union {
  |             struct { uchar_t s_b1, s_b2, s_b3, s_b4; } _S_un_b;
  |             struct { ushort_t s_w1, s_w2; } _S_un_w;
  | #if !defined(_XPG4_2) || defined(__EXTENSIONS__)
  |             uint32_t _S_addr;
  | #else
  |             in_addr_t _S_addr;
  | #endif /* !defined(_XPG4_2) || defined(__EXTENSIONS__) */
  |     } _S_un;
  | #define     s_addr  _S_un._S_addr           /* should be used for all code*/
  | #define     s_host  _S_un._S_un_b.s_b2      /* OBSOLETE: host on imp */
  | #define     s_net   _S_un._S_un_b.s_b1      /* OBSOLETE: network */
  | #define     s_imp   _S_un._S_un_w.s_w2      /* OBSOLETE: imp */
  | #define     s_impno _S_un._S_un_b.s_b4      /* OBSOLETE: imp # */
  | #define     s_lh    _S_un._S_un_b.s_b3      /* OBSOLETE: logical host */
  | };

So, i changed the line in findsaddr-mib.c from
    180             from->sin_addr.s_addr = rl2->gate;
to
    180             from->sin_addr.S_un.S_addr = rl2->gate;
Recompiled and ran it. BUT traceroute still fails at the same spot.

i don't think "from" or "to" are uninitialized or NULL ptrs as i was able
to print sensible values from both in gdb. in particular, from->sin_addr
prints values for symbol "S_un" and "S_addr" instead of their counterparts
with leading underscore "_", as in "_S_un" , "_S_addr".

(gdb) b 180
Breakpoint 1 at 0x13294: file ./findsaddr-mib.c, line 180.
(gdb) print from->sin_addr
$1 = {S_un = {S_un_b = {s_b1 = 0 '\000', s_b2 = 0 '\000', s_b3 = 0 '\000',
      s_b4 = 0 '\000'}, S_un_w = {s_w1 = 0, s_w2 = 0}, S_addr = 0}}
(gdb) run www.boston.com
Starting program: /backup/.shc/src/traceroute-1.4a12/traceroute www.boston.com

Breakpoint 1, findsaddr (to=0x27364, from=0x2730a) at ./findsaddr-mib.c:180
180             from->sin_addr.s_addr = rl2->gate;
(gdb) p from->sin_addr
$2 = {S_un = {S_un_b = {s_b1 = 0 '\000', s_b2 = 0 '\000', s_b3 = 0 '\000',
      s_b4 = 0 '\000'}, S_un_w = {s_w1 = 0, s_w2 = 0}, S_addr = 0}}
(gdb) print from
$3 = (struct sockaddr_in *) 0x2730a
(gdb) up
#1  0x11a9c in main (argc=2, argv=0xeffff9fc) at ./traceroute.c:718
718                     else if ((err = findsaddr(to, from)) != NULL) {
(gdb) print from
$4 = (struct sockaddr_in *) 0x2730a
(gdb) print &wherefrom
$5 = (struct sockaddr *) 0x2730a
(gdb) down
#0  findsaddr (to=0x27364, from=0x2730a) at ./findsaddr-mib.c:180
180             from->sin_addr.s_addr = rl2->gate;
(gdb) print rl2
$6 = (struct routelist *) 0x28b38
(gdb) print rl2->gate
$7 = 3232272490
(gdb)  n

Program received signal SIGSEGV, Segmentation fault.
0x13298 in findsaddr (to=0x27364, from=0x2730a) at ./findsaddr-mib.c:180
180             from->sin_addr.s_addr = rl2->gate;
(gdb) q
The program is running.  Exit anyway? (y or n) y
ronin1-1512 $

What am i doing wrong here?  do i have a Solaris that has mismatched netinet
header files and libraries or do i need to install any Sun patches?  thanks.

--

 
 
 

1. Core Dump - Bus Error

Dear World,

I have been experiencing core dump - bus error. I know core dump - bus
error means trying to access an invalid or impossible address. I am
running some GUI (Oracle 7.1.4 Forms 4.0.13.20.0 on a SGI host (Onyx)
and front end PCs are using eXceed 5 as a terminal emulation). The problem
is that I got the error "bus error - core dump" only when I am using eXceed
but when I try to run the Oracle software from the SGI directly, the problem
would not occur.

On one hand I know core dumps are UNIX problem, but on the other hand,
why does the core dump only happens when I access via PC emulation ?
I called Oracle and they claimed it is eXceed's bug, when I call eXceed,
they claim it is a UNIX bug and when I call SGI, they say it is either
Oracle or eXceed bug. That has been stagnant for almost 9 months now !

May I know any good tool that I can isolate the problem and perhaps better
able to interpret the content of a core file ? I use dbx and strings but
both gives me meaningless information. Any suggestion(s) on how I should
proceed is appreciated. Thank you so much.

Rgds
Kir Chern, Loh
(Inst Of Molecular And Cell Biology
National University Of Singapore

2. Routing Table

3. NCSA htppd 1.5 gives Bus Error (core dumped) !!

4. a.out vs new format

5. Bus error (core dumped) !please help!

6. Help - want to add users and passwds not as root.

7. FreeBSD Perl Core Dump (bus error)

8. Queue Accounting on 3.1.5

9. Bus error - core dump

10. Core Dump - Bus Error

11. java in netscape = bus error core dump

12. (Bus Error) Core Dumped?

13. bus error core dump