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

Full log


View this message in rfc822 format

From: Amirouche Boubekki <amirouche <at> hypermove.net>
To: 33229 <at> debbugs.gnu.org
Subject: bug#33229: 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 226 days ago.

Previous Next


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