From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 18 15:46:38 2013 Received: (at submit) by debbugs.gnu.org; 18 Sep 2013 19:46:38 +0000 Received: from localhost ([127.0.0.1]:47305 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VMNht-0006VE-Cz for submit@debbugs.gnu.org; Wed, 18 Sep 2013 15:46:37 -0400 Received: from eggs.gnu.org ([208.118.235.92]:58822) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VMNYv-0006AC-Co for submit@debbugs.gnu.org; Wed, 18 Sep 2013 15:37:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VMNYj-0003Wq-FD for submit@debbugs.gnu.org; Wed, 18 Sep 2013 15:37:15 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_05 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:45954) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VMNYj-0003WW-Bh for submit@debbugs.gnu.org; Wed, 18 Sep 2013 15:37:09 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60516) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VMNYd-0000ez-S9 for bug-guile@gnu.org; Wed, 18 Sep 2013 15:37:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VMNYY-0003EM-C4 for bug-guile@gnu.org; Wed, 18 Sep 2013 15:37:03 -0400 Received: from rdmp.org ([46.137.114.159]:39909) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VMNYY-0003DF-31 for bug-guile@gnu.org; Wed, 18 Sep 2013 15:36:58 -0400 Received: from [127.0.0.1] (helo=[IPv6:::1]) by rdmp.org with esmtp (Exim 4.77) (envelope-from ) id 1VMNYP-0002qp-Kl for bug-guile@gnu.org; Wed, 18 Sep 2013 20:36:51 +0100 Message-ID: <1379532999.4818.5.camel@l2> Subject: libguile initialization inside a pthread segfaults From: Dale Mellor To: bug-guile@gnu.org Date: Wed, 18 Sep 2013 20:36:39 +0100 Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-NVvvTZgdq98ZH14lMet6" X-Mailer: Evolution 3.4.4-3 Mime-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Wed, 18 Sep 2013 15:46:36 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) --=-NVvvTZgdq98ZH14lMet6 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable The following program fails; it produces the session shown below. Any help greatly appreciated. Dale =3DPROGRAM=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D #include static void *do_guile (void *) { for (;;) ; return nullptr; } static void *run_thread (void *) { return scm_with_guile (&do_guile, nullptr); } int main (int, char **) { pthread_t thread; pthread_create (&thread, nullptr, run_thread, nullptr); pthread_join (thread, nullptr); return 0; } =3D/PROGRAM=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3DSESSION=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D $ cat /etc/debian_version=20 7.1 $ g++-4.6 --version g++-4.6 (Debian 4.6.3-14) 4.6.3 $ guile --version guile (GNU Guile) 2.0.5-deb+1-3 $ g++-4.6 --std=3Dc++0x test.cc `pkg-config --libs --cflags guile-2.0` -g $ gdb a.out GNU gdb (GDB) 7.4.1-debian This GDB was configured as "i486-linux-gnu". Reading symbols from a.out...done. (gdb) r Starting program: a.out=20 warning: Could not load shared library symbols for linux-gate.so.1. Do you need "set solib-search-path" or "set sysroot"? [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/i386-linux-gnu/i686/cmov/libthread_db.so.1". [New Thread 0xb7916b40 (LWP 4792)] Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0xb7916b40 (LWP 4792)] 0xb7e2854f in GC_push_all_eager () from /usr/lib/libgc.so.1 (gdb) info stack #0 0xb7e2854f in GC_push_all_eager () from /usr/lib/libgc.so.1 #1 0xb7e285a3 in GC_push_all_stack () from /usr/lib/libgc.so.1 #2 0xb7e30b9b in GC_push_all_stacks () from /usr/lib/libgc.so.1 #3 0xb7e2b6e4 in GC_default_push_other_roots () from /usr/lib/libgc.so.1 #4 0xb7e29c45 in GC_push_roots () from /usr/lib/libgc.so.1 #5 0xb7e290b6 in GC_mark_some () from /usr/lib/libgc.so.1 #6 0xb7e1ffb5 in GC_stopped_mark () from /usr/lib/libgc.so.1 #7 0xb7e206ba in GC_try_to_collect_inner () from /usr/lib/libgc.so.1 #8 0xb7e2ae50 in GC_init_inner () from /usr/lib/libgc.so.1 #9 0xb7e2afa4 in GC_init () from /usr/lib/libgc.so.1 #10 0xb7eba7d0 in ?? () from /usr/lib/libguile-2.0.so.22 #11 0xb7ecbebd in ?? () from /usr/lib/libguile-2.0.so.22 #12 0xb7f29750 in ?? () from /usr/lib/libguile-2.0.so.22 #13 0xb7f29790 in ?? () from /usr/lib/libguile-2.0.so.22 #14 0xb7e2aa2e in GC_call_with_stack_base () from /usr/lib/libgc.so.1 #15 0xb7f2998f in scm_with_guile () from /usr/lib/libguile-2.0.so.22 #16 0x08048663 in run_thread () at test.cc:16 #17 0xb7cb2cf1 in start_thread () from /lib/i386-linux-gnu/i686/cmov/libpthread.so.0 #18 0xb7bebfee in clone () from /lib/i386-linux-gnu/i686/cmov/libc.so.6 (gdb) thr 1 [Switching to thread 1 (Thread 0xb7918700 (LWP 4789))] #0 0xb7fde424 in __kernel_vsyscall () (gdb) info stack #0 0xb7fde424 in __kernel_vsyscall () #1 0xb7cb3d8c in pthread_join () from /lib/i386-linux-gnu/i686/cmov/libpthread.so.0 #2 0x080486a6 in main () at test.cc:26 (gdb) quit =3D/SESSION=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --=-NVvvTZgdq98ZH14lMet6 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEABECAAYFAlI6AMcACgkQykcf1QFhiklBhACaAxMVTa2Ov9RjSwHiefG5MK5N g6YAn3swRnii1sOthH4bqXnDafCjMVBW =PQCW -----END PGP SIGNATURE----- --=-NVvvTZgdq98ZH14lMet6-- From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 13 10:06:50 2013 Received: (at 15411-done) by debbugs.gnu.org; 13 Oct 2013 14:06:50 +0000 Received: from localhost ([127.0.0.1]:45794 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VVMJl-0006Vu-LS for submit@debbugs.gnu.org; Sun, 13 Oct 2013 10:06:50 -0400 Received: from hera.aquilenet.fr ([141.255.128.1]:45942) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VVMJj-0006Vf-Jf for 15411-done@debbugs.gnu.org; Sun, 13 Oct 2013 10:06:48 -0400 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 45BD91707; Sun, 13 Oct 2013 16:06:46 +0200 (CEST) Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Tq9U0IuYsuUk; Sun, 13 Oct 2013 16:06:46 +0200 (CEST) Received: from pluto (reverse-83.fdn.fr [80.67.176.83]) by hera.aquilenet.fr (Postfix) with ESMTPSA id D6E6F1705; Sun, 13 Oct 2013 16:06:45 +0200 (CEST) From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Dale Mellor Subject: Re: bug#15411: libguile initialization inside a pthread segfaults References: <1379532999.4818.5.camel@l2> Date: Sun, 13 Oct 2013 16:06:45 +0200 In-Reply-To: <1379532999.4818.5.camel@l2> (Dale Mellor's message of "Wed, 18 Sep 2013 20:36:39 +0100") Message-ID: <87eh7p8du2.fsf@gnu.org> User-Agent: Gnus/5.130007 (Ma Gnus v0.7) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 15411-done Cc: 15411-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) Hi Dale, Dale Mellor skribis: > =3DPROGRAM=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > #include > > > > static void *do_guile (void *) > { > for (;;) ; > > return nullptr; > } > > > > static void *run_thread (void *) > { > return scm_with_guile (&do_guile, nullptr); > } > > > > int main (int, char **) > { > pthread_t thread; > pthread_create (&thread, nullptr, run_thread, nullptr); > > pthread_join (thread, nullptr); > > return 0; > } > > =3D/PROGRAM=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D This program is similar to this test: http://git.savannah.gnu.org/cgit/guile.git/tree/test-suite/standalone/tes= t-pthread-create-secondary.c > =3DSESSION=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > $ cat /etc/debian_version=20 > 7.1 > > $ g++-4.6 --version > g++-4.6 (Debian 4.6.3-14) 4.6.3 > > $ guile --version > guile (GNU Guile) 2.0.5-deb+1-3 The test above appeared in 2.0.6. As the comment notes, this bug was fixed in libgc after version 7.2alpha5. Thus, I would recommend upgrading libgc. I=E2=80=99m closing the bug, but feel free to reopen if you think I got it = wrong! HTH, Ludo=E2=80=99. From unknown Wed Jun 25 00:21:42 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 11 Nov 2013 12:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator