From owner-freebsd-current@FreeBSD.ORG Mon Dec 10 21:13:44 2012 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0F61AC79 for ; Mon, 10 Dec 2012 21:13:44 +0000 (UTC) (envelope-from freebsd-current@m.gmane.org) Received: from plane.gmane.org (plane.gmane.org [80.91.229.3]) by mx1.freebsd.org (Postfix) with ESMTP id B28898FC08 for ; Mon, 10 Dec 2012 21:13:43 +0000 (UTC) Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1TiAfg-0006eE-SH for freebsd-current@freebsd.org; Mon, 10 Dec 2012 22:13:52 +0100 Received: from 208.85.208.53 ([208.85.208.53]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 10 Dec 2012 22:13:52 +0100 Received: from atkin901 by 208.85.208.53 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 10 Dec 2012 22:13:52 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-current@freebsd.org From: Mark Atkinson Subject: Re: problems with threads/destructors in -current with llvm/clang Date: Mon, 10 Dec 2012 13:13:23 -0800 Lines: 72 Message-ID: References: <50C1E81A.1040107@FreeBSD.org> <50C1F862.2010501@FreeBSD.org> <50C22789.3030303@FreeBSD.org> <20121210182525.GR3013@kib.kiev.ua> <20121210203331.GV3013@kib.kiev.ua> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 208.85.208.53 User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:17.0) Gecko/17.0 Thunderbird/17.0 In-Reply-To: X-Enigmail-Version: 1.4.6 Cc: kde-freebsd@freebsd.kde.org X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Dec 2012 21:13:44 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 12/10/2012 12:45, Mark Atkinson wrote: > On 12/10/2012 12:33, Konstantin Belousov wrote: > >> Hmm. Since I took out -O2 and added -g in rebuilding >> libthr/libc/rtld, I figured I needed to reproduce a new >> segfault, but the rtld side of things seems broken: >>> Use e.g. cd src/libexec/rtld-elf && make DEBUG_FLAGS=-g clean >>> all install This is really FAQ. > > > It _is_ strange, because I did almost exactly that (dumped a > temporary DEBUG_FLAGS/CFLAGS in /etc/make.conf) > > The one I had problems with was libc since It needs a make depend > in there. > > $ readelf -w /libexec/ld-elf.so.1 |head The section .debug_aranges > contains: > > Length: 28 Version: 2 Offset > into .debug_info: 0 Pointer Size: 4 Segment Size: > 0 > > Address Length 0x00000e80 0x49 $ So ignoring this weirdness, running under valgrind always segfaults and the core seems useful. #0 0x0061bd59 in handle_signal (actp=0xbf9fd490, sig=20, info=0xbf9fd7b0, ucp=0x0) at /usr/src/lib/libthr/thread/thr_sig.c:198 #1 0x0061b71c in thr_sighandler (sig=20, info=0xbf9fd7b0, _ucp=0x0) at /usr/src/lib/libthr/thread/thr_sig.c:182 #2 0x380434dc in ?? () #3 0x00000014 in ?? () #4 0xbf9fd7b0 in ?? () #5 0x00000000 in ?? () (gdb) frame 0 #0 0x0061bd59 in handle_signal (actp=0xbf9fd490, sig=20, info=0xbf9fd7b0, ucp=0x0) at /usr/src/lib/libthr/thread/thr_sig.c:198 198 SIGSETOR(actp->sa_mask, ucp->uc_sigmask); (gdb) list 193 int cancel_enable; 194 int in_sigsuspend; 195 int err; 196 197 /* add previous level mask */ 198 SIGSETOR(actp->sa_mask, ucp->uc_sigmask); 199 200 /* add this signal's mask */ 201 if (!(actp->sa_flags & SA_NODEFER)) 202 SIGADDSET(actp->sa_mask, sig); (gdb) p actp $1 = (struct sigaction *) 0xbf9fd490 (gdb) p *actp $2 = {__sigaction_u = {__sa_handler = 0x288310 , __sa_sigaction = 0x288310 }, sa_flags = 8, sa_mask = {__bits = {0, 0, 0, 0}}} (gdb) p *ucp Cannot access memory at address 0x0 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) Comment: Using GnuPG with undefined - http://www.enigmail.net/ iEYEARECAAYFAlDGUHMACgkQrDN5kXnx8yYBDACfaBBZyDZnQhbxxjw46csLbg7z X7UAn1ea4LbW8PHXL07BwraiVXakh1bU =GktK -----END PGP SIGNATURE-----