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 09:20:36 +0200 Message-ID: <891b344e747119b497e1d0a17b62b81b@hypermove.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=_809bb6b0cdfb2305df45b7e3b9837a08" X-Trace: blaine.gmane.org 1472887286 23402 195.159.176.226 (3 Sep 2016 07:21:26 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 3 Sep 2016 07:21:26 +0000 (UTC) User-Agent: Roundcube Webmail/1.1.2 To: 24357@debbugs.gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Sat Sep 03 09:21:21 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 1bg5GO-000525-44 for guile-bugs@m.gmane.org; Sat, 03 Sep 2016 09:21:16 +0200 Original-Received: from localhost ([::1]:45251 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bg5GL-00007i-ID for guile-bugs@m.gmane.org; Sat, 03 Sep 2016 03:21:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38763) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bg5GE-00007J-U7 for bug-guile@gnu.org; Sat, 03 Sep 2016 03:21:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bg5GA-0006dX-Nb for bug-guile@gnu.org; Sat, 03 Sep 2016 03:21:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:50516) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bg5GA-0006dT-Ki for bug-guile@gnu.org; Sat, 03 Sep 2016 03:21:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bg5GA-0001W9-H6 for bug-guile@gnu.org; Sat, 03 Sep 2016 03:21:02 -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 07:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 24357 X-GNU-PR-Package: guile X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-guile@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.14728872535798 (code B ref -1); Sat, 03 Sep 2016 07:21:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 3 Sep 2016 07:20:53 +0000 Original-Received: from localhost ([127.0.0.1]:48228 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bg5G1-0001VS-JQ for submit@debbugs.gnu.org; Sat, 03 Sep 2016 03:20:53 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:47773) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bg5G1-0001VE-0A for submit@debbugs.gnu.org; Sat, 03 Sep 2016 03:20:53 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bg5Fu-0006bo-NE for submit@debbugs.gnu.org; Sat, 03 Sep 2016 03:20:47 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:54988) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bg5Fu-0006bj-Ju for submit@debbugs.gnu.org; Sat, 03 Sep 2016 03:20:46 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38736) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bg5Fs-0008Vp-7f for bug-guile@gnu.org; Sat, 03 Sep 2016 03:20:45 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bg5Fo-0006bB-2X for bug-guile@gnu.org; Sat, 03 Sep 2016 03:20:43 -0400 Original-Received: from relay6-d.mail.gandi.net ([2001:4b98:c:538::198]:52973) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bg5Fn-0006b4-RP for bug-guile@gnu.org; Sat, 03 Sep 2016 03:20:39 -0400 Original-Received: from mfilter20-d.gandi.net (mfilter20-d.gandi.net [217.70.178.148]) by relay6-d.mail.gandi.net (Postfix) with ESMTP id 038E7FB887 for ; Sat, 3 Sep 2016 09:20:38 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mfilter20-d.gandi.net Original-Received: from relay6-d.mail.gandi.net ([IPv6:::ffff:217.70.183.198]) by mfilter20-d.gandi.net (mfilter20-d.gandi.net [::ffff:10.0.15.180]) (amavisd-new, port 10024) with ESMTP id tlXUVzG6K-nK for ; Sat, 3 Sep 2016 09:20:36 +0200 (CEST) X-Originating-IP: 10.58.1.148 Original-Received: from webmail.gandi.net (webmail8-d.mgt.gandi.net [10.58.1.148]) (Authenticated sender: amirouche@hypermove.net) by relay6-d.mail.gandi.net (Postfix) with ESMTPA id 74A03FB89E for ; Sat, 3 Sep 2016 09:20:36 +0200 (CEST) X-Sender: amirouche@hypermove.net X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x 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:8399 Archived-At: --=_809bb6b0cdfb2305df45b7e3b9837a08 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed 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. IMO, the most suspicious is the definition of the `curl' proc: (define (curl url) (let* ((port (open-input-pipe (format #f "curl -is \"~a\"" url))) (response (read-string port))) (close-pipe port) response)) I fail to see how this can leak. To reproduce the bug you need a giant list of preferably different urls. Such a list is available at http://hyperdev.fr/data/hn/hn.urls.txt.xz You can run the test program with the following command: cat hn.urls.txt | guile urls-step00-fetch.scm > /dev/null This is not the only program I tried on guile-2.1.3 that leaks but it's the easiest to reproduce. I will try to reproduce the bug on 2.0.12. --=_809bb6b0cdfb2305df45b7e3b9837a08 Content-Transfer-Encoding: base64 Content-Type: text/plain; name=urls-step00-fetch.scm Content-Disposition: attachment; filename=urls-step00-fetch.scm; size=652 KHVzZS1tb2R1bGVzIChpY2UtOSB0aHJlYWRzKSkKKHVzZS1tb2R1bGVzIChpY2UtOSByZGVsaW0p KQoodXNlLW1vZHVsZXMgKGljZS05IHBvcGVuKSkKKHVzZS1tb2R1bGVzIChpY2UtOSByZGVsaW0p KQoKCjs7OyB3cmFwcGluZyBjdXJsIGNvbW1hbmQKCihkZWZpbmUgKGN1cmwgdXJsKQogIChsZXQq ICgocG9ydCAob3Blbi1pbnB1dC1waXBlIChmb3JtYXQgI2YgImN1cmwgLWlzIFwifmFcIiIgdXJs KSkpCiAgICAgICAgIChyZXNwb25zZSAocmVhZC1zdHJpbmcgcG9ydCkpKQogICAgKGNsb3NlLXBp cGUgcG9ydCkKICAgIHJlc3BvbnNlKSkKCgooZGVmaW5lIChtYXliZS1jdXJsIHVybCkKICAoY2F0 Y2ggI3QKICAgIChsYW1iZGEgKCkgKGNvbnMgdXJsIChjdXJsIHVybCkpKQogICAgKGxhbWJkYSBf ICcoKSkpKQoKCihkZWZpbmUgdXJscyAobGV0IGxvb3AgKChsaW5lIChyZWFkLWxpbmUpKQogICAg ICAgICAgICAgICAgICAgICAgICAob3V0ICcoKSkpCiAgICAgICAgICAgICAgIChpZiAoZW9mLW9i amVjdD8gbGluZSkKICAgICAgICAgICAgICAgICAgIG91dAogICAgICAgICAgICAgICAgICAgKGxv b3AgKHJlYWQtbGluZSkgKGNvbnMgbGluZSBvdXQpKSkpKQoKKG4tZm9yLWVhY2gtcGFyLW1hcCAx NiB3cml0ZSBtYXliZS1jdXJsIHVybHMpCg== --=_809bb6b0cdfb2305df45b7e3b9837a08--