From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 18 08:54:35 2021 Received: (at submit) by debbugs.gnu.org; 18 Oct 2021 12:54:35 +0000 Received: from localhost ([127.0.0.1]:46223 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mcS9z-00062j-7y for submit@debbugs.gnu.org; Mon, 18 Oct 2021 08:54:35 -0400 Received: from lists.gnu.org ([209.51.188.17]:56594) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mcS9n-00062S-VS for submit@debbugs.gnu.org; Mon, 18 Oct 2021 08:54:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38676) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mcS9n-0007CW-6s for bug-guile@gnu.org; Mon, 18 Oct 2021 08:54:23 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:38134) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mcS9l-00077Y-Cd for bug-guile@gnu.org; Mon, 18 Oct 2021 08:54:22 -0400 Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:53964 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mcS9l-0002qY-3V for bug-guile@gnu.org; Mon, 18 Oct 2021 08:54:21 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: bug-guile@gnu.org Subject: Calling =?utf-8?Q?=E2=80=98texi-fragment-=3Estexi=E2=80=99?= in parallel leads to crashes X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 27 =?utf-8?Q?Vend=C3=A9miaire?= an 230 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Mon, 18 Oct 2021 14:54:18 +0200 Message-ID: <87pms2a3yd.fsf@inria.fr> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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: -3.3 (---) --=-=-= Content-Type: text/plain Hello! 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.) Test case: --=-=-= Content-Type: text/plain Content-Disposition: inline; filename=bug-texi-parser-parallel.scm Content-Description: the test case (use-modules (guix) (gnu) (texinfo) (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 10 proc lst))) (for-each/maybe-parallel (lambda (package) (and=> (package-description package) (lambda (str) (catch 'parser-error (lambda () (texi-fragment->stexi str)) (lambda args (pk 'bah! args) (error "failed")))))) (fold-packages cons '())) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable This code crashes when using =E2=80=98n-par-for-each=E2=80=99 but passes wh= en run sequentially: --8<---------------cut here---------------start------------->8--- $ guix time-machine --commit=3D9cda21cf20a5c9bdf97e3a6d6c8f901fc3e4307d -- = repl -- bug-texi-parser-parallel.scm ;;; (sequential? #f) ;;; (bah! (parser-error #f "Unknown command" codeand)) In thread: failed ;;; (bah! (parser-error #f "Unknown command" endm)) In thread: failed ;;; (bah! (parser-error #f "Unknown command" cod)) In thread: failed ;;; (bah! (parser-error #f "Unknown command" comm)) In thread: failed ;;; (bah! (parser-error #f "Unknown command" enum)) In thread: failed ;;; (bah! (parser-error #f "Unknown command" cod)) In thread: failed ;;; (bah! (parser-error #f "Unknown command" enem)) In thread: failed ;;; (bah! (parser-error #f "Unknown command" endmand)) In thread: failed ;;;;; (bah! (parser-error #f "Unknown command" eomm)) In thread: failed $ SEQUENTIAL=3Dy guix time-machine --commit=3D9cda21cf20a5c9bdf97e3a6d6c8f9= 01fc3e4307d -- repl -- bug-texi-parser-parallel.scm ;;; (sequential? "y") $ guix repl -- <(echo '(pk (version))') ;;; ("3.0.7") --8<---------------cut here---------------end--------------->8--- The bits shown in the =E2=80=98parser-error=E2=80=99 arguments suggests mem= ory corruption. Ludo=E2=80=99. --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 18 11:51:10 2021 Received: (at control) by debbugs.gnu.org; 18 Oct 2021 15:51:11 +0000 Received: from localhost ([127.0.0.1]:48300 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mcUus-0006o5-PC for submit@debbugs.gnu.org; Mon, 18 Oct 2021 11:51:10 -0400 Received: from eggs.gnu.org ([209.51.188.92]:52230) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mcUup-0006nb-04 for control@debbugs.gnu.org; Mon, 18 Oct 2021 11:51:09 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:44730) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mcUuj-0004nY-NN for control@debbugs.gnu.org; Mon, 18 Oct 2021 11:51:01 -0400 Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:63937 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mcUuj-00014o-DW for control@debbugs.gnu.org; Mon, 18 Oct 2021 11:51:01 -0400 Date: Mon, 18 Oct 2021 17:50:58 +0200 Message-Id: <87o87m9vrx.fsf@gnu.org> To: control@debbugs.gnu.org From: =?utf-8?Q?Ludovic_Court=C3=A8s?= Subject: control message for bug #51264 MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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: -3.3 (---) severity 51264 important quit From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 22 07:56:34 2021 Received: (at 51264-done) by debbugs.gnu.org; 22 Oct 2021 11:56:34 +0000 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 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 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 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 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: 51264-done@debbugs.gnu.org Subject: Re: bug#51264: Calling =?utf-8?Q?=E2=80=98texi-fragment-=3Estexi?= =?utf-8?Q?=E2=80=99?= in parallel leads to crashes References: <87pms2a3yd.fsf@inria.fr> Date: Fri, 22 Oct 2021 13:56:22 +0200 In-Reply-To: <87pms2a3yd.fsf@inria.fr> ("Ludovic =?utf-8?Q?Court=C3=A8s=22?= =?utf-8?Q?'s?= message of "Mon, 18 Oct 2021 14:54:18 +0200") Message-ID: <87v91ptgrd.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 51264-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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: -3.3 (---) --=-=-= 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. --=-=-=-- From unknown Thu Jun 19 14:32:43 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 19 Nov 2021 12:24:06 +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