From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Newsgroups: gmane.lisp.guile.bugs Subject: bug#29151: [PATCH] ia64: fix crash in thread context switch Date: Wed, 22 Nov 2017 16:16:17 +0100 Message-ID: <87tvxmxs1q.fsf@gnu.org> References: <20171105093045.10066-1-slyfox@gentoo.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1511363841 13989 195.159.176.226 (22 Nov 2017 15:17:21 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 22 Nov 2017 15:17:21 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) Cc: 29151-done@debbugs.gnu.org To: Sergei Trofimovich Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Wed Nov 22 16:17:14 2017 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eHWlx-0002z2-Sy for guile-bugs@m.gmane.org; Wed, 22 Nov 2017 16:17:10 +0100 Original-Received: from localhost ([::1]:40013 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eHWm4-00056W-Va for guile-bugs@m.gmane.org; Wed, 22 Nov 2017 10:17:16 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54737) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eHWlw-00053x-3g for bug-guile@gnu.org; Wed, 22 Nov 2017 10:17:09 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eHWlr-0002ac-2U for bug-guile@gnu.org; Wed, 22 Nov 2017 10:17:08 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:44171) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eHWlq-0002aT-Uk for bug-guile@gnu.org; Wed, 22 Nov 2017 10:17:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eHWlq-00076a-O4 for bug-guile@gnu.org; Wed, 22 Nov 2017 10:17:02 -0500 Resent-From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Original-Sender: "Debbugs-submit" Resent-To: bug-guile@gnu.org Resent-Date: Wed, 22 Nov 2017 15:17:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 29151 X-GNU-PR-Package: guile X-GNU-PR-Keywords: patch Mail-Followup-To: 29151@debbugs.gnu.org, ludo@gnu.org, slyfox@gentoo.org Original-Received: via spool by 29151-done@debbugs.gnu.org id=D29151.151136378027235 (code D ref 29151); Wed, 22 Nov 2017 15:17:01 +0000 Original-Received: (at 29151-done) by debbugs.gnu.org; 22 Nov 2017 15:16:20 +0000 Original-Received: from localhost ([127.0.0.1]:52851 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eHWlA-00075D-FO for submit@debbugs.gnu.org; Wed, 22 Nov 2017 10:16:20 -0500 Original-Received: from hera.aquilenet.fr ([141.255.128.1]:60569) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eHWl8-000755-Pc for 29151-done@debbugs.gnu.org; Wed, 22 Nov 2017 10:16:19 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id B06FBFF1C; Wed, 22 Nov 2017 16:16:20 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Original-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 4WDemW3f7nZK; Wed, 22 Nov 2017 16:16:20 +0100 (CET) Original-Received: from ribbon (unknown [IPv6:2a01:e0a:1d:7270:af76:b9b:ca24:c465]) by hera.aquilenet.fr (Postfix) with ESMTPSA id F0D06FE3C; Wed, 22 Nov 2017 16:16:19 +0100 (CET) In-Reply-To: <20171105093045.10066-1-slyfox@gentoo.org> (Sergei Trofimovich's message of "Sun, 5 Nov 2017 09:30:45 +0000") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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" Xref: news.gmane.org gmane.lisp.guile.bugs:8897 Archived-At: Hi Sergei, Sergei Trofimovich skribis: > Backtrace looks like that: > > Program terminated with signal SIGSEGV, Segmentation fault. > #0 0x200000000014a5c0 in scm_ia64_longjmp (JB=3D0x6000000000817020, VA= L=3D1) at continuations.c:372 > 372 t->pending_rbs_continuation->backing_store, > [Current thread is 1 (Thread 0x2000000000049340 (LWP 8190))] > (gdb) bt > #0 0x200000000014a5c0 in scm_ia64_longjmp (JB=3D0x6000000000817020, VA= L=3D1) at continuations.c:372 > #1 0x2000000000148e00 in scm_c_abort (vm=3D0x60000000000edea0, tag=3D0= x6000000000795ba0, n=3D0, argv=3D0x60000fffff7f0ce0, cookie=3D-1) at contro= l.c:239 > #2 0x2000000000149070 in scm_at_abort (tag=3D0x6000000000795ba0, args= =3D0x304) at control.c:258 > (gdb) print t > $2 =3D (scm_i_thread *) 0x6000000000068000 > (gdb) print t->pending_rbs_continuation > $3 =3D (scm_t_contregs *) 0xffeb > > The problem here is the value of 't->pending_rbs_continuation' pointer. > It's supposed to poin to a register stack pointer or be NULL if not yet > backed up. > > The problem is it is never initialized to NULL at creation time and > contained garbage on stack. Sometimes people are lucky and have zeros > on stack and guile works. But sometimes there is something and guile > crashes. > > The fix is trivial: initialize 'pending_rbs_continuation =3D NULL' > at thread registration time (the same way other threads are registered). > > Reported-by: Matt Turner > Bug: https://bugs.gentoo.org/613986 > > * libguile/threads.c(guilify_self_1): initialize pending_rbs_continuation > to avoid guile crash on ia64. I=E2=80=99ve applied the patch to the =E2=80=98stable-2.2=E2=80=99 branch, = thank you, and thanks to Jason for testing! Ludo=E2=80=99.