std::string and crtdll problem

Thu Jan 27 18:03:00 GMT 2000


Could anybody please tell me why the following program crashes with a sad

[main] C:\prj\silly\a.exe 1098 (0) handle_exceptions: Exception: STATUS_STACK_OVERFLOW
[main] a 1098 (0) handle_exceptions: Dumping stack trace to a.exe.core

when compiled with 'gcc  -lstdc++ -lcrtdll' but not when compiled with
'gcc  -lstdc++', OR when the last two lines of readline() are

#include <string>
using std::string;

int main() {}             // nothing gets executed...

string readline()
        int i;
        char *recvbuf;
        // comment out the following two lines to avoid the crash 
        string dest(recvbuf,i);   
        return dest;                                                    

My configuration:

Cygnus B20.1, OS: WinNT Ver 4.0 build 1381 Service Pack 6
gcc version egcs-2.91.57 19980901 (egcs-1.1 release) 
(also tried 2.95.2, the Mumit Kahn release --> same result)
  371k 1998/12/01 C:\cygnus\CYGWIN~1\H-I586~1\bin\cygtcl80.dll - os=4.0 img=1.0 sys=4.0
                  "cygtcl80.dll" v0.0 ts=1998/12/1 9:25

    5k 1998/12/01 C:\cygnus\CYGWIN~1\H-I586~1\bin\cygtclpip80.dll - os=4.0 img=1.0 sys=4.0
   10k 1998/12/01 C:\cygnus\CYGWIN~1\H-I586~1\bin\cygtclreg80.dll - os=4.0 img=1.0 sys=4.0
                  "cygtclreg80.dll" v0.0 ts=1998/12/1 9:25

  600k 1998/12/01 C:\cygnus\CYGWIN~1\H-I586~1\bin\cygtk80.dll - os=4.0 img=1.0 sys=4.0
                  "cygtk80.dll" v0.0 ts=1998/12/1 9:28

  446k 1998/12/03 C:\cygnus\CYGWIN~1\H-I586~1\bin\cygwin1.dll - os=4.0 img=1.0 sys=4.0
                  "cygwin1.dll" v0.0 ts=1998/12/4 5:39  

$ md5sum.exe cygwin1.dll
  2da73b427585afea2e3e457b7c3157fb  cygwin1.dll

Want to unsubscribe from this list?
Send a message to

More information about the Cygwin mailing list