This is the mail archive of the cygwin@sources.redhat.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: GCC untrackable crashes


Hi,
I read the thread with much interest, because I have a similar problem, a seg
fault within __size_of_stack_reserve. The following code:

  1 #include <fstream>
  2 #include <iostream>
  3 #include <string>
  4
  5 using namespace std;
  6
  7 int main()
- 8 {
  9      ofstream opstream("c:\\example.log");
  10      if(!opstream) {
  11      cerr << "File cannot be opened.\n";
  12
  13      return 1;
  14      }
  15      opstream << 3.1415;
  16      opstream << " " << 23 << '\n' << "Test stream.";
  17      opstream.close();
  18
  19      return 0;
  20 }

(I already posted this some days ago)compiled with and without mno-cygwin flag.
With cygwin target the compiled program runs without any problem. The mno-cygwin
version crashes somewhere between line 15 and 16:
15      opstream << 3.1415;
- 0x401304 <main+188>:  add    $0xfffffffc,%esp
- 0x401307 <main+191>:  fldl   0x401240
- 0x40130d <main+197>:  sub    $0x8,%esp
- 0x401310 <main+200>:  fstpl  (%esp,1)
- 0x401313 <main+203>:  lea    0xffffff80(%ebp),%eax
- 0x401316 <main+206>:  lea    0x50(%eax),%edx
- 0x401319 <main+209>:  push   %edx
- 0x40131a <main+210>:  call   0x403824 <__ls__7ostreamd>
- 0x40131f <main+215>:  add    $0x10,%esp
 16      opstream << " " << 23 << '\n' <<

more exactly: after the function call (<main+210>).
As I started using gdb two days ago, I'm pretty clueless, what all these numbers
and adresses want to tell me...
So, I'd be very grateful, if anyone could tell me if this is a known problem
(maybe any workaround?) and more generally, how to tackle such problems, handle
the gdb output... because I don't just want to delegate my problems, I'm always
willing to solve them for myself (...and I hope, the last one wasn't too OT for
this list)

Thanks Tilman


--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]