[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#212048: marked as done (g++-3.3: a statically compiled c++ binary which references syslog(3) SEGFAULTs on an exception)



Your message dated Sun, 12 Oct 2003 16:09:15 +0100
with message-id <87brsm8pd0.fsf@shiri.gloaming.local>
and subject line g++-3.3: a statically compiled c++ binary which references syslog(3) SEGFAULTs on an exception
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--------------------------------------
Received: (at submit) by bugs.debian.org; 21 Sep 2003 21:57:39 +0000
>From ahu@ds9a.nl Sun Sep 21 16:57:37 2003
Return-path: <ahu@ds9a.nl>
Received: from smtpzilla1.xs4all.nl [194.109.127.137] 
	by master.debian.org with esmtp (Exim 3.35 1 (Debian))
	id 1A1CD2-0004yA-00; Sun, 21 Sep 2003 16:57:37 -0500
Received: from d800.ds9a.nl (adsl-xs4all.ds9a.nl [213.84.159.51])
	by smtpzilla1.xs4all.nl (8.12.9/8.12.9) with ESMTP id h8LLvaIh072228;
	Sun, 21 Sep 2003 23:57:36 +0200 (CEST)
Message-Id: <200309212157.h8LLvaIh072228@smtpzilla1.xs4all.nl>
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
From: bert hubert <ahu@ds9a.nl>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: g++-3.3: a statically compiled c++ binary which references syslog(3)
 SEGFAULTs on an exception
X-Mailer: reportbug 2.29
Date: Sun, 21 Sep 2003 23:57:35 +0200
Delivered-To: submit@bugs.debian.org
X-Spam-Status: No, hits=-1.8 required=4.0
	tests=HAS_PACKAGE,MSG_ID_ADDED_BY_MTA_3,WEIRD_QUOTING
	version=2.53-bugs.debian.org_2003_9_20
X-Spam-Level: 
X-Spam-Checker-Version: SpamAssassin 2.53-bugs.debian.org_2003_9_20 (1.174.2.15-2003-03-30-exp)

Package: g++-3.3
Version: 1:3.3.2-0pre4
Severity: important
Tags: sid

When compiled with "g++ static.cc -o static -static", this program segfaults
on execution. I spent 6 hours narrowing this down as it is a very unlikely
bug. Some speculation below.

#include <syslog.h>
#include <iostream>

using namespace std;

int func()
{
  syslog(LOG_INFO,"","");
}

int main(int argc, char **argv)
{
  try {
    throw(10);
  }
  catch(...) {
    cout<<"Smells like a 10"<<endl;
  }
}

Commenting out syslog solves the problem. The backtrace:

#0  0x0808c7e0 in get_cie_encoding ()
#1  0x0808cc3a in classify_object_over_fdes ()
#2  0x0808daa9 in init_object ()
#3  0x0808d1e8 in search_object ()
#4  0x0808d298 in _Unwind_Find_registered_FDE ()
#5  0x0808d79c in _Unwind_Find_FDE ()
#6  0x0808b314 in uw_frame_state_for ()
#7  0x0808b84f in uw_init_context_1 ()
#8  0x0808bad8 in _Unwind_RaiseException ()
#9  0x0807d999 in __cxa_throw ()
#10 0x08048253 in main ()

The following may be interesting:
$ nm -C static.o
00000110 t global constructors keyed to func()

The problem exists even when syslog is, in fact, never called. So I suspect
the problem must lie in these 'global constructors keyed to func()'. In the
glibc-2.3.2 sources we find:

/* Define the lock.  */
__libc_lock_define_initialized (static, syslog_lock)

Which may well lead to a global initializer.

-- System Information:
Debian Release: testing/unstable
Architecture: i386
Kernel: Linux d800.ds9a.nl 2.6.0-test4 #2 Sat Aug 23 15:40:41 CEST 2003 i686
Locale: LANG=C, LC_CTYPE=

Versions of packages g++-3.3 depends on:
ii  gcc-3.3                    1:3.3.2-0pre4 The GNU C compiler
ii  gcc-3.3-base               1:3.3.2-0pre4 The GNU Compiler Collection (base 
ii  libc6                      2.3.2-7       GNU C Library: Shared libraries an
ii  libstdc++5-3.3-dev         1:3.3.2-0pre4 The GNU Standard C++ Library v3 (d

-- no debconf information


---------------------------------------
Received: (at 212048-done) by bugs.debian.org; 12 Oct 2003 15:09:18 +0000
>From james@ruari-quinn.demon.co.uk Sun Oct 12 10:09:16 2003
Return-path: <james@ruari-quinn.demon.co.uk>
Received: from cpc1-leed3-6-0-cust171.ldst.cable.ntl.com (shiri.gloaming.local) [80.6.171.171] 
	by master.debian.org with esmtp (Exim 3.35 1 (Debian))
	id 1A8hqO-0000GH-00; Sun, 12 Oct 2003 10:09:16 -0500
Received: from james by shiri.gloaming.local with local (Exim 3.36 #1 (Debian))
	id 1A8hqN-0008Kg-00
	for <212048-done@bugs.debian.org>; Sun, 12 Oct 2003 16:09:15 +0100
To: 212048-done@bugs.debian.org
Subject: Re: g++-3.3: a statically compiled c++ binary which references
 syslog(3) SEGFAULTs on an exception
Mail-Copies-To: never
From: James Troup <james@nocrew.org>
Date: Sun, 12 Oct 2003 16:09:15 +0100
Message-ID: <87brsm8pd0.fsf@shiri.gloaming.local>
User-Agent: Gnus/5.090016 (Oort Gnus v0.16) Emacs/20.7 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Sender: James Troup <james@ruari-quinn.demon.co.uk>
Delivered-To: 212048-done@bugs.debian.org
X-Spam-Status: No, hits=-5.7 required=4.0
	tests=PGP_SIGNATURE
	version=2.53-bugs.debian.org_2003_10_09
X-Spam-Level: 
X-Spam-Checker-Version: SpamAssassin 2.53-bugs.debian.org_2003_10_09 (1.174.2.15-2003-03-30-exp)

Hi,

This has been fixed by binutils 2.14.90.0.6-4 which has just been
uploaded to the archive.

The .changes file is below for reference.

-- 
James

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.7
Date: Sun, 12 Oct 2003 14:26:26 +0100
Source: binutils
Binary: binutils-dev binutils-multiarch binutils binutils-doc
Architecture: source all i386
Version: 2.14.90.0.6-4
Distribution: unstable
Urgency: low
Maintainer: James Troup <james@nocrew.org>
Changed-By: James Troup <james@nocrew.org>
Description: 
 binutils   - The GNU assembler, linker and binary utilities
 binutils-dev - The GNU binary utilities (BFD development files)
 binutils-doc - Documentation for the GNU assembler, linker and binary utilities
 binutils-multiarch - Binary utilities that support multi-arch targets
Closes: 213448
Changes: 
 binutils (2.14.90.0.6-4) unstable; urgency=low
 .
   * 103_static_linking_elf_eh_frame.dpatch: new patch from H.J. Lu
     <hongjiu.lu@intel.com> to fix static linking of C++ binaries.
 .
   * 200_alpha_null_got_ld_fix.dpatch: renamed...
   * 102_alpha_null_got_ld_fix.dpatch: to this.
 .
   * debian/rules: patch from Guido Guenther <agx@debian.org> to enable
     mips64 support.  Closes: #213448
Files: 
 aeb2e36623db380479b7ae967a1e4258 826 devel standard binutils_2.14.90.0.6-4.dsc
 877332975ed2b6ed5c0679cb696fa164 35954 devel standard binutils_2.14.90.0.6-4.diff.gz
 57c1c2b67f418601fc7d0a8a3de71792 418330 doc optional binutils-doc_2.14.90.0.6-4_all.deb
 509f48745ace50e2b911823f50ae6dc2 2429690 devel standard binutils_2.14.90.0.6-4_i386.deb
 b0114dbdffa77443d933c844e7a4e140 2816932 devel extra binutils-dev_2.14.90.0.6-4_i386.deb
 8b463c8cb9b7c584e9be94d75cb32d9f 7961190 devel extra binutils-multiarch_2.14.90.0.6-4_i386.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)

iEYEARECAAYFAj+JaGwACgkQgD/uEicUG7AK9QCaA68cuiTDUYNkPQS3I1zMcuuU
leEAnjpEr55/quHMoJMzzyDlLPT/NaSj
=rLBp
-----END PGP SIGNATURE-----



Reply to: