Problem Debugging C Program
- From: John Hanley <hanley@xxxxxxxxxxx>
- Date: Tue, 28 Aug 2007 12:29:11 -0600
I am having some problems debugging my program. I am getting a SIGSEGV.
I have a linked list. I am reading in data from a text file, storing the data in a linked list, and printing out the linked list.
I step through the program with GDB/DDD and everything seems to get parsed and stored correctly. Even when I print out my linked list, just before my printf statement I check the values in my list node and the values are fine. When I execute the printf, I get a SIGSEGV. I did a 'where' in GDB and got this:
Program received signal SIGSEGV, Segmentation fault.
0x006ab7ab in _IO_default_xsputn_internal () from /lib/libc.so.6
(gdb) where
#0 0x006ab7ab in _IO_default_xsputn_internal () from /lib/libc.so.6
#1 0x006a91d5 in _IO_new_file_xsputn () from /lib/libc.so.6
#2 0x006860a9 in vfprintf () from /lib/libc.so.6
#3 0x0068e2b7 in printf () from /lib/libc.so.6
#4 0x08049694 in print_list (l=0x8cf3170) at intrp_time.c:466
#5 0x0804990b in extract_records (f=0x8cf3008) at intrp_time.c:552
#6 0x08049afb in main (argv=Cannot access memory at address 0x39303a30
) at intrp_time.c:615
I am not sure what argv has to do with anything. Does anyone have any suggestions as to where I can start looking for this problem?
Thanks!
John
.
- Follow-Ups:
- Re: Problem Debugging C Program
- From: CBFalconer
- Re: Problem Debugging C Program
- From: Ben Pfaff
- Re: Problem Debugging C Program
- From: Willem
- Re: Problem Debugging C Program
- From: Richard Heathfield
- Re: Problem Debugging C Program
- Prev by Date: Re: Key-press detection
- Next by Date: Re: Problem Debugging C Program
- Previous by thread: Key-press detection
- Next by thread: Re: Problem Debugging C Program
- Index(es):
Relevant Pages
|