bug-guile
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#14404: regexp_exec thread-unsafe


From: Ludovic Courtès
Subject: bug#14404: regexp_exec thread-unsafe
Date: Wed, 15 May 2013 09:34:03 +0200
User-agent: Gnus/5.130005 (Ma Gnus v0.5) Emacs/24.3 (gnu/linux)

And here’s a reduced test case that “works” quite well on Guile 2.0.9:

--8<---------------cut here---------------start------------->8---
(use-modules (ice-9 threads)
             (ice-9 regex)
             (web uri)
             (srfi srfi-1)
             (srfi srfi-26))

(let ((do-regexps (lambda ()
                    (define seed1 (random 100000))
                    (define seed2 (random 100000))
                    (let loop ()
                      (let ((p (make-regexp "^http://([^/]+)/(.*)$"))
                            (s (string-append
                                "http://"; (number->string seed1)
                                
"hydra.gnu.org/nar/0did57blsaaspj49cl3q8nnydm5pr1qg-cflow-1.4"
                                (number->string seed2))))
                        (or (uri? (string->uri s))
                            (exit 42))
                        (regexp-exec p s)
                        (loop))))))
  (unfold (cute >= <> (current-processor-count))
          (lambda (i)
            (call-with-new-thread do-regexps))
          1+
          0)
  (do-regexps))
--8<---------------cut here---------------end--------------->8---

Ludo’.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]