unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: 51264-done@debbugs.gnu.org
Subject: bug#51264: Calling ‘texi-fragment->stexi’ in parallel leads to crashes
Date: Fri, 22 Oct 2021 13:56:22 +0200	[thread overview]
Message-ID: <87v91ptgrd.fsf@gnu.org> (raw)
In-Reply-To: <87pms2a3yd.fsf@inria.fr> ("Ludovic Courtès"'s message of "Mon, 18 Oct 2021 14:54:18 +0200")

[-- Attachment #1: Type: text/plain, Size: 222 bytes --]

Ludovic Courtès <ludo@gnu.org> 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’s a standalone reproducer:


[-- Attachment #2: the reproducer --]
[-- Type: text/plain, Size: 563 bytes --]

(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}."))

[-- Attachment #3: Type: text/plain, Size: 245 bytes --]


It turned out that (sxml ssax input-parse) would reuse the same global
buffer for each call to ‘next-token’ and ‘next-token-of’ (the Texinfo
parser uses the latter).

Fixed in 3b42b1eb526a85e4fac772e1837046e56e3b9bdc.

Ludo’.

  reply	other threads:[~2021-10-22 11:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-18 12:54 bug#51264: Calling ‘texi-fragment->stexi’ in parallel leads to crashes Ludovic Courtès
2021-10-22 11:56 ` Ludovic Courtès [this message]
2021-11-01 17:52 ` bug#39601: srfi library naming in r7rs lloda
2021-11-01 18:42   ` Taylan Kammer
2021-11-02 17:53     ` lloda
2021-11-03  7:37     ` Linus Björnstam

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87v91ptgrd.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=51264-done@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).