Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , 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-Authentication-Warning: slinky.cs.nyu.edu: pechtcha owned process doing -bs Date: Mon, 15 Sep 2003 19:53:53 -0400 (EDT) From: Igor Pechtchanski Reply-To: cygwin AT cygwin DOT com To: Vijay Kumar cc: cygwin AT cygwin DOT com Subject: Re: g++ iostream broken on windows 2000 In-Reply-To: <20030915234312.66294.qmail@web40708.mail.yahoo.com> Message-ID: References: <20030915234312 DOT 66294 DOT qmail AT web40708 DOT mail DOT yahoo DOT com> Importance: Normal MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Mon, 15 Sep 2003, Vijay Kumar wrote: > Hi all, > > I have upgraded to the latest cygwin this morning and > I can not anymore run my programs that use ifstream to > read input files. It crashes giving segmentation > fault. When I ran strace, I found that the actually > fails in mmap.cc complaining STATUS_ACCESS_VIOLATION. > > Here's the simple code I ran. Anybody have any clues? > Interestingly the following programs works fine with > -mno-cygwin option which unfortunaty I can not use for > my application. > > # include > # include > > int main(int argc, char *argv[]) > { > char ch; > > if (argc < 2) > { > cout << "Usage: a.out file_name" << endl; > } > > ifstream is(argv[1], ios::in); > > while (! is.eof()) > { > is.get(ch); > cout << ch; > } > is.close(); > > return 0; > } > > Thanks, > - Vijay Vijay, Please (re)read , especially the part about attaching (as an uncompressed text *attachment*) the output of "cygcheck -svr". FYI, you must be using the earlier version of g++ as well, since g++ 3.2 complains on compiling your program (you need to insert "using namespace std;" before main() for it to compile). FWIW, your program works just fine on Cygwin 1.5.3-1 (as a datapoint). I didn't install 1.5.4 yet, so can't try reproducing it there. Igor -- http://cs.nyu.edu/~pechtcha/ |\ _,,,---,,_ pechtcha AT cs DOT nyu DOT edu ZZZzz /,`.-'`' -. ;-;;,_ igor AT watson DOT ibm DOT com |,4- ) )-,_. ,\ ( `'-' Igor Pechtchanski, Ph.D. '---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow! "I have since come to realize that being between your mentor and his route to the bathroom is a major career booster." -- Patrick Naughton -- 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/