From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Newsgroups: gmane.lisp.guile.bugs 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 Date: Mon, 30 Jan 2012 16:41:17 +0100 Message-ID: <87ehuhxko2.fsf@gnu.org> References: <87y5spxlcg.fsf@gnu.org> <87mx95w6g9.fsf@pobox.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: dough.gmane.org 1327938128 7279 80.91.229.3 (30 Jan 2012 15:42:08 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 30 Jan 2012 15:42:08 +0000 (UTC) Cc: 10655@debbugs.gnu.org To: Andy Wingo Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Mon Jan 30 16:42:06 2012 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RrtMo-0007Wv-Ap for guile-bugs@m.gmane.org; Mon, 30 Jan 2012 16:42:02 +0100 Original-Received: from localhost ([::1]:43846 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RrtMn-00050A-Hl for guile-bugs@m.gmane.org; Mon, 30 Jan 2012 10:42:01 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:44451) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RrtMk-0004zp-MR for bug-guile@gnu.org; Mon, 30 Jan 2012 10:41:59 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RrtMf-0006U6-0l for bug-guile@gnu.org; Mon, 30 Jan 2012 10:41:58 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:41731) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RrtMe-0006U2-VU for bug-guile@gnu.org; Mon, 30 Jan 2012 10:41:52 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1RrtMo-00059m-O8 for bug-guile@gnu.org; Mon, 30 Jan 2012 10:42:02 -0500 X-Loop: help-debbugs@gnu.org 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: Original-Received: via spool by 10655-submit@debbugs.gnu.org id=B10655.132793809919789 (code B ref 10655); Mon, 30 Jan 2012 15:42:02 +0000 Original-Received: (at 10655) by debbugs.gnu.org; 30 Jan 2012 15:41:39 +0000 Original-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 Original-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" Original-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 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 In-Reply-To: <87mx95w6g9.fsf@pobox.com> (Andy Wingo's message of "Mon, 30 Jan 2012 16:33:42 +0100") User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.90 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:6115 Archived-At: --=-=-= 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. --=-=-=--