From unknown Sun Jun 22 07:56:24 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10655: [2.0.3+] =?UTF-8?Q?=E2=80=98queue=5Fafter=5Fgc=5Fhook=E2=80=99?= called during thread startup leads to SIGSEGV Resent-From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-guile@gnu.org Resent-Date: Mon, 30 Jan 2012 15:28:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 10655 X-GNU-PR-Package: guile X-GNU-PR-Keywords: To: 10655@debbugs.gnu.org X-Debbugs-Original-To: bug-guile@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.132793723418358 (code B ref -1); Mon, 30 Jan 2012 15:28:01 +0000 Received: (at submit) by debbugs.gnu.org; 30 Jan 2012 15:27:14 +0000 Received: from localhost ([127.0.0.1]:45319 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Rrt8T-0004m2-Ch for submit@debbugs.gnu.org; Mon, 30 Jan 2012 10:27:14 -0500 Received: from eggs.gnu.org ([140.186.70.92]:36908) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Rrt8Q-0004lp-LK for submit@debbugs.gnu.org; Mon, 30 Jan 2012 10:27:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rrt85-0003z0-Ah for submit@debbugs.gnu.org; Mon, 30 Jan 2012 10:26:55 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([140.186.70.17]:41109) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rrt85-0003yv-8f for submit@debbugs.gnu.org; Mon, 30 Jan 2012 10:26:49 -0500 Received: from eggs.gnu.org ([140.186.70.92]:55126) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rrt83-0000x5-V8 for bug-guile@gnu.org; Mon, 30 Jan 2012 10:26:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rrt7x-0003xA-NM for bug-guile@gnu.org; Mon, 30 Jan 2012 10:26:47 -0500 Received: from mail4-relais-sop.national.inria.fr ([192.134.164.105]:45970) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rrt7x-0003x3-9D for bug-guile@gnu.org; Mon, 30 Jan 2012 10:26:41 -0500 X-IronPort-AV: E=Sophos;i="4.71,592,1320620400"; d="scan'208";a="129421071" Received: from unknown (HELO pluto) ([193.50.110.167]) by mail4-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-SHA; 30 Jan 2012 16:26:39 +0100 From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 11 =?UTF-8?Q?Pluvi=C3=B4se?= an 220 de la =?UTF-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0xEA52ECF4 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 83C4 F8E5 10A3 3B4C 5BEA D15D 77DD 95E2 EA52 ECF4 X-OS: x86_64-unknown-linux-gnu Date: Mon, 30 Jan 2012 16:26:39 +0100 Message-ID: <87y5spxlcg.fsf@gnu.org> User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.17 X-Spam-Score: -4.2 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.2 (----) Hi! I=E2=80=99ve just captured the following backtrace on x86_64-linux-gnu (with v2.0.3-212-g2f3e436): --8<---------------cut here---------------start------------->8--- Core was generated by `/home/ludo/soft/bin/guile -e (@@ (guild) main) -s /h= ome/ludo/soft/bin/guile-too'.=20 Program terminated with signal 11, Segmentation fault. #0 queue_after_gc_hook (hook_data=3D, fn_data=3D, data=3D) at gc.c:737 737 SCM_SETCDR (after_gc_async_cell, t->active_asyncs); (gdb) thread apply all bt Thread 2 (Thread 27824): #0 0x00007f236e50b930 in sem_wait () from /nix/store/vxycd107wjbhcj720hzkw2px7s7kr724-glibc-2.12.2/lib/libpth= read.so.0 #1 0x00007f236e73abe8 in GC_pthread_create (new_thread=3D0x7fff1406fce8, a= ttr=3D0x0, start_routine=3D0x7f236ea5aa10 , arg=3D0x7fff1406fc60) at= pthread_support.c:1582 #2 0x00007f236ea5b71c in scm_spawn_thread (body=3D, body_data=3D, handler=3D0x7f236ea5da90 , handler_data=3D0x7f236ea9bb48) at threads.c:1125 #3 0x00007f236ea37f61 in start_signal_delivery_thread () at scmsigs.c:208 #4 0x00007f236e50ac83 in pthread_once () from /nix/store/vxycd107wjbhcj720hzkw2px7s7kr724-glibc-2.12.2/lib/libpth= read.so.0 #5 0x00007f236ea3814a in scm_sigaction_for_thread (signum=3D, handler=3D0x6, flags=3D0x904, thread=3D0x23bae40) at scmsigs.c:338 #6 0x00007f236ea39216 in scm_system_star (args=3D) at= simpos.c:133 #7 0x00007f236ea71e4b in vm_regular_engine (vm=3D0x2441740, program=3D0x24= cfa20, argv=3D0x24458c8, nargs=3D-1) at vm-i-system.c:892 #8 0x00007f236e9eb9b3 in scm_primitive_eval (exp=3D0x2a98340) at eval.c:639 #9 0x00007f236ea0deab in scm_primitive_load (filename=3D) at load.c:131 #10 0x00007f236ea0e316 in scm_primitive_load_path (args=3D) at load.c:954 #11 0x00007f236ea71e4b in vm_regular_engine (vm=3D0x2441740, program=3D0x29= bd820, argv=3D0x24452f0, nargs=3D-1) at vm-i-system.c:892 #12 0x00007f236ea0e4a8 in scm_primitive_load_path (args=3D) at load.c:913 #13 0x00007f236ea71e4b in vm_regular_engine (vm=3D0x2441740, program=3D0x29= afa20, argv=3D0x2445020, nargs=3D-1) at vm-i-system.c:892 #14 0x00007f236ea0e4a8 in scm_primitive_load_path (args=3D) at load.c:913 #15 0x00007f236ea71e4b in vm_regular_engine (vm=3D0x2441740, program=3D0x29= 955e0, argv=3D0x2444d50, nargs=3D-1) at vm-i-system.c:892 #16 0x00007f236ea0e4a8 in scm_primitive_load_path (args=3D) at load.c:913 #17 0x00007f236ea71e4b in vm_regular_engine (vm=3D0x2441740, program=3D0x24= cfa20, argv=3D0x2444a80, nargs=3D-1) at vm-i-system.c:892 #18 0x00007f236e9eb9b3 in scm_primitive_eval (exp=3D0x260e790) at eval.c:639 #19 0x00007f236e9eba13 in scm_eval (exp=3D0x260e790, module_or_state=3D0x25= f1d80) at eval.c:673 #20 0x00007f236ea390cf in scm_shell (argc=3D17, argv=3D0x7fff140712e8) at s= cript.c:441 #21 0x00007f236ea0814d in invoke_main_func (body_data=3D0x7fff140711d0) at = init.c:336 #22 0x00007f236e9e221a in c_body (d=3D0x7fff14071120) at continuations.c:512 #23 0x00007f236ea71eea in vm_regular_engine (vm=3D0x2441740, program=3D0x25= 2ea50, argv=3D0x24440c0, nargs=3D-1) at vm-i-system.c:960 #24 0x00007f236e9eb683 in scm_call_4 (proc=3D0x252ea50, arg1=3D, arg2=3D, arg3=3D, arg4=3D) at eval.c:506 #25 0x00007f236e9e2a03 in scm_i_with_continuation_barrier (body=3D0x7f236e9= e2210 , body_data=3D0x7fff14071120, handler=3D0x7f236e9e25e0 , handl= er_data=3D0x7fff14071120, pre_unwind_handler=3D, pre_unwind_handler_data=3D<= value optimized out>) at continuations.c:450 #26 0x00007f236e9e2ab5 in scm_c_with_continuation_barrier (func=3D, data=3D) at continuations.c:546 #27 0x00007f236ea5ae2a in with_guile_and_parent (base=3D0x7fff14071180, dat= a=3D) at threads.c:902 #28 0x00007f236e7348d5 in GC_call_with_stack_base (fn=3D, arg=3D) at misc.c:1535 #29 0x00007f236ea5afd8 in scm_i_with_guile_and_parent (func=3D, data=3D) at threads.c:945 #30 scm_with_guile (func=3D, data=3D) at threads.c:951 #31 0x00007f236ea08255 in scm_boot_guile (argc=3D, arg= v=3D, main_func=3D, closure=3D) at = init.c:319 #32 0x0000000000400b3a in main (argc=3D, argv=3D) at guile.c:71 Thread 1 (Thread 27825): #0 queue_after_gc_hook (hook_data=3D, fn_data=3D, data=3D) at gc.c:737 #1 0x00007f236ea0518c in scm_c_hook_run (hook=3D0x7f236ed00a10, data=3D0x0= ) at hooks.c:103 #2 0x00007f236e729951 in GC_notify_full_gc (stop_func=3D0x7f236e728e00 ) at alloc.c:334 #3 GC_try_to_collect_inner (stop_func=3D0x7f236e728e00 ) at alloc.c:429 #4 GC_try_to_collect_inner (stop_func=3D0x7f236e728e00 ) at alloc.c:410 #5 0x00007f236e72a65e in GC_collect_or_expand (needed_blocks=3D1, ignore_o= ff_page=3D0, retry=3D) at alloc.c:1215 #6 0x00007f236e72a7c6 in GC_allocobj (gran=3D42, kind=3D1) at alloc.c:1302 #7 0x00007f236e72f61a in GC_generic_malloc_inner (lb=3D664, k=3D1) at mall= oc.c:121 #8 0x00007f236e739aff in GC_new_thread (id=3D139790027667200) at pthread_s= upport.c:478 #9 0x00007f236e739fb7 in GC_register_my_thread_inner (sb=3D0x7f2366f12ed0, my_pthread=3D) at pthread_support.c:1358 #10 0x00007f236e73a167 in GC_start_rtn_prepare_thread (pstart=3D0x7f2366f12= eb0, pstart_arg=3D0x7f2366f12eb8, sb=3D0x7f2366f12ed0, arg=3D0x2aa1fc0) at p= thread_support.c:1449 #11 0x00007f236e739993 in GC_inner_start_routine (sb=3D, arg=3D) at pthread_start.c:50 #12 0x00007f236e7348d5 in GC_call_with_stack_base (fn=3D, arg=3D) at misc.c:1535 #13 0x00007f236e504cec in start_thread () from /nix/store/vxycd107wjbhcj720hzkw2px7s7kr724-glibc-2.12.2/lib/libpth= read.so.0 #14 0x00007f236d0111ed in clone () from /nix/store/vxycd107wjbhcj720hzkw2px7s7kr724-glibc-2.12.2/lib/libc.s= o.6 --8<---------------cut here---------------end--------------->8--- The problems seems to be that the after-gc-hook runs while the thread is being created and not yet a full-blown Guile thread. Thanks, Ludo=E2=80=99. From unknown Sun Jun 22 07:56:24 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10655: [2.0.3+] =?UTF-8?Q?=E2=80=98queue=5Fafter=5Fgc=5Fhook=E2=80=99?= called during thread startup leads to SIGSEGV Resent-From: Andy Wingo Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-guile@gnu.org Resent-Date: Mon, 30 Jan 2012 15:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10655 X-GNU-PR-Package: guile X-GNU-PR-Keywords: To: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Cc: 10655@debbugs.gnu.org Received: via spool by 10655-submit@debbugs.gnu.org id=B10655.132793764919011 (code B ref 10655); Mon, 30 Jan 2012 15:35:02 +0000 Received: (at 10655) by debbugs.gnu.org; 30 Jan 2012 15:34:09 +0000 Received: from localhost ([127.0.0.1]:45333 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RrtFB-0004wZ-AL for submit@debbugs.gnu.org; Mon, 30 Jan 2012 10:34:09 -0500 Received: from a-pb-sasl-sd.pobox.com ([74.115.168.62]:35083 helo=sasl.smtp.pobox.com) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RrtEz-0004vm-Eh for 10655@debbugs.gnu.org; Mon, 30 Jan 2012 10:34:03 -0500 Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id 8D82C96B5; Mon, 30 Jan 2012 10:33:46 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; s=sasl; bh=kQ71HAHYFcMW 6yxpoSp/W/RZOdE=; b=D7GDgAG9bBnNZJS4ySM+7eeJP1lQollozbDUGfDpOk8s GwbxW/VKbqmV0OnQOPgMmLQLwQ/ro1ggQklNfEdBDUXuL3VeOAe35L7sqMv1za+F BRrJ/Dd0xZIJ6zKMadK2hP4V09W5Jbsj79SDpYlm5vZs9/4f+xZJOqLLoqTmQMQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; q=dns; s=sasl; b=v678wW za+VVPuPPoXpbv+Zjmpbroo9jGp3IpA/AJ6usUcFNi2RKSc9SNZnC22qPSMFFCRA AuchiTLfp4jFAIaXnFCm475QFuVjnT3/F3UV8Gys99PCLIgugqXhuYO9WGKKlwn2 x4oB5B+TrPEKEMdLQBjKOB1b9Rera9dtab/tY= Received: from a-pb-sasl-sd.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id 8578496B4; Mon, 30 Jan 2012 10:33:46 -0500 (EST) Received: from badger (unknown [85.50.103.218]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTPSA id C49F296B3; Mon, 30 Jan 2012 10:33:45 -0500 (EST) From: Andy Wingo References: <87y5spxlcg.fsf@gnu.org> Date: Mon, 30 Jan 2012 16:33:42 +0100 In-Reply-To: <87y5spxlcg.fsf@gnu.org> ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s message of "Mon, 30 Jan 2012 16:26:39 +0100") Message-ID: <87mx95w6g9.fsf@pobox.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Pobox-Relay-ID: CC499DD0-4B57-11E1-9CFE-65B1DE995924-02397024!a-pb-sasl-sd.pobox.com X-Spam-Score: -1.9 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) On Mon 30 Jan 2012 16:26, ludo@gnu.org (Ludovic Court=C3=A8s) writes: > #0 queue_after_gc_hook (hook_data=3D, fn_data=3D, > data=3D) at gc.c:737 > #1 0x00007f236ea0518c in scm_c_hook_run (hook=3D0x7f236ed00a10, data=3D0= x0) at hooks.c:103 > #2 0x00007f236e729951 in GC_notify_full_gc (stop_func=3D0x7f236e728e00 <= GC_never_stop_func>) > at alloc.c:334 > #3 GC_try_to_collect_inner (stop_func=3D0x7f236e728e00 ) at alloc.c:429 > #4 GC_try_to_collect_inner (stop_func=3D0x7f236e728e00 ) at alloc.c:410 > #5 0x00007f236e72a65e in GC_collect_or_expand (needed_blocks=3D1, ignore= _off_page=3D0, > retry=3D) at alloc.c:1215 > #6 0x00007f236e72a7c6 in GC_allocobj (gran=3D42, kind=3D1) at alloc.c:13= 02 > #7 0x00007f236e72f61a in GC_generic_malloc_inner (lb=3D664, k=3D1) at ma= lloc.c:121 > #8 0x00007f236e739aff in GC_new_thread (id=3D139790027667200) at pthread= _support.c:478 > #9 0x00007f236e739fb7 in GC_register_my_thread_inner (sb=3D0x7f2366f12ed= 0, > my_pthread=3D) at pthread_support.c:1358 > #10 0x00007f236e73a167 in GC_start_rtn_prepare_thread (pstart=3D0x7f2366f= 12eb0, > pstart_arg=3D0x7f2366f12eb8, sb=3D0x7f2366f12ed0, arg=3D0x2aa1fc0) at= pthread_support.c:1449 > #11 0x00007f236e739993 in GC_inner_start_routine (sb=3D, > arg=3D) at pthread_start.c:50 > #12 0x00007f236e7348d5 in GC_call_with_stack_base (fn=3D, > arg=3D) at misc.c:1535 > #13 0x00007f236e504cec in start_thread () > from /nix/store/vxycd107wjbhcj720hzkw2px7s7kr724-glibc-2.12.2/lib/libp= thread.so.0 > #14 0x00007f236d0111ed in clone () > from /nix/store/vxycd107wjbhcj720hzkw2px7s7kr724-glibc-2.12.2/lib/libc= .so.6 > > The problems seems to be that the after-gc-hook runs while the thread is > being created and not yet a full-blown Guile thread. Interesting. I'll see what I can do. A --=20 http://wingolog.org/ From unknown Sun Jun 22 07:56:24 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10655: [2.0.3+] =?UTF-8?Q?=E2=80=98queue=5Fafter=5Fgc=5Fhook=E2=80=99?= called during thread startup leads to SIGSEGV Resent-From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-guile@gnu.org Resent-Date: Mon, 30 Jan 2012 15:42:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10655 X-GNU-PR-Package: guile X-GNU-PR-Keywords: To: Andy Wingo Cc: 10655@debbugs.gnu.org Received: via spool by 10655-submit@debbugs.gnu.org id=B10655.132793809919789 (code B ref 10655); Mon, 30 Jan 2012 15:42:02 +0000 Received: (at 10655) by debbugs.gnu.org; 30 Jan 2012 15:41:39 +0000 Received: from localhost ([127.0.0.1]:45354 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RrtMQ-000598-Or for submit@debbugs.gnu.org; Mon, 30 Jan 2012 10:41:39 -0500 Received: from mail4-relais-sop.national.inria.fr ([192.134.164.105]:26519) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RrtMM-00058r-Sr for 10655@debbugs.gnu.org; Mon, 30 Jan 2012 10:41:37 -0500 X-IronPort-AV: E=Sophos;i="4.71,592,1320620400"; d="scan'208";a="129423635" Received: from unknown (HELO pluto) ([193.50.110.167]) by mail4-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-SHA; 30 Jan 2012 16:41:17 +0100 From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) References: <87y5spxlcg.fsf@gnu.org> <87mx95w6g9.fsf@pobox.com> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 11 =?UTF-8?Q?Pluvi=C3=B4se?= an 220 de la =?UTF-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0xEA52ECF4 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 83C4 F8E5 10A3 3B4C 5BEA D15D 77DD 95E2 EA52 ECF4 X-OS: x86_64-unknown-linux-gnu Date: Mon, 30 Jan 2012 16:41:17 +0100 In-Reply-To: <87mx95w6g9.fsf@pobox.com> (Andy Wingo's message of "Mon, 30 Jan 2012 16:33:42 +0100") Message-ID: <87ehuhxko2.fsf@gnu.org> User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.90 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -6.2 (------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.2 (------) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi! I=E2=80=99m testing this patch: --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff --git a/libguile/gc.c b/libguile/gc.c index 7816801..97dfcd8 100644 --- a/libguile/gc.c +++ b/libguile/gc.c @@ -730,14 +730,17 @@ queue_after_gc_hook (void * hook_data SCM_UNUSED, if (scm_debug_cells_gc_interval == 0) #endif { - scm_i_thread *t = SCM_I_CURRENT_THREAD; - - if (scm_is_false (SCM_CDR (after_gc_async_cell))) - { - SCM_SETCDR (after_gc_async_cell, t->active_asyncs); - t->active_asyncs = after_gc_async_cell; - t->pending_asyncs = 1; - } + if (SCM_I_CURRENT_THREAD != NULL && SCM_I_CURRENT_THREAD->guile_mode) + { + scm_i_thread *t = SCM_I_CURRENT_THREAD; + + if (scm_is_false (SCM_CDR (after_gc_async_cell))) + { + SCM_SETCDR (after_gc_async_cell, t->active_asyncs); + t->active_asyncs = after_gc_async_cell; + t->pending_asyncs = 1; + } + } } return NULL; --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Rationale: - With TLS, SCM_I_CURRENT_THREAD is never NULL but the whole struct, including =E2=80=98guile_mode=E2=80=99, is zero when the thread starts. - Without TLS, SCM_I_CURRENT_THREAD is NULL until =E2=80=98guilify_self_1= =E2=80=99 has been called. Thoughts? (My =E2=80=9Cbenchmark=E2=80=9D has been running for some time already and = the bug hasn=E2=80=99t shown up again.) Thanks, Ludo=E2=80=99. --=-=-=-- From unknown Sun Jun 22 07:56:24 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.428 (Entity 5.428) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Subject: bug#10655: closed (Re: bug#10655: [2.0.3+] =?UTF-8?Q?=E2=80=98queue=5Fafter=5Fgc=5Fhook=E2=80=99?= called during thread startup leads to SIGSEGV) Message-ID: References: <87hazd6kp9.fsf@gnu.org> <87y5spxlcg.fsf@gnu.org> X-Gnu-PR-Message: they-closed 10655 X-Gnu-PR-Package: guile Reply-To: 10655@debbugs.gnu.org Date: Mon, 30 Jan 2012 19:44:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1327952642-12765-1" This is a multi-part message in MIME format... ------------=_1327952642-12765-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #10655: [2.0.3+] =E2=80=98queue_after_gc_hook=E2=80=99 called during thread= startup leads to SIGSEGV which was filed against the guile package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 10655@debbugs.gnu.org. --=20 10655: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D10655 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1327952642-12765-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 10655-done) by debbugs.gnu.org; 30 Jan 2012 19:43:09 +0000 Received: from localhost ([127.0.0.1]:45627 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Rrx88-0003Ii-Gq for submit@debbugs.gnu.org; Mon, 30 Jan 2012 14:43:08 -0500 Received: from mail1-relais-roc.national.inria.fr ([192.134.164.82]:27128) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Rrx86-0003I9-9o for 10655-done@debbugs.gnu.org; Mon, 30 Jan 2012 14:43:07 -0500 X-IronPort-AV: E=Sophos;i="4.71,592,1320620400"; d="scan'208";a="142105365" Received: from reverse-83.fdn.fr (HELO pluto) ([80.67.176.83]) by mail1-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-SHA; 30 Jan 2012 20:42:48 +0100 From: ludo@gnu.org (Ludovic =?iso-8859-1?Q?Court=E8s?=) To: Andy Wingo Subject: Re: bug#10655: [2.0.3+] =?utf-8?Q?=E2=80=98queue=5Fafter=5Fgc=5Fh?= =?utf-8?Q?ook=E2=80=99?= called during thread startup leads to SIGSEGV References: <87y5spxlcg.fsf@gnu.org> <87mx95w6g9.fsf@pobox.com> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 11 =?iso-8859-1?Q?Pluvi=F4se?= an 220 de la =?iso-8859-1?Q?R=E9volution?= X-PGP-Key-ID: 0xEA52ECF4 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 83C4 F8E5 10A3 3B4C 5BEA D15D 77DD 95E2 EA52 ECF4 X-OS: x86_64-unknown-linux-gnu Date: Mon, 30 Jan 2012 20:42:42 +0100 In-Reply-To: <87mx95w6g9.fsf@pobox.com> (Andy Wingo's message of "Mon, 30 Jan 2012 16:33:42 +0100") Message-ID: <87hazd6kp9.fsf@gnu.org> User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -6.2 (------) X-Debbugs-Envelope-To: 10655-done Cc: 10655-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.2 (------) This was eventually fixed by commit e1fbe716e8596b7027af57623ebc72a0c6393187 (=E2=80=9Cfix hook invocation duri= ng thread guilification=E2=80=9D). Thanks! Ludo=E2=80=99. ------------=_1327952642-12765-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 30 Jan 2012 15:27:14 +0000 Received: from localhost ([127.0.0.1]:45319 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Rrt8T-0004m2-Ch for submit@debbugs.gnu.org; Mon, 30 Jan 2012 10:27:14 -0500 Received: from eggs.gnu.org ([140.186.70.92]:36908) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Rrt8Q-0004lp-LK for submit@debbugs.gnu.org; Mon, 30 Jan 2012 10:27:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rrt85-0003z0-Ah for submit@debbugs.gnu.org; Mon, 30 Jan 2012 10:26:55 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([140.186.70.17]:41109) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rrt85-0003yv-8f for submit@debbugs.gnu.org; Mon, 30 Jan 2012 10:26:49 -0500 Received: from eggs.gnu.org ([140.186.70.92]:55126) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rrt83-0000x5-V8 for bug-guile@gnu.org; Mon, 30 Jan 2012 10:26:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rrt7x-0003xA-NM for bug-guile@gnu.org; Mon, 30 Jan 2012 10:26:47 -0500 Received: from mail4-relais-sop.national.inria.fr ([192.134.164.105]:45970) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rrt7x-0003x3-9D for bug-guile@gnu.org; Mon, 30 Jan 2012 10:26:41 -0500 X-IronPort-AV: E=Sophos;i="4.71,592,1320620400"; d="scan'208";a="129421071" Received: from unknown (HELO pluto) ([193.50.110.167]) by mail4-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-SHA; 30 Jan 2012 16:26:39 +0100 From: ludo@gnu.org (Ludovic =?iso-8859-1?Q?Court=E8s?=) To: bug-guile@gnu.org Subject: [2.0.3+] =?utf-8?Q?=E2=80=98queue=5Fafter=5Fgc=5Fhook=E2=80=99?= called during thread startup leads to SIGSEGV X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 11 =?iso-8859-1?Q?Pluvi=F4se?= an 220 de la =?iso-8859-1?Q?R=E9volution?= X-PGP-Key-ID: 0xEA52ECF4 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 83C4 F8E5 10A3 3B4C 5BEA D15D 77DD 95E2 EA52 ECF4 X-OS: x86_64-unknown-linux-gnu Date: Mon, 30 Jan 2012 16:26:39 +0100 Message-ID: <87y5spxlcg.fsf@gnu.org> User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.17 X-Spam-Score: -4.2 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.2 (----) Hi! I=E2=80=99ve just captured the following backtrace on x86_64-linux-gnu (with v2.0.3-212-g2f3e436): --8<---------------cut here---------------start------------->8--- Core was generated by `/home/ludo/soft/bin/guile -e (@@ (guild) main) -s /h= ome/ludo/soft/bin/guile-too'.=20 Program terminated with signal 11, Segmentation fault. #0 queue_after_gc_hook (hook_data=3D, fn_data=3D, data=3D) at gc.c:737 737 SCM_SETCDR (after_gc_async_cell, t->active_asyncs); (gdb) thread apply all bt Thread 2 (Thread 27824): #0 0x00007f236e50b930 in sem_wait () from /nix/store/vxycd107wjbhcj720hzkw2px7s7kr724-glibc-2.12.2/lib/libpth= read.so.0 #1 0x00007f236e73abe8 in GC_pthread_create (new_thread=3D0x7fff1406fce8, a= ttr=3D0x0, start_routine=3D0x7f236ea5aa10 , arg=3D0x7fff1406fc60) at= pthread_support.c:1582 #2 0x00007f236ea5b71c in scm_spawn_thread (body=3D, body_data=3D, handler=3D0x7f236ea5da90 , handler_data=3D0x7f236ea9bb48) at threads.c:1125 #3 0x00007f236ea37f61 in start_signal_delivery_thread () at scmsigs.c:208 #4 0x00007f236e50ac83 in pthread_once () from /nix/store/vxycd107wjbhcj720hzkw2px7s7kr724-glibc-2.12.2/lib/libpth= read.so.0 #5 0x00007f236ea3814a in scm_sigaction_for_thread (signum=3D, handler=3D0x6, flags=3D0x904, thread=3D0x23bae40) at scmsigs.c:338 #6 0x00007f236ea39216 in scm_system_star (args=3D) at= simpos.c:133 #7 0x00007f236ea71e4b in vm_regular_engine (vm=3D0x2441740, program=3D0x24= cfa20, argv=3D0x24458c8, nargs=3D-1) at vm-i-system.c:892 #8 0x00007f236e9eb9b3 in scm_primitive_eval (exp=3D0x2a98340) at eval.c:639 #9 0x00007f236ea0deab in scm_primitive_load (filename=3D) at load.c:131 #10 0x00007f236ea0e316 in scm_primitive_load_path (args=3D) at load.c:954 #11 0x00007f236ea71e4b in vm_regular_engine (vm=3D0x2441740, program=3D0x29= bd820, argv=3D0x24452f0, nargs=3D-1) at vm-i-system.c:892 #12 0x00007f236ea0e4a8 in scm_primitive_load_path (args=3D) at load.c:913 #13 0x00007f236ea71e4b in vm_regular_engine (vm=3D0x2441740, program=3D0x29= afa20, argv=3D0x2445020, nargs=3D-1) at vm-i-system.c:892 #14 0x00007f236ea0e4a8 in scm_primitive_load_path (args=3D) at load.c:913 #15 0x00007f236ea71e4b in vm_regular_engine (vm=3D0x2441740, program=3D0x29= 955e0, argv=3D0x2444d50, nargs=3D-1) at vm-i-system.c:892 #16 0x00007f236ea0e4a8 in scm_primitive_load_path (args=3D) at load.c:913 #17 0x00007f236ea71e4b in vm_regular_engine (vm=3D0x2441740, program=3D0x24= cfa20, argv=3D0x2444a80, nargs=3D-1) at vm-i-system.c:892 #18 0x00007f236e9eb9b3 in scm_primitive_eval (exp=3D0x260e790) at eval.c:639 #19 0x00007f236e9eba13 in scm_eval (exp=3D0x260e790, module_or_state=3D0x25= f1d80) at eval.c:673 #20 0x00007f236ea390cf in scm_shell (argc=3D17, argv=3D0x7fff140712e8) at s= cript.c:441 #21 0x00007f236ea0814d in invoke_main_func (body_data=3D0x7fff140711d0) at = init.c:336 #22 0x00007f236e9e221a in c_body (d=3D0x7fff14071120) at continuations.c:512 #23 0x00007f236ea71eea in vm_regular_engine (vm=3D0x2441740, program=3D0x25= 2ea50, argv=3D0x24440c0, nargs=3D-1) at vm-i-system.c:960 #24 0x00007f236e9eb683 in scm_call_4 (proc=3D0x252ea50, arg1=3D, arg2=3D, arg3=3D, arg4=3D) at eval.c:506 #25 0x00007f236e9e2a03 in scm_i_with_continuation_barrier (body=3D0x7f236e9= e2210 , body_data=3D0x7fff14071120, handler=3D0x7f236e9e25e0 , handl= er_data=3D0x7fff14071120, pre_unwind_handler=3D, pre_unwind_handler_data=3D<= value optimized out>) at continuations.c:450 #26 0x00007f236e9e2ab5 in scm_c_with_continuation_barrier (func=3D, data=3D) at continuations.c:546 #27 0x00007f236ea5ae2a in with_guile_and_parent (base=3D0x7fff14071180, dat= a=3D) at threads.c:902 #28 0x00007f236e7348d5 in GC_call_with_stack_base (fn=3D, arg=3D) at misc.c:1535 #29 0x00007f236ea5afd8 in scm_i_with_guile_and_parent (func=3D, data=3D) at threads.c:945 #30 scm_with_guile (func=3D, data=3D) at threads.c:951 #31 0x00007f236ea08255 in scm_boot_guile (argc=3D, arg= v=3D, main_func=3D, closure=3D) at = init.c:319 #32 0x0000000000400b3a in main (argc=3D, argv=3D) at guile.c:71 Thread 1 (Thread 27825): #0 queue_after_gc_hook (hook_data=3D, fn_data=3D, data=3D) at gc.c:737 #1 0x00007f236ea0518c in scm_c_hook_run (hook=3D0x7f236ed00a10, data=3D0x0= ) at hooks.c:103 #2 0x00007f236e729951 in GC_notify_full_gc (stop_func=3D0x7f236e728e00 ) at alloc.c:334 #3 GC_try_to_collect_inner (stop_func=3D0x7f236e728e00 ) at alloc.c:429 #4 GC_try_to_collect_inner (stop_func=3D0x7f236e728e00 ) at alloc.c:410 #5 0x00007f236e72a65e in GC_collect_or_expand (needed_blocks=3D1, ignore_o= ff_page=3D0, retry=3D) at alloc.c:1215 #6 0x00007f236e72a7c6 in GC_allocobj (gran=3D42, kind=3D1) at alloc.c:1302 #7 0x00007f236e72f61a in GC_generic_malloc_inner (lb=3D664, k=3D1) at mall= oc.c:121 #8 0x00007f236e739aff in GC_new_thread (id=3D139790027667200) at pthread_s= upport.c:478 #9 0x00007f236e739fb7 in GC_register_my_thread_inner (sb=3D0x7f2366f12ed0, my_pthread=3D) at pthread_support.c:1358 #10 0x00007f236e73a167 in GC_start_rtn_prepare_thread (pstart=3D0x7f2366f12= eb0, pstart_arg=3D0x7f2366f12eb8, sb=3D0x7f2366f12ed0, arg=3D0x2aa1fc0) at p= thread_support.c:1449 #11 0x00007f236e739993 in GC_inner_start_routine (sb=3D, arg=3D) at pthread_start.c:50 #12 0x00007f236e7348d5 in GC_call_with_stack_base (fn=3D, arg=3D) at misc.c:1535 #13 0x00007f236e504cec in start_thread () from /nix/store/vxycd107wjbhcj720hzkw2px7s7kr724-glibc-2.12.2/lib/libpth= read.so.0 #14 0x00007f236d0111ed in clone () from /nix/store/vxycd107wjbhcj720hzkw2px7s7kr724-glibc-2.12.2/lib/libc.s= o.6 --8<---------------cut here---------------end--------------->8--- The problems seems to be that the after-gc-hook runs while the thread is being created and not yet a full-blown Guile thread. Thanks, Ludo=E2=80=99. ------------=_1327952642-12765-1--