Computing.Net > Forums > Programming > C help

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

C help

Reply to Message Icon

Name: Robert
Date: January 9, 2003 at 20:00:14 Pacific
OS: xp
CPU/Ram: 500, 256
Comment:

I have a wierd problem with C. The program that i am writing produces a seg fault when I use fclose on a valid strem. I have traced the code with gdb and the pointer to the strem remains the same throughout the function. And i am able to write to the stream with no problem.
Below is the backtrace from gdb.
(gdb) bt
#0 chunk_free (ar_ptr=0x401cb620, p=0x80573f0) at malloc.c:3180
#1 0x40117bf4 in __libc_free (mem=0x80573f8) at malloc.c:3154
#2 0x40107f75 in _IO_new_fclose (fp=0x80573f8) at iofclose.c:85
#3 0x0804d725 in storeRating__FPfPcifPi (data=0x80573e8,
user=0xbffffa50 "u@u.com", jokeid=1, rating=0.825242698,
num_rated=0xbffff91c) at hirate_testerb.c:449
#4 0x0804c95e in main () at hirate_testerb.c:110
#5 0x400b3507 in __libc_start_main (main=0x804c7c0 , argc=1,
ubp_av=0xbffffb04, init=0x8048b90 , fini=0x804da30 ,
rtld_fini=0x4000dc14 , stack_end=0xbffffafc)
at ../sysdeps/generic/libc-start.c:129

Thanks



Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: C help

Simple C Help!!! www.computing.net/answers/programming/simple-c-help/9795.html

C# help www.computing.net/answers/programming/c-help/3176.html

help help!!!..C...data file..please www.computing.net/answers/programming/help-helpcdata-fileplease/8092.html