GNU bug report logs - #33229
n-for-each-par-map crash guile 2.2.4

Previous Next

Package: guile;

Reported by: Amirouche Boubekki <amirouche <at> hypermove.net>

Date: Thu, 1 Nov 2018 18:23:02 UTC

Severity: normal

To reply to this bug, email your comments to 33229 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guile <at> gnu.org:
bug#33229; Package guile. (Thu, 01 Nov 2018 18:23:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Amirouche Boubekki <amirouche <at> hypermove.net>:
New bug report received and forwarded. Copy sent to bug-guile <at> gnu.org. (Thu, 01 Nov 2018 18:23:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Amirouche Boubekki <amirouche <at> hypermove.net>
To: bug-guile <at> gnu.org
Subject: n-for-each-par-map crash guile 2.2.4
Date: Thu, 01 Nov 2018 19:21:33 +0100
[Message part 1 (text/plain, inline)]
On my machine with 4 procs the following program crash after a while:


(define-module (hn))

(use-modules (srfi srfi-1))
(use-modules (ice-9 receive))
(use-modules (ice-9 threads))
(use-modules (ice-9 iconv))
(use-modules (web client))
(use-modules (json))


(define (max-id)
  (receive (response body) (http-get 
"https://hacker-news.firebaseio.com/v0/maxitem.json")
           (string->number (bytevector->string body "utf-8"))))

(define (download uid)
  (catch #t
         (lambda ()
           (let* ((uid (1+ uid))
                  (url 
"https://hacker-news.firebaseio.com/v0/item/~a.json")
             (url (format #f url uid)))
        (cons uid
              (json-string->scm
               (call-with-values (lambda () (http-get url))
                 (lambda (response body)
                   (bytevector->string body "utf-8")))))))
    (lambda _ '())))

(define (store pair)
  (if (null? pair)
      (format #t "X\n")
      (let ((port (open-file "hn.scm" "a")))
        (format #t "~a\n" (car pair))
        (write (cdr pair) port)
        (close port))))

(define (dump)
  (n-for-each-par-map 32 store download (reverse (iota (max-id)))))

(dump)


I attached to the program with its dependency json.scm.

Mark asked for this report at 
https://lists.gnu.org/archive/html/guile-devel/2018-07/msg00017.html

I will try guile 3.0 and report back.
[main.scm (application/x-elc, attachment)]
[json.scm (text/plain, attachment)]

This bug report was last modified 6 years and 225 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.