public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* gcc-6.3.0-1 regression: libstdc++6 DLL breaks exception handling
@ 2017-01-26 10:31 Christian Franke
  2017-02-07 10:04 ` JonY
  0 siblings, 1 reply; 3+ messages in thread
From: Christian Franke @ 2017-01-26 10:31 UTC (permalink / raw)
  To: cygwin

After upgrading to gcc test version 6.3.0-1, C++ exception handling is 
broken if DLL version of new libstdc++6 is used.

Testcase:

$ uname -srvmo
CYGWIN_NT-10.0-WOW 2.6.1(0.305/5/3) 2016-12-16 11:50 i686 Cygwin
or:
CYGWIN_NT-10.0 2.6.1(0.305/5/3) 2016-12-16 11:55 x86_64 Cygwin

$ cygcheck -f /bin/g++
gcc-g++-6.3.0-1

$ cygcheck -f /bin/cygstdc++-6.dll
libstdc++6-6.3.0-1

$ cat exc.cc
int main()
{
   try {
     throw 42;
   }
   catch (int i) {
     return i;
   }
   return 0;
}

$ g++ -o exc exc.cc

$ ./exc
Segmentation fault (core dumped)


Workaround: Use statically linked version of new libstdc++6:

$ g++ -static -o exc-static exc.cc

$ ./exc-static

$ echo $?
42


Or: Downgrade cygstdc++6.dll:

$ cygcheck -f /bin/cygstdc++-6.dll
libstdc++6-5.4.0-1

$ ./exc

$ echo $?
42


This also affects existing packages compiled with older g++, for example:

$ /usr/sbin/smartctl -V
smartctl 6.5 2016-05-07 r4318 [x86_64-unknown-cygwin-win10] (cygwin-6.5-1)
...
smartmontools build with: C++98, GCC 5.3.0
...
Segmentation fault (core dumped)


Regards,
Christian


--
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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-02-07 15:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-26 10:31 gcc-6.3.0-1 regression: libstdc++6 DLL breaks exception handling Christian Franke
2017-02-07 10:04 ` JonY
2017-02-07 15:27   ` Christian Franke

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).