From: Matt S. <msc...@pa...> - 2001-10-31 08:42:23
|
David Douthitt wrote: > > Here it is, compiled against 2.1.3.... > Thanks. Here we go..... ----------------------------------------------------------------- (gdb) file /tmp/gatping Reading symbols from /tmp/gatping...done. (gdb) run Starting program: /tmp/gatping warning: Unable to find dynamic linker breakpoint function. warning: GDB will be unable to debug shared library initializers warning: and track explicitly loaded dynamic code. Program received signal SIGSEGV, Segmentation fault. 0x17f0c4 in () (gdb) bt #0 0x17f0c4 in () #1 0x17ef9a in () #2 0x8048918 in send_ping (s=5, h=0x804a958) at gatping.c:185 #3 0x8048851 in main (argc=1, argv=0xbffffdd4) at gatping.c:133 #4 0x13d9cb in () ----------------------------------------------------------------- Ok. So let's take a closer look at what send_ping is doing. I'll set a breakpoint at the send_ping() function: (gdb) b send_ping Breakpoint 1 at 0x8048878: file gatping.c, line 161. Ok. Now I'll run the program again, and then step through the functions in send_ping() with a while loop. The numbers are the line numbers in gatping.c. ---------------------------------------------------------------- (gdb) run Starting program: /tmp/gatping warning: Unable to find dynamic linker breakpoint function. warning: GDB will be unable to debug shared library initializers warning: and track explicitly loaded dynamic code. Breakpoint 1, send_ping (s=5, h=0x804a958) at gatping.c:161 Source file is more recent than executable. 161 /* gettimeofday ( &h->last_send_time, &tz ) ; */ (gdb) while 1 > step > end 162 icp->icmp_type = ICMP_ECHO ; 166 icp->icmp_id = ident ; 167 168 pdp = ( PING_DATA * ) ( buffer + SIZE_ICMP_HDR ) ; 169 gettimeofday (&pdp->ping_ts, &tz ) ; 170 pdp->ping_count = 1 ; 173 174 /* this is the line that does the actual work, BTW */ 175 n = sendto ( mysock , buffer, ping_pkt_size, 0, in_cksum (p=0x804a398, n=8) at gatping.c:304 304 *(u_char *)(&odd_byte) = *(u_char *)p; 312 send_ping (s=5, h=0x804a958) at gatping.c:179 179 printf ( "Problem with ping - returned %d\n",n ) ; 182 185 Program received signal SIGSEGV, Segmentation fault. 0x17f0c4 in () Single stepping until exit from function __libc_free, which has no line number information. Program terminated with signal SIGSEGV, Segmentation fault. The program no longer exists. The program is not being run. (gdb) ---------------------------------------------------------------------------- So I'm figuring something with the printf(), because there ain't no printf'ing going on that I see. If David's reading, he might be able to recall if we were having printf problems when converting over to 2.1.3. That was some months ago. This may be the last segfault hurdle. Thanks, Yurtle |