public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Christian Franke <Christian.Franke@t-online.de>
To: cygwin@cygwin.com
Subject: Re: gcc-6.3.0-1 regression: libstdc++6 DLL breaks exception handling
Date: Tue, 07 Feb 2017 15:27:00 -0000	[thread overview]
Message-ID: <a4c62a64-5570-e39c-a8b5-d659fdbfbc6d@t-online.de> (raw)
In-Reply-To: <dcea951e-96f2-b592-4804-1c58abf84a83@gmail.com>

JonY wrote:
> On 01/26/2017 10:30 AM, Christian Franke wrote:
>> After upgrading to gcc test version 6.3.0-1, C++ exception handling is
>> broken if DLL version of new libstdc++6 is used.
>>
> Noted, I'll consider the test version broken for now.
>
>

Meantime I examined the testcase with gdb: The DLL exports a bogus 
address for the symbol "_ZTIi" ('typeinfo for int'). This results in 
this more simple testcase:

#include <typeinfo>
int main() {
   const std::type_info & ti = typeid(int); // &_ZTIi from DLL
   const char * p = ti.name(); // segfaults because &_ZTIi is bogus.
}


And indeed, the export table of the DLL looks 'interesting'. The offsets 
of various exported symbols are apparently all 93980000:

$ objdump -p cygstdc++-6.dll

     [5142] +base[5143] c6760 Export RVA
     [5143] +base[5144] c6768 Export RVA
     [5144] +base[5145] 93980000 Export RVA
...
     [5151] +base[5152] 93980000 Export RVA
     [5152] +base[5153] 93980000 Export RVA
     [5153] +base[5154] 93980000 Export RVA
     [5154] +base[5155] 93980000 Export RVA
...
     [5167] +base[5168] 93980000 Export RVA
     [5168] +base[5169] c6780 Export RVA
...
[Ordinal/Name Pointer] Table
...
     [5143] _ZTISt9type_info
     [5144] _ZTIa
...
     [5151] _ZTIh
     [5152] _ZTIi
     [5153] _ZTIj
     [5154] _ZTIl
...
     [5167] _ZTSDs
     [5168] _ZTSN10__cxxabiv115__forced_unwindE

$  objdump -p cygstdc++-6.dll | grep -cw 93980000
759


Hmm... bug in the (bin)utils used to build the DLL?

Possibly related:
https://cygwin.com/ml/cygwin/2017-01/msg00375.html

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-02-07 15:27 UTC|newest]

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

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=a4c62a64-5570-e39c-a8b5-d659fdbfbc6d@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).