From owner-freebsd-current@FreeBSD.ORG Fri Aug 27 19:26:52 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4F02610656A7 for ; Fri, 27 Aug 2010 19:26:52 +0000 (UTC) (envelope-from freebsd-listen@fabiankeil.de) Received: from smtprelay01.ispgateway.de (smtprelay01.ispgateway.de [80.67.31.35]) by mx1.freebsd.org (Postfix) with ESMTP id BA0058FC12 for ; Fri, 27 Aug 2010 19:26:51 +0000 (UTC) Received: from [87.78.61.30] (helo=r500.local) by smtprelay01.ispgateway.de with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.68) (envelope-from ) id 1Op4Ze-0000fj-0g; Fri, 27 Aug 2010 21:26:50 +0200 Date: Fri, 27 Aug 2010 21:25:34 +0200 From: Fabian Keil To: Kostik Belousov Message-ID: <20100827212534.5960efdf@r500.local> In-Reply-To: <20100827190407.GA2396@deviant.kiev.zoral.com.ua> References: <20100827182108.12764ff4@r500.local> <20100827190407.GA2396@deviant.kiev.zoral.com.ua> X-Mailer: Claws Mail 3.7.6 (GTK+ 2.20.1; amd64-portbld-freebsd9.0) X-PGP-KEY-URL: http://www.fabiankeil.de/gpg-keys/freebsd-listen-2008-08-18.asc Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/Tq+xvGg.jfpFioxNcyGd.mM"; protocol="application/pgp-signature" X-Df-Sender: 775067 Cc: freebsd-current@freebsd.org Subject: Re: emacs aborting on exit with recent lib/libc/stdlib/atexit.c changes X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 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: Fri, 27 Aug 2010 19:26:52 -0000 --Sig_/Tq+xvGg.jfpFioxNcyGd.mM Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Kostik Belousov wrote: > On Fri, Aug 27, 2010 at 06:21:08PM +0200, Fabian Keil wrote: > > The recent lib/libc/stdlib/atexit.c changes broke emacs (23.2_2,2) for > > me. It aborts on exit (C-x C-c) after receiving SIGBUS: > >=20 > > fk@r500 ~ $gdb emacs > > GNU gdb 6.1.1 [FreeBSD] > > Copyright 2004 Free Software Foundation, Inc. > > GDB is free software, covered by the GNU General Public License, and > > you are welcome to change it and/or distribute copies of it under > > certain conditions. Type "show copying" to see the conditions. > > There is absolutely no warranty for GDB. Type "show warranty" for > > details. This GDB was configured as "amd64-marcel-freebsd"... > > (gdb) run > > Starting program: /usr/local/bin/emacs=20 > > [New LWP 100281] > > [New Thread 1260600 (LWP 100281)] > >=20 > > Program received signal SIGBUS, Bus error. > > [Switching to Thread 1260600 (LWP 100281)] > > 0x00000008045c432d in __elf_phdr_match_addr () from /lib/libc.so.7 > > (gdb) where > > #0 0x00000008045c432d in __elf_phdr_match_addr () from /lib/libc.so.7 > > #1 0x0000000803038abb in __pthread_cxa_finalize () > > from /lib/libthr.so.3 #2 0x00000008045bdfa7 in __cxa_finalize () > > from /lib/libc.so.7 #3 0x00000008045682c7 in exit () > > from /lib/libc.so.7 #4 0x0000000000556817 in Fkill_emacs (arg=3DCould > > not find the frame base for "Fkill_emacs". ) at emacs.c:2146 > > #5 0x0000000000600ec0 in Ffuncall (nargs=3D1, args=3D0x7fffffffc880) at > > eval.c:3024 #6 0x0000000000658d47 in Fbyte_code (bytestr=3D8602321, > > vector=3D8602357, maxdepth=3D20) at bytecode.c:680 #7 0x00000000006017= e6 > > in funcall_lambda (fun=3D8602229, nargs=3D0, arg_vector=3D0x7fffffffcdc= 8) at > > eval.c:3211 #8 0x00000000006011e0 in Ffuncall (nargs=3D1, > > args=3D0x7fffffffcdc0) at eval.c:3070 #9 0x0000000000658d47 in > > Fbyte_code (bytestr=3D9558105, vector=3D9558141, maxdepth=3D20) at > > bytecode.c:680 #10 0x00000000006017e6 in funcall_lambda (fun=3D9558029, > > nargs=3D1, arg_vector=3D0x7fffffffd358) at eval.c:3211 #11 > > 0x00000000006011e0 in Ffuncall (nargs=3D2, args=3D0x7fffffffd350) at > > eval.c:3070 #12 0x00000000005fb954 in Fcall_interactively > > (function=3D11961778, record_flag=3D11544578, keys=3D20138021) at > > callint.c:869 #13 0x0000000000600f36 in Ffuncall (nargs=3D4, > > args=3D0x7fffffffd760) at eval.c:3030 #14 0x00000000006008fd in call3 > > (fn=3D11756290, arg1=3D11961778, arg2=3D11544578, arg3=3D20138021) at > > eval.c:2850 #15 0x000000000056b7ac in Fcommand_execute (cmd=3D11961778, > > record_flag=3D11544578, keys=3D20138021, special=3D11544674) at > > keyboard.c:10507 #16 0x000000000055cc69 in read_char (commandflag=3D1, > > nmaps=3D2, maps=3D0x7fffffffdb70, prev_event=3D11544578, > > used_mouse_menu=3D0x7fffffffded4, end_time=3D0x0) at keyboard.c:3166 #17 > > 0x000000000056880e in read_key_sequence (keybuf=3D0x7fffffffe280, > > bufsize=3D30, prompt=3D11544578, dont_downcase_last=3D0, > > can_return_switch_frame=3D1, fix_current_buffer=3D1) at keyboard.c:9512 > > #18 0x0000000000558a33 in command_loop_1 () at keyboard.c:1643 #19 > > 0x00000000005fe0aa in internal_condition_case (bfun=3D0x5586a0 > > , handlers=3D11629954, hfun=3D0x557f90 ) at > > eval.c:1490 #20 0x000000000055836a in command_loop_2 () at > > keyboard.c:1360 #21 0x00000000005fda2c in internal_catch > > (tag=3D11621170, func=3D0x558350 , arg=3D11544578) at > > eval.c:1226 #22 0x0000000000558320 in command_loop () at > > keyboard.c:1339 #23 0x0000000000557a85 in recursive_edit_1 () at > > keyboard.c:954 #24 0x0000000000557c45 in Frecursive_edit () at > > keyboard.c:1016 #25 0x00000000005560b8 in main (argc=3D1, > > argv=3D0x7fffffffe840) at emacs.c:1833 > >=20 > > Reverting to lib/libc/stdlib/atexit.c 1.9 gets it working again, > > using 1.11 brings back the crashes. I didn't csup between those > > versions and thus don't have 1.10 in git, but given that it's a > > style change it shouldn't matter. > >=20 > > I'm using amd64 and so far I only noticed the problem with emacs. > >=20 > > Is anyone else seeing this? > Reverting the atexit change might cover the issue in some other place. > Please build and install rtld, libc and libthr with symbolic > debug information. On of the way to do this is to: > cd /usr/src/libexec/rtld-elf > make obj && make depend && make all install DEBUG_FLAGS=3D-g > cd ../../lib/libc > make obj && make depend && make all install DEBUG_FLAGS=3D-g > cd ../../lib/libthr > make obj && make depend && make all install DEBUG_FLAGS=3D-g >=20 > Then, reproduce the crash and get "bt full" output from the > core. I may need some further information after that. #0 0x00000008045dd44c in kill () at kill.S:3 3 RSYSCALL(kill) [New Thread 1260600 (LWP 100244)] (gdb) bt full #0 0x00000008045dd44c in kill () at kill.S:3 No locals. #1 0x00000000005545c0 in fatal_error_signal (sig=3D10) at emacs.c:402 No locals. #2 No symbol table info available. #3 __elf_phdr_match_addr (phdr_info=3D0x7fffffffcf90, addr=3D0x69ba20) at = /usr/src/lib/libc/gen/elf_utils.c:39 i =3D 109 #4 0x0000000803038fdb in __pthread_cxa_finalize (phdr_info=3D0x7fffffffcf9= 0) at /usr/src/lib/libthr/thread/thr_fork.c:109 af =3D (struct pthread_atfork *) 0xe1e7c0 af1 =3D (struct pthread_atfork *) 0x0 #5 0x00000008045be0a7 in __cxa_finalize (dso=3D0x0) at /usr/src/lib/libc/s= tdlib/atexit.c:204 phdr_info =3D {dlpi_addr =3D 0, dlpi_name =3D 0x7fffffffd080 "`=D1= =FF=FF=FF\177", dlpi_phdr =3D 0x7fffffffe848, dlpi_phnum =3D 59448, dlpi_ad= ds =3D 0, dlpi_subs =3D 34367899629,=20 dlpi_tls_modid =3D 15046784, dlpi_tls_data =3D 0x12c2538} p =3D (struct atexit *) 0x0 fn =3D {fn_type =3D 1, fn_ptr =3D {std_func =3D 0x8007ccff0 , cxa_func =3D 0x8007ccff0 }, fn_arg =3D 0x0, fn_dso =3D 0x0} n =3D -1 has_phdr =3D 0 #6 0x00000008045683c7 in exit (status=3D0) at /usr/src/lib/libc/stdlib/exi= t.c:67 No locals. #7 0x0000000000556817 in Fkill_emacs (arg=3DCould not find the frame base = for "Fkill_emacs". ) at emacs.c:2146 gcpro1 =3D Could not find the frame base for "Fkill_emacs". Current language: auto; currently asm Fabian --Sig_/Tq+xvGg.jfpFioxNcyGd.mM Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (FreeBSD) iEYEARECAAYFAkx4ETEACgkQBYqIVf93VJ2A2QCfYNcxxT/+NZ9g2nT1gULHH5w5 ofoAoIOkdMOwPKAvRwoKJV62RNjkB62J =riy6 -----END PGP SIGNATURE----- --Sig_/Tq+xvGg.jfpFioxNcyGd.mM--