From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15450 invoked by alias); 6 Jun 2011 10:09:07 -0000 Received: (qmail 15440 invoked by uid 22791); 6 Jun 2011 10:09:06 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,TW_FC X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 06 Jun 2011 10:08:51 +0000 From: "ro at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/49260] cpp0x/lambda/lambda-eh2.C fails execution X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ro at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: CC Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Mon, 06 Jun 2011 10:09:00 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2011-06/txt/msg00388.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49260 Rainer Orth changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ro at gcc dot gnu.org --- Comment #3 from Rainer Orth 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 : incl 0x874fffa(%ebx) 0xfef29500 <__cxa_throw+96>: decl 0x23e82434(%ecx) 0x8051019 : incl 0x874fffa(%ebx) 0xfee350d5 <_Unwind_RaiseException+52>: decl -0x1577b(%ebp) 0xfef29500 <__cxa_throw+96>: decl 0x23e82434(%ecx) 0x8050fcb : 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 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