From: "Ludovic Courtès" <ludo@gnu.org>
To: 51264@debbugs.gnu.org
Subject: bug#51264: Calling ‘texi-fragment->stexi’ in parallel leads to crashes
Date: Mon, 18 Oct 2021 14:54:18 +0200 [thread overview]
Message-ID: <87pms2a3yd.fsf@inria.fr> (raw)
[-- Attachment #1: Type: text/plain, Size: 154 bytes --]
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:
[-- Attachment #2: the test case --]
[-- Type: text/plain, Size: 588 bytes --]
(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 '()))
[-- Attachment #3: Type: text/plain, Size: 1342 bytes --]
This code crashes when using ‘n-par-for-each’ but passes when run
sequentially:
--8<---------------cut here---------------start------------->8---
$ guix time-machine --commit=9cda21cf20a5c9bdf97e3a6d6c8f901fc3e4307d -- 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=y guix time-machine --commit=9cda21cf20a5c9bdf97e3a6d6c8f901fc3e4307d -- 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 ‘parser-error’ arguments suggests memory
corruption.
Ludo’.
next reply other threads:[~2021-10-18 12:54 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-18 12:54 Ludovic Courtès [this message]
2021-10-22 11:56 ` bug#51264: Calling ‘texi-fragment->stexi’ in parallel leads to crashes Ludovic Courtès
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=87pms2a3yd.fsf@inria.fr \
--to=ludo@gnu.org \
--cc=51264@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).