public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* segmentation fault
@ 2006-11-11  1:21 Oliver Block
  2006-11-11 20:29 ` Raúl Huertas
  0 siblings, 1 reply; 6+ messages in thread
From: Oliver Block @ 2006-11-11  1:21 UTC (permalink / raw)
  To: gdb

Hello,

a program causes a segmentation fault and I'd like to know if I interpret the 
following gdb output correctly (text continues after output):
************************************************************************************
#1  0x4012eb3f in gethostbyname () from /lib/tls/libc.so.6
No symbol table info available.
#2  0x08049312 in http_send_recv (hostname=0x804a340 "www.oliver-block.eu",
    request=0x804b030 "GET /checkip.php HTTP/1.0\r\nHost: 
www.oliver-block.eu\r\n\r\n") at ddnscli.c:168
        hptr = (struct hostent *) 0x804b068
        sptr = (struct servent *) 0x804b028
        sin = {sin_family = 2, sin_port = 0, sin_addr = {s_addr = 0},
  sin_zero = "\000\000\000\000\000\000\000"}
        s = 134514323
        retval = 45
        n = 0
        buflen = 1024
#3  0x080498ee in get_ip (qry=0x804b008) at ddnscli.c:323
        tmp = 0x0
        r = 0x804b030 "GET /checkip.php HTTP/1.0\r\nHost: 
www.oliver-block.eu\r\n\r\n"
#4  0x080499fa in main (argc=3, argv=0xbffff1a4) at ddnscli.c:398
        option = 8 '\b'
        q = (struct query *) 0x804b008
(gdb) p sizeof(struct servent)
$1 = 16
****************************************************************************
When I extract

from #2:
sptr = (struct servent *) 0x804b028

from #4:
r = 0x804b030 "GET /checkip.php HTTP/1.0\r\nHost: www.oliver-block.eu\r\n\r\n"

as servent has a size of 16 bytes

804b028 + 16 = 0x804b038

These two variables seem to overlap. Do you agree? 

Regards,

Oliver

^ permalink raw reply	[flat|nested] 6+ messages in thread
* segmentation fault
@ 2006-11-11  1:23 Oliver Block
  0 siblings, 0 replies; 6+ messages in thread
From: Oliver Block @ 2006-11-11  1:23 UTC (permalink / raw)
  To: gdb

Hello,

a program causes a segmentation fault and I'd like to know if I interpret the 
following gdb output correctly (text continues after output):
************************************************************************************
#1  0x4012eb3f in gethostbyname () from /lib/tls/libc.so.6
No symbol table info available.
#2  0x08049312 in http_send_recv (hostname=0x804a340 "www.oliver-block.eu",
    request=0x804b030 "GET /checkip.php HTTP/1.0\r\nHost: 
www.oliver-block.eu\r\n\r\n") at ddnscli.c:168
        hptr = (struct hostent *) 0x804b068
        sptr = (struct servent *) 0x804b028
        sin = {sin_family = 2, sin_port = 0, sin_addr = {s_addr = 0},
  sin_zero = "\000\000\000\000\000\000\000"}
        s = 134514323
        retval = 45
        n = 0
        buflen = 1024
#3  0x080498ee in get_ip (qry=0x804b008) at ddnscli.c:323
        tmp = 0x0
        r = 0x804b030 "GET /checkip.php HTTP/1.0\r\nHost: 
www.oliver-block.eu\r\n\r\n"
#4  0x080499fa in main (argc=3, argv=0xbffff1a4) at ddnscli.c:398
        option = 8 '\b'
        q = (struct query *) 0x804b008
(gdb) p sizeof(struct servent)
$1 = 16
****************************************************************************
When I extract

from #2:
sptr = (struct servent *) 0x804b028

from #4:
r = 0x804b030 "GET /checkip.php HTTP/1.0\r\nHost: www.oliver-block.eu\r\n\r\n"

as servent has a size of 16 bytes

804b028 + 16 = 0x804b038

These two variables seem to overlap. Do you agree? 

Regards,

Oliver
-- 
Leben ist mehr als ... 
<http://www.nak-nrw.de/index.php?id=71>

^ permalink raw reply	[flat|nested] 6+ messages in thread
* segmentation fault
@ 2004-06-10 21:08 John
  0 siblings, 0 replies; 6+ messages in thread
From: John @ 2004-06-10 21:08 UTC (permalink / raw)
  To: gdb

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=us-ascii, Size: 1443 bytes --]

Hi all:
 
I encounter a segmentation fault probelm. When I use
"gdb core", gdb shows that the program stops at the
following line of my code:
sprintf(pt_->buffer() + offset,
 
I think that line cause segmentation fault. 
I want to set a breakpoint at that line and run the
code to see what happens before segmetation fault. How
can I make the program stop right before segmentation
fault happens? 
I also attach some information from gdb. 
 
Thanks a lot.
 
John
 
---------------------------------------------------------------------------------
Loaded symbols for /lib/ld-linux.so.2
#0  0x4026ecef in vfprintf () from /lib/libc.so.6
(gdb) bt
#0  0x4026ecef in vfprintf () from /lib/libc.so.6
#1  0xbfffdd04 in ?? ()
#2  0x40286fcb in vsprintf () from /lib/libc.so.6
#3  0x4027492d in sprintf () from /lib/libc.so.6
#4  0x0812226b in CMUTrace::format_mac_common(Packet*,
char const*, int) (this=0x97528b8, p=0x12ef75a0,
why=0x82cc85c "---", offset=0)
    at trace/cmu-trace.cc:228
 .........
 
(gdb) frame 4
#4  0x0812226b in CMUTrace::format_mac_common(Packet*,
char const*, int) (this=0x97528b8, p=0x12ef75a0,
why=0x82cc85c "---", offset=0)
    at trace/cmu-trace.cc:228
228             sprintf(pt_->buffer() + offset,
Current language:  auto; currently c++
(gdb)






	
		
__________________________________
Do you Yahoo!?
Friends.  Fun.  Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/ 

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2006-11-11 21:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-11-11  1:21 segmentation fault Oliver Block
2006-11-11 20:29 ` Raúl Huertas
2006-11-11 20:46   ` Daniel Jacobowitz
2006-11-11 21:02     ` Raúl Huertas
  -- strict thread matches above, loose matches on Subject: below --
2006-11-11  1:23 Oliver Block
2004-06-10 21:08 John

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).