This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

seg fault on file write in cygwin, please help!!!


Hi, 

I am getting the following seg fault at the point in my C++ code where data 
gets written to a file. 

First, here is the code that is the source of the problem (should be correct):

FILE *outfile = fopen("/home/Sophia/ns-allinone-2.27/ns-2.27/myfile.tcl", "w");
fprintf(outfile, "%s", output);

...where output is a regular string (character array). 

Here is the backtrace from the seg fault, on running this code:

(gdb) run
Starting program: /home/Sophia/ns-allinone-2.27/ns-2.27/a.exe

Program received signal SIGSEGV, Segmentation fault.
0x610cfaa9 in wmemset () from /usr/bin/cygwin1.dll
(gdb) backtrace
#0 0x610cfaa9 in wmemset () from /usr/bin/cygwin1.dll
#1 0x610cf9b4 in wmemset () from /usr/bin/cygwin1.dll
#2 0x610d365f in wmemset () from /usr/bin/cygwin1.dll
#3 0x61086751 in cygwin1!aclcheck () from /usr/bin/cygwin1.dll
#4 0x61005d05 in getprogname () from /usr/bin/cygwin1.dll
#5 0x0a0436c0 in ?? ()
#6 0x0a041318 in ?? ()
#7 0x00000001 in ?? ()
#8 0x00401236 in __do_sjlj_init()

What's going on, and how do I fix this?

Thanks,

Sophia



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]