This is the mail archive of the cygwin 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]
Other format: [Raw text]

1.7.5-1: fork throw segfault with g++ 4.3.4


Hi,

I have identified a reproducible segfault when throwing exceptions in the thrift IPC library under cygwin 1.7.5-1.

An example c++ program is attached which always segfaults on my machine when compiled with g++-4 (4.3.4 20090804) under 1.7.5-1.
I have also attached the stackdump, a standard cygcheck.out, and another more verbose set of testcases.


The issue is similar to the issue described in http://cygwin.com/ml/cygwin/2009-07/msg00150.html but in much more specific circumstances.

The segfault happens under the following circumstances:

1. compiled with g++-4 (4.3.4 20090804)
2. compiled/run on cygwin 1.7.5-1
3. fork at least once
4. throw a derived exception class in the child
5. where the derived class contains a std::string member
6. catch std::exception or std::exception&

It can also occur in similar circumstances when catching the derived class, but I have been unable to reproduce this segfault in a simple test program.


The segfault does not occur reproducibly under the following circumstances:

1. compiled with g++-3 (3.4.4)
2. compiled/run on cygwin versions 1.7.1-1 to 1.7.4-1
3. no fork
4. throw in the parent, or throw std::exception, std::string, or const char *
5. where the derived class does not contain a std::string member
6. catch the derived class (can't reproduce in simple test program), or catch(...)

Compiling with g++-3 is the simplest workaround I have found.


I didn't know whether to send this bug report to the cygwin mailing list or the g++ mailing list.

I chose the cygwin mailing list because the segfault started to happen reliably after I installed cygwin 1.7.5-1 on April 12 2010.

Tim


Tim Wilson-Brown
E: twilsonb at mac dot com

Attachment: fork_throw_example.cpp
Description: Binary data

Attachment: fork_throw_example.exe.stackdump
Description: Binary data

Attachment: cygcheck.out
Description: Binary data

Attachment: fork_throw_testcases.cpp
Description: Binary data

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      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]