From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Amirouche Boubekki Newsgroups: gmane.lisp.guile.bugs Subject: bug#24357: pure guile program leaks memory Date: Sat, 03 Sep 2016 20:49:41 +0200 Message-ID: <720a442d3c0733ce6ddcb8f0e80a921a@hypermove.net> References: <891b344e747119b497e1d0a17b62b81b@hypermove.net> <87d1kli9zh.fsf@pobox.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=_508a2b20f016be65a5503180d0371867" X-Trace: blaine.gmane.org 1472928630 22373 195.159.176.226 (3 Sep 2016 18:50:30 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 3 Sep 2016 18:50:30 +0000 (UTC) User-Agent: Roundcube Webmail/1.1.2 Cc: 24357@debbugs.gnu.org To: Andy Wingo Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Sat Sep 03 20:50:26 2016 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bgG19-0004Bx-Mn for guile-bugs@m.gmane.org; Sat, 03 Sep 2016 20:50:15 +0200 Original-Received: from localhost ([::1]:47436 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bgG17-0000Zd-Gc for guile-bugs@m.gmane.org; Sat, 03 Sep 2016 14:50:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40028) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bgG10-0000Xl-2t for bug-guile@gnu.org; Sat, 03 Sep 2016 14:50:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bgG0v-0002n0-VR for bug-guile@gnu.org; Sat, 03 Sep 2016 14:50:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:51241) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bgG0v-0002mw-S9 for bug-guile@gnu.org; Sat, 03 Sep 2016 14:50:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bgG0v-0000mo-Ku for bug-guile@gnu.org; Sat, 03 Sep 2016 14:50:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Amirouche Boubekki Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Sat, 03 Sep 2016 18:50:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24357 X-GNU-PR-Package: guile X-GNU-PR-Keywords: Original-Received: via spool by 24357-submit@debbugs.gnu.org id=B24357.14729285872999 (code B ref 24357); Sat, 03 Sep 2016 18:50:01 +0000 Original-Received: (at 24357) by debbugs.gnu.org; 3 Sep 2016 18:49:47 +0000 Original-Received: from localhost ([127.0.0.1]:48953 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bgG0h-0000mJ-KR for submit@debbugs.gnu.org; Sat, 03 Sep 2016 14:49:47 -0400 Original-Received: from relay2-d.mail.gandi.net ([217.70.183.194]:37775) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bgG0f-0000mA-Tv for 24357@debbugs.gnu.org; Sat, 03 Sep 2016 14:49:46 -0400 Original-Received: from mfilter18-d.gandi.net (mfilter18-d.gandi.net [217.70.178.146]) by relay2-d.mail.gandi.net (Postfix) with ESMTP id A04E3C5A49; Sat, 3 Sep 2016 20:49:43 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mfilter18-d.gandi.net Original-Received: from relay2-d.mail.gandi.net ([IPv6:::ffff:217.70.183.194]) by mfilter18-d.gandi.net (mfilter18-d.gandi.net [::ffff:10.0.15.180]) (amavisd-new, port 10024) with ESMTP id TiFrRcFWBra3; Sat, 3 Sep 2016 20:49:42 +0200 (CEST) X-Originating-IP: 10.58.1.143 Original-Received: from webmail.gandi.net (webmail3-d.mgt.gandi.net [10.58.1.143]) (Authenticated sender: amirouche@hypermove.net) by relay2-d.mail.gandi.net (Postfix) with ESMTPA id EB9F2C5A4F; Sat, 3 Sep 2016 20:49:41 +0200 (CEST) In-Reply-To: <87d1kli9zh.fsf@pobox.com> X-Sender: amirouche@hypermove.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: "bug-guile" Xref: news.gmane.org gmane.lisp.guile.bugs:8402 Archived-At: --=_508a2b20f016be65a5503180d0371867 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed On 2016-09-03 11:54, Andy Wingo wrote: > On Sat 03 Sep 2016 09:20, Amirouche Boubekki > 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) --=_508a2b20f016be65a5503180d0371867 Content-Transfer-Encoding: base64 Content-Type: text/plain; name=guile-bug-24357.scm Content-Disposition: attachment; filename=guile-bug-24357.scm; size=489 KHVzZS1tb2R1bGVzIChpY2UtOSBwb3BlbikpCgoKOzs7IHdyYXBwaW5nIGN1cmwgY29tbWFuZAoK KGRlZmluZSAoY3VybCB1cmwpCiAgKGxldCogKChwb3J0IChvcGVuLWlucHV0LXBpcGUgKGZvcm1h dCAjZiAiY3VybCAtaXMgXCJ+YVwiIiB1cmwpKSkKICAgICAgICAgKHJlc3BvbnNlIChyZWFkLXN0 cmluZyBwb3J0KSkpCiAgICAoY2xvc2UtcGlwZSBwb3J0KQogICAgcmVzcG9uc2UpKQoKCihkZWZp bmUgKG1heWJlLWN1cmwgdXJsKQogIChjYXRjaCAjdAogICAgKGxhbWJkYSAoKQogICAgICAoZGlz cGxheSAiLiIgKGN1cnJlbnQtZXJyb3ItcG9ydCkpCiAgICAgICh3cml0ZSAoY29ucyB1cmwgKGN1 cmwgdXJsKSkpKQogICAgKGxhbWJkYSBfICcoKSkpKQoKKGRlZmluZSB1cmxzIChtYXAgKGxhbWJk YSBfICJodHRwOi8vaHlwZXJkZXYuZnIvIikgKGlvdGEgMTAwMCkpKQoKKGRpc3BsYXkgInN0YXJ0 ZWQiKQoKKGZvci1lYWNoIG1heWJlLWN1cmwgdXJscykK --=_508a2b20f016be65a5503180d0371867--