Date: Mon, 10 Dec 2012 23:23:35 +0200 From: Konstantin Belousov <kostikbel@gmail.com> To: Mark Atkinson <atkin901@gmail.com> Cc: freebsd-current@freebsd.org, kde-freebsd@spider.kde.org Subject: Re: problems with threads/destructors in -current with llvm/clang Message-ID: <20121210212335.GW3013@kib.kiev.ua> In-Reply-To: <ka5j9h$pel$1@ger.gmane.org> References: <50C1E81A.1040107@FreeBSD.org> <50C1F862.2010501@FreeBSD.org> <k9t6bq$bhs$1@ger.gmane.org> <50C22789.3030303@FreeBSD.org> <ka56gv$t60$1@ger.gmane.org> <20121210182525.GR3013@kib.kiev.ua> <ka5gmu$129$1@ger.gmane.org> <20121210203331.GV3013@kib.kiev.ua> <ka5hl1$919$1@ger.gmane.org> <ka5j9h$pel$1@ger.gmane.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--xb2rXNyfy/tCyg2t Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Dec 10, 2012 at 01:13:23PM -0800, Mark Atkinson wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 >=20 > On 12/10/2012 12:45, Mark Atkinson wrote: > > On 12/10/2012 12:33, Konstantin Belousov wrote: > >=20 > >> Hmm. Since I took out -O2 and added -g in rebuilding=20 > >> 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=3D-g clean > >>> all install This is really FAQ. > >=20 > >=20 > > It _is_ strange, because I did almost exactly that (dumped a > > temporary DEBUG_FLAGS/CFLAGS in /etc/make.conf) > >=20 > > The one I had problems with was libc since It needs a make depend > > in there. > >=20 > > $ readelf -w /libexec/ld-elf.so.1 |head The section .debug_aranges > > contains: > >=20 > > Length: 28 Version: 2 Offset > > into .debug_info: 0 Pointer Size: 4 Segment Size: > > 0 > >=20 > > Address Length 0x00000e80 0x49 $ >=20 > So ignoring this weirdness, running under valgrind always segfaults > and the core seems useful. >=20 > #0 0x0061bd59 in handle_signal (actp=3D0xbf9fd490, sig=3D20, > info=3D0xbf9fd7b0, ucp=3D0x0) at /usr/src/lib/libthr/thread/thr_sig.c:198 > #1 0x0061b71c in thr_sighandler (sig=3D20, info=3D0xbf9fd7b0, _ucp=3D0x0) > 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=3D0xbf9fd490, sig=3D20, > info=3D0xbf9fd7b0, ucp=3D0x0) 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); >=20 > (gdb) p actp > $1 =3D (struct sigaction *) 0xbf9fd490 > (gdb) p *actp > $2 =3D {__sigaction_u =3D {__sa_handler =3D 0x288310 > <qt_sa_sigchld_handler(int)>, __sa_sigaction =3D 0x288310 > <qt_sa_sigchld_handler(int)>}, sa_flags =3D 8, sa_mask =3D {__bits =3D {0, > 0, 0, 0}}} > (gdb) p *ucp > Cannot access memory at address 0x0 This looks like a valgrind problem, because kernel correctly passes fourth argument to the signal handler frame. Or rather, the signal trampoline and kernel properly pass ucontext to signal handler. If this appear to be broken, the signal trampoline would cause the fault on the signal return, even for the single-threaded processes. > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v2.0.19 (FreeBSD) > Comment: Using GnuPG with undefined - http://www.enigmail.net/ >=20 > iEYEARECAAYFAlDGUHMACgkQrDN5kXnx8yYBDACfaBBZyDZnQhbxxjw46csLbg7z > X7UAn1ea4LbW8PHXL07BwraiVXakh1bU > =3DGktK > -----END PGP SIGNATURE----- >=20 > _______________________________________________ > freebsd-current@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org" --xb2rXNyfy/tCyg2t Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQIcBAEBAgAGBQJQxlLVAAoJEJDCuSvBvK1BKMoP/iqpI155z0EWe+b+eqMKBRD0 WpuwImlZsBYHGwe7zdOVTNpWLRKXBDj8Mh3ZiG9aHk5coXVQcRnqh52l2fVYJ8P9 0F3GxyEnoI/dfWDBhfo84IJ0osx8tnpQbIszBoQROqymzzu+RoP7E3XWJZBzAdqj iPvF/G8nrDgyD7dCRjMEljo76d3obMnTUdQK1cdGUInh8s5qA6l2hHzCBaODIZdu 8aLidMkDvvKEgaqVXfaDbTcP3Jt6YG1hg4FmWPw7D+HCLM5fyZN+yLyyXjcCqDkC stiIYLikRVVohzPubSmH1NQUWL/YI4cO+hLssqvRTejSW/RRnmWJXo3nd1MYuT6h zA6WECrHqpJJy3IlH58VMIoszc3ujbQfwL38xCgyuHPv+XaTyuVSl6tlWevZeHKl My7TwOLHwnnR26Uv+hvN6JTe5oERfN6yKxi2RNGjZ9wXY9zod3uXkq3yyBBc8xLB MXXcL823ItL90w54bPkdR8YvQ8lChNndAKrY9gevh+H219eVLKPUs7u4F4ekIGYQ d85QM7eUzDh/uU3dNXCQU3UnILN3BK4XCUjUEBGQosMJ5yoow3/UNK94DQkB7vOq EOs6AIq4EAKmI/8k0ToSsf+wW3Y9jCyJqShxGFf4664VqUsU74piEgQRJInIwHdc GiYjhSPnf089m81cw76W =34Tq -----END PGP SIGNATURE----- --xb2rXNyfy/tCyg2t--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20121210212335.GW3013>