GNU bug report logs - #24357
pure guile program leaks memory

Previous Next

Package: guile;

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

Date: Sat, 3 Sep 2016 07:21:02 UTC

Severity: normal

Done: Andy Wingo <wingo <at> pobox.com>

Bug is archived. No further changes may be made.

Full log


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

From: Amirouche Boubekki <amirouche <at> hypermove.net>
To: Andy Wingo <wingo <at> pobox.com>
Cc: 24357 <at> debbugs.gnu.org
Subject: Re: bug#24357: pure guile program leaks memory
Date: Sat, 03 Sep 2016 20:49:41 +0200
[Message part 1 (text/plain, inline)]
On 2016-09-03 11:54, Andy Wingo wrote:
> On Sat 03 Sep 2016 09:20, Amirouche Boubekki <amirouche <at> hypermove.net> 
> writes:
> 
>> Using guile 2.1.3, I have a program that:
>> 
>> - reads urls from a text file
>> - download the urls using curl command via popen
>> - output the result to stdout
>> 
>> Also, it relies on n-for-each-par-map for ice-9 threads.
> 
> Can you reduce it please?  For example, remove the use of threads.
> 

Ok. I removed threads and only download the same url over and over 
again.

Here is the error I get on stdout:

   (23) Failed writing body

The program is:

(use-modules (ice-9 popen))


;;; wrapping curl command

(define (curl url)
  (let* ((port (open-input-pipe (format #f "curl -is \"~a\"" url)))
         (response (read-string port)))
    (close-pipe port)
    response))


(define (maybe-curl url)
  (catch #t
    (lambda ()
      (display "." (current-error-port))
      (write (cons url (curl url))))
    (lambda _ '())))

(define urls (map (lambda _ "http://hyperdev.fr/") (iota 1000)))

(display "started")

(for-each maybe-curl urls)
[guile-bug-24357.scm (text/plain, attachment)]

This bug report was last modified 8 years and 142 days ago.

Previous Next


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