From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Newsgroups: gmane.lisp.guile.bugs Subject: bug#51264: Calling =?UTF-8?Q?=E2=80=98texi-fragment->stexi=E2=80=99?= in parallel leads to crashes Date: Fri, 22 Oct 2021 13:56:22 +0200 Message-ID: <87v91ptgrd.fsf@gnu.org> References: <87pms2a3yd.fsf@inria.fr> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32054"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) To: 51264-done@debbugs.gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Fri Oct 22 13:58:31 2021 Return-path: Envelope-to: guile-bugs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mdtBv-00087k-Am for guile-bugs@m.gmane-mx.org; Fri, 22 Oct 2021 13:58:31 +0200 Original-Received: from localhost ([::1]:34124 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mdtBt-0000gK-Ps for guile-bugs@m.gmane-mx.org; Fri, 22 Oct 2021 07:58:29 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36532) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mdtAU-0007q9-QP for bug-guile@gnu.org; Fri, 22 Oct 2021 07:57:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48051) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mdtAU-0002TG-IG for bug-guile@gnu.org; Fri, 22 Oct 2021 07:57:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mdtAU-0001l3-Fo for bug-guile@gnu.org; Fri, 22 Oct 2021 07:57:02 -0400 Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-To: bug-guile@gnu.org Resent-Date: Fri, 22 Oct 2021 11:57:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 51264 X-GNU-PR-Package: guile Mail-Followup-To: 51264@debbugs.gnu.org, ludo@gnu.org, ludo@gnu.org Original-Received: via spool by 51264-done@debbugs.gnu.org id=D51264.16349037946705 (code D ref 51264); Fri, 22 Oct 2021 11:57:02 +0000 Original-Received: (at 51264-done) by debbugs.gnu.org; 22 Oct 2021 11:56:34 +0000 Original-Received: from localhost ([127.0.0.1]:59596 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mdtA1-0001k5-Vm for submit@debbugs.gnu.org; Fri, 22 Oct 2021 07:56:34 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:39058) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mdt9z-0001jq-KP for 51264-done@debbugs.gnu.org; Fri, 22 Oct 2021 07:56:32 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:36590) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mdt9u-0002Bc-8l for 51264-done@debbugs.gnu.org; Fri, 22 Oct 2021 07:56:26 -0400 Original-Received: from [193.50.110.110] (port=53676 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mdt9s-0004gm-MF for 51264-done@debbugs.gnu.org; Fri, 22 Oct 2021 07:56:26 -0400 In-Reply-To: <87pms2a3yd.fsf@inria.fr> ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s message of "Mon, 18 Oct 2021 14:54:18 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-guile" Xref: news.gmane.io gmane.lisp.guile.bugs:10197 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Ludovic Court=C3=A8s skribis: > I just stumbled upon this bug (here I use Guix to feed Texinfo strings > but I suppose we could reduce the test case to be Guix-less.) Here=E2=80=99s a standalone reproducer: --=-=-= Content-Type: text/plain Content-Disposition: inline; filename=bug-texi-parser-parallel.raw.scm Content-Description: the reproducer (use-modules (texinfo) (sxml simple) (ice-9 threads)) (define sequential? (getenv "SEQUENTIAL")) (define (for-each/maybe-parallel proc lst) (if (pk 'sequential? sequential?) (for-each proc lst) (n-par-for-each 6 proc lst))) (setvbuf (current-output-port) 'none) (for-each/maybe-parallel (lambda (str) (catch 'parser-error (lambda () (texi-fragment->stexi str)) (lambda args (pk 'bah! args '<<>> str) (error "failed")))) (make-list 5000 "Hello @code{world}, this is @emph{Texinfo}.")) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable It turned out that (sxml ssax input-parse) would reuse the same global buffer for each call to =E2=80=98next-token=E2=80=99 and =E2=80=98next-toke= n-of=E2=80=99 (the Texinfo parser uses the latter). Fixed in 3b42b1eb526a85e4fac772e1837046e56e3b9bdc. Ludo=E2=80=99. --=-=-=--