delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2008/07/16/12:01:43

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Message-ID: <b9324bf80807160901j6f44f2ecl3c8eb0032cafa1f6@mail.gmail.com>
Date: Wed, 16 Jul 2008 13:01:09 -0300
From: "Matias Bonaventura" <matiasb AT gmail DOT com>
To: cygwin AT cygwin DOT com
Subject: help with iofstream - Exception: STATUS_ACCESS_VIOLATION when writing or reading
MIME-Version: 1.0
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/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
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id m6GG1fap017617

Hi,

I´m trying to compile and run an application. It´s currently compiling
fine, but as soon as I run it I get the below error.
Debbugging the code I  manage to find it was failing when trying to
manipulate (read/write) a file.

I reduce the error and create a simple test case which outputs the same error:



[(!) DEBUG. Before opening the file]
[(!) DEBUG.  Before writing into the file]
57 [main] test 5664 _cygtls::handle_exceptions: Exception:
STATUS_ACCESS_VIOLATION
766 [main] test 5664 open_stackdumpfile: Dumping stack trace to
test.exe.stackdump


The test case code I´m using:
int main()
{
		cout << "[(!) DEBUG. Before opening the file]" << endl;
	    ofstream file;
	    file.open(FILE_NAME, ios::out);
	    if (file.is_open() && file.good() ){
		    cout << "[(!) DEBUG. Before writing into the file]" << endl;
		    file << "hola archivo";
		    cout << "[(!) DEBUG. After writeing into the file]" << endl;
		
		    file.close();
	    }
	
	    return 0;
}


Any idea why this could be happening? Is it a problem with my cygwin
instalation, with the compiler....?

I´m using gcc-2.95. I didn´t try with newer versions because the
application I´m trying to compile targets that compiler and won´t work
the newer.

THANKS!


--
:-) M.A.T.I.A.S. :-)

--
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