Debugging help needed

Scott Warner swarnerx3@acadia.net
Sun Nov 9 10:22:00 GMT 1997


I am writing a theorem generator.  In the function that asks for your
theorem the program seems to crash.  The code is:

	cout << "\nEnter your theorem : ";

	cin.getline(m_str, sizeof(m_str)-1);

m_str is a class member of a predetermined size.  Here is the DOS window
output after it crashes:

Enter your theorem : (D:\GNUWIN32\SOURCE\GODEL\GODEL.EXE 1000) In
cygwin_except_handler
(D:\GNUWIN32\SOURCE\GODEL\GODEL.EXE 1000) Exception trapped!
(D:\GNUWIN32\SOURCE\GODEL\GODEL.EXE 1000) exception C0000005 at 406D09
(D:\GNUWIN32\SOURCE\GODEL\GODEL.EXE 1000) exception: ax 0 bx 254F2C0 cx
4690004 dx 50
(D:\GNUWIN32\SOURCE\GODEL\GODEL.EXE 1000) exception: si 4 di 1000B8B3 bp
254F0EC sp 254F0E4
(D:\GNUWIN32\SOURCE\GODEL\GODEL.EXE 1000) exception is:
STATUS_ACCESS_VIOLATION
(D:\GNUWIN32\SOURCE\GODEL\GODEL.EXE 1000) Stack trace:

It goes on to list a detailed stack trace.  Two questions:  why does it
crash?  cin.getline is used correctly.  Is it out of stack space?  I do not
allocate m_str using new, just char m_str[MAX_BUF], where MAX_BUF is 120.

Third:  does a debugger come with gun-win32?  I have used Codeview several
times.

-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".



More information about the Cygwin mailing list