public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Christian Franke <Christian.Franke@t-online.de>
To: cygwin@cygwin.com
Subject: gcc-6.3.0-1 regression: libstdc++6 DLL breaks exception handling
Date: Thu, 26 Jan 2017 10:31:00 -0000	[thread overview]
Message-ID: <6a80a46a-8de9-5d28-f7ef-897a53159603@t-online.de> (raw)

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

             reply	other threads:[~2017-01-26 10:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-26 10:31 Christian Franke [this message]
2017-02-07 10:04 ` JonY
2017-02-07 15:27   ` Christian Franke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6a80a46a-8de9-5d28-f7ef-897a53159603@t-online.de \
    --to=christian.franke@t-online.de \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).