public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "ro at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/49260] cpp0x/lambda/lambda-eh2.C fails execution
Date: Mon, 06 Jun 2011 10:09:00 -0000	[thread overview]
Message-ID: <bug-49260-4-dn00TOV1hq@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-49260-4@http.gcc.gnu.org/bugzilla/>

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49260

Rainer Orth <ro at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ro at gcc dot gnu.org

--- Comment #3 from Rainer Orth <ro at gcc dot gnu.org> 2011-06-06 10:08:47 UTC ---
I'm seeing this when using Sun as on Solaris, but not with GNU as 2.21, even
when Sun ld is used in both cases.  I've been able to find the root cause: I
set
a breakpoint in _Unwind_IteratePhdrCallback and checked the pc checked there
on i386-pc-solaris2.11.  For the as/ld combination, I get

   0xfee350d5 <_Unwind_RaiseException+52>:    decl   -0x1577b(%ebp)
   0xfef29500 <__cxa_throw+96>:    decl   0x23e82434(%ecx)
   0x8051019 <operator()+47>:    incl   0x874fffa(%ebx)
   0xfef29500 <__cxa_throw+96>:    decl   0x23e82434(%ecx)
   0x8051019 <operator()+47>:    incl   0x874fffa(%ebx)
   0xfee350d5 <_Unwind_RaiseException+52>:    decl   -0x1577b(%ebp)
   0xfef29500 <__cxa_throw+96>:    decl   0x23e82434(%ecx)
   0x8050fcb <operator()+47>:    call   *-0x75(%ebp)
   0x8050fdd <_FUN+17>:    dec    %ecx

then

terminate called after throwing an instance of 'int'

Obviously, the unwind info for _FUNC is missing.  Here's the disassembly

   0x8050fcc <_FUN>:    push   %ebp
   0x8050fcd <_FUN+1>:    mov    %esp,%ebp
   0x8050fcf <_FUN+3>:    sub    $0x18,%esp
   0x8050fd2 <_FUN+6>:    movl   $0x0,(%esp)
   0x8050fd9 <_FUN+13>:    call   0x8050f9c <operator()>
   0x8050fde <_FUN+18>:    leave  
   0x8050fdf <_FUN+19>:    ret    

Looking at the search table, I find:

> elfdump -u lambda-eh2.exe
[...]
  Binary Search Table:
      InitialLoc    FdeLoc
    0x08050f9c    0x08061328    _ZZ4mainENKUlvE_clEv
                      main::{lambda()#1}::operator()() const
    0x08050fea    0x08061350    _ZZ4mainENKUlvE0_clEv
                      main::{lambda()#2}::operator()() const
    0x0805102f    0x08061378    main

i.e. the address above is really missing.  With gas instead, I find

  Binary Search Table:
      InitialLoc    FdeLoc
    0x08050fac    0x0806130c    _ZZ4mainENKUlvE_clEv
                      main::{lambda()#1}::operator()() const
    0x08050fdc    0x08061328    _ZZ4mainENUlvE_4_FUNEv
                      main::{lambda()#1}::_FUN()
    0x08050ff0    0x08061348    _ZZ4mainENKUlvE_cvPFvvEEv
                      main::{lambda()#1}::operator void (*)()() const
    0x08050ffa    0x08061388    _ZZ4mainENKUlvE0_clEv
                      main::{lambda()#2}::operator()() const
    0x0805103f    0x080613a8    main


  parent reply	other threads:[~2011-06-06 10:09 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-01 17:28 [Bug c++/49260] New: " janis at gcc dot gnu.org
2011-06-01 17:32 ` [Bug c++/49260] " janis at gcc dot gnu.org
2011-06-02 22:41 ` dominiq at lps dot ens.fr
2011-06-06 10:09 ` ro at gcc dot gnu.org [this message]
2011-06-06 11:19 ` ebotcazou at gcc dot gnu.org
2011-06-20 14:51 ` ro at CeBiTec dot Uni-Bielefeld.DE
2011-06-20 15:57 ` ebotcazou at gcc dot gnu.org
2011-06-22 15:17 ` jason at gcc dot gnu.org
2011-06-22 15:56 ` jason at gcc dot gnu.org
2011-06-22 15:59 ` jason at gcc dot gnu.org
2011-06-28  7:15 ` [Bug c++/49260] [C++0x] lambda-eh2.C " ebotcazou at gcc dot gnu.org
2011-08-02 15:38 ` jason at gcc dot gnu.org
2011-08-02 18:33 ` jason at gcc dot gnu.org

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=bug-49260-4-dn00TOV1hq@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /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).