delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/03/18/20:40:35

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
From: scyudits AT MIT DOT EDU
X-Sieve: CMU Sieve 2.2
Message-ID: <1079660146.405a4e72c44f0@webmail.mit.edu>
Date: Thu, 18 Mar 2004 20:35:46 -0500
To: cygwin AT cygwin DOT com
Cc: scyudits AT MIT DOT EDU
Subject: seg fault on file write in cygwin, please help!!!
MIME-Version: 1.0
User-Agent: Internet Messaging Program (IMP) 3.1-cvs
X-Originating-IP: 24.34.136.130
X-Originating-Host:
X-MIT-WebMail-Sender:
X-MIT-WebMail-User-Browser: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)
X-Spam-Score: -4.09
X-Spam-Flag: NO
X-Scanned-By: MIMEDefang 2.28 (www . roaringpenguin . com / mimedefang)
Resent-Date: Thu, 18 Mar 2004 20:40:07 -0500
Resent-From: scyudits AT MIT DOT EDU
Resent-To: cygwin AT cygwin DOT com
Resent-Message-ID: <1079660407 DOT 405a4f77521f0 AT webmail DOT mit DOT edu>

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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019