gcc4: libstdc++6-4.5.3-2 is probably not backwards compatible

Christian Franke Christian.Franke@t-online.de
Sat Sep 24 16:51:00 GMT 2011


ddrescue segfaults in option parsing after gcc was updated from 4.3.4-4 
to 4.5.3-2.
(ddrescue package was build with g++ 4.3.4-3)

I tracked down the problem to a segfault in vector< string > destructor, 
see attached testcase.


1. Compile and run with g++ 4.3.4, use -O2 to enable inline expansion:

$ g++ -O2 -o testvector testvector.cpp

$ cygcheck -f /bin/cygstdc++-6.dll
libstdc++6-4.3.4-4

$ ./testvector
vector created (12)
vector destroyed


2. Update libstdc++ and rerun:

$ cygcheck -f /bin/cygstdc++-6.dll
libstdc++6-4.5.3-2

$ ./testvector
vector created (12)
Aborted (core dumped)


Recompiling with new g++ fixes the problem.
Old inline code is probably no longer compatible with code in new 
cygstdc++-6.dll.

-- 
Regards,
Christian Franke

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: testvector.cc
URL: <http://cygwin.com/pipermail/cygwin/attachments/20110924/bbed4fcf/attachment.cc>
-------------- 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