1.7.5-1: fork throw segfault with g++ 4.3.4
Tim Wilson-Brown
twilsonb@mac.com
Tue Apr 27 07:02:00 GMT 2010
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fork_throw_example.cpp
Type: application/octet-stream
Size: 1205 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20100427/c2b5ef19/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fork_throw_example.exe.stackdump
Type: application/octet-stream
Size: 846 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20100427/c2b5ef19/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cygcheck.out
Type: application/octet-stream
Size: 82214 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20100427/c2b5ef19/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fork_throw_testcases.cpp
Type: application/octet-stream
Size: 3622 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20100427/c2b5ef19/attachment-0003.obj>
-------------- next part --------------
--
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
More information about the Cygwin
mailing list