delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/01/03/20:56:15

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
Message-Id: <4.3.2.7.2.20040103203307.02db8880@mailhost.esva.net>
X-Sender: beman AT mailhost DOT esva DOT net
Date: Sat, 03 Jan 2004 20:55:52 -0500
To: <cygwin AT cygwin DOT com>
From: Beman Dawes <bdawes AT acm DOT org>
Subject: Re: Bug in fstream code and gcc-2 package?
Cc: "John Maddock" <john AT johnmaddock DOT co DOT uk>
In-Reply-To: <1425423079.20040103221245@familiehaase.de>
References: <4 DOT 3 DOT 2 DOT 7 DOT 2 DOT 20040103092732 DOT 02db6dd0 AT mailhost DOT esva DOT net> <01e101c3d1f1$9bc8d6a0$29750252 AT fuji> <4 DOT 3 DOT 2 DOT 7 DOT 2 DOT 20040103092732 DOT 02db6dd0 AT mailhost DOT esva DOT net>
Mime-Version: 1.0
X-IsSubscribed: yes

At 04:12 PM 1/3/2004, Gerrit P. Haase wrote:

 >Hallo Beman,
 >
 >I cannot reproduce it here on my NT4 SP 6a:

John Maddock can't reproduce it on his system either.

First, my results for the queries below are shown after your results:

 >$ uname -svr
 >CYGWIN_NT-4.0 1.5.5(0.94/3/2) 2003-09-20 16:31

CYGWIN_NT-5.1 1.5.5(0.94/3/2) 2003-09-20 16:31

 >$ cygcheck -c gcc
 >Cygwin Package Information
 >Package              Version        Status
 >gcc                  3.3.1-3        OK
gcc                  3.3.1-3        OK

 >$ cygcheck -c gcc-g++
 >Cygwin Package Information
 >Package              Version        Status
 >gcc-g++              3.3.1-3        OK
gcc-g++              3.3.1-3        OK

 >$ g++ fstream.cpp
 >$ ls
 >a.exe*  fstream.cpp
 >$ ./a
       2 [main] a 1228 handle_exceptions: Exception: 
STATUS_ACCESS_VIOLATION
     327 [main] a 1228 open_stackdumpfile: Dumping stack trace to 
a.exe.stackdump
 >$ cygcheck a
 >Found: .\a.exe
 >a.exe
 >  H:\bin\cygwin1.dll
 >    C:\WINNT\System32\KERNEL32.dll
 >      C:\WINNT\System32\ntdll.dll
Found: .\a.exe
a.exe
   c:\cygwin\bin\cygwin1.dll
     C:\WINDOWS\System32\KERNEL32.dll
       C:\WINDOWS\System32\ntdll.dll
 >$ g++ -mno-cygwin fstream.cpp
In file included from 
/usr/local/include/c++/3.3.1/bits/locale_facets.h:166,
                  from /usr/local/include/c++/3.3.1/bits/basic_ios.h:44,
                  from /usr/local/include/c++/3.3.1/ios:51,
                  from /usr/local/include/c++/3.3.1/istream:44,
                  from /usr/local/include/c++/3.3.1/fstream:45,
                  from fstream.cpp:1:
/usr/local/include/c++/3.3.1/i686-pc-cygwin/bits/ctype_base.h:46: error: 
`_U'
    was not declared in this scope
(similar errors follow; messages elided for brevity.)
 >$ ls
 >a.exe*  fstream.cpp
 >$ ./a
 >$ cygcheck a
 >Found: .\a.exe
 >a.exe
 >  C:\WINNT\System32\msvcrt.dll
 >    C:\WINNT\System32\KERNEL32.dll
 >      C:\WINNT\System32\ntdll.dll
 >
 >Can you run it with gdb and try to figure out what fails for you?

I've never used gdb, but here goes... install... try it...

For some reason I couldn't get a meaningful stack trace, but by stepping it 
was easy to isolate the problem. It is in the execution of the call:

    is.rdbuf()->in_avail()

is.rdbuf() looks like it is returning the correct pointer, but in_avail() 
is dying. If I replace the call with a constant, say 16000, the program 
runs
fine.

Does that help?

By the way, the above results hold regardless of whether the program is run 
from the Win XP command line or the bash command line.

--Beman


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