From unknown Sun Aug 17 01:00:54 2025 X-Loop: help-debbugs@gnu.org Subject: bug#24357: pure guile program leaks memory 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: To: 24357@debbugs.gnu.org X-Debbugs-Original-To: bug-guile@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.14728872535798 (code B ref -1); Sat, 03 Sep 2016 07:21:02 +0000 Received: (at submit) by debbugs.gnu.org; 3 Sep 2016 07:20:53 +0000 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 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 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 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_40 autolearn=disabled version=3.3.2 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 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 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 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 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 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 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) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=_809bb6b0cdfb2305df45b7e3b9837a08" Date: Sat, 03 Sep 2016 09:20:36 +0200 From: Amirouche Boubekki Message-ID: <891b344e747119b497e1d0a17b62b81b@hypermove.net> X-Sender: amirouche@hypermove.net User-Agent: Roundcube Webmail/1.1.2 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-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) --=_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-- From unknown Sun Aug 17 01:00:54 2025 X-Loop: help-debbugs@gnu.org Subject: bug#24357: pure guile program leaks memory Resent-From: Andy Wingo Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Sat, 03 Sep 2016 09:56:02 +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: To: Amirouche Boubekki Cc: 24357@debbugs.gnu.org Received: via spool by 24357-submit@debbugs.gnu.org id=B24357.147289650919702 (code B ref 24357); Sat, 03 Sep 2016 09:56:02 +0000 Received: (at 24357) by debbugs.gnu.org; 3 Sep 2016 09:55:09 +0000 Received: from localhost ([127.0.0.1]:48256 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bg7fI-00057i-OM for submit@debbugs.gnu.org; Sat, 03 Sep 2016 05:55:08 -0400 Received: from pb-sasl1.pobox.com ([64.147.108.66]:56802 helo=sasl.smtp.pobox.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bg7fH-00057b-N7 for 24357@debbugs.gnu.org; Sat, 03 Sep 2016 05:55:08 -0400 Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by pb-sasl1.pobox.com (Postfix) with ESMTP id 5454D319D7; Sat, 3 Sep 2016 05:55:07 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=y9pXKjoLsLyI0qmT0uCt0luKF/k=; b=fWCcg/ VA4DjM+uOywchg9D/94zPEM8b8ir0+JkffUmUNHpxnKGIbTA9OuGIny2YSyPda56 Rx3+Djd4l1HuJdy8ampaaX/NfKb28nETUGofzqtXCwozu2fnlwT01RIJzz5f+QF5 SIEtwzmrWmvMteCCqEPI4PFWHHnUjNttnOYPg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=YF9Conzkwj2o5PmPiu3I0D/pte7rSvd9 x5c5Yp0VzWDtdwm12Ih5ktbRCGznVqdnSlTnU7moplCvsnh7+jJ5+DS4PJOfOyLn bjgRlo69OisyPx/++9yI/VxMxp2RHZqLn0iyEQX1Op2lZ0nTeYSfFwmwJ2HAvKXI mMMoB8n5Wyc= Received: from pb-sasl1.nyi.icgroup.com (unknown [127.0.0.1]) by pb-sasl1.pobox.com (Postfix) with ESMTP id 3E118319D5; Sat, 3 Sep 2016 05:55:07 -0400 (EDT) Received: from clucks (unknown [88.160.190.192]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by pb-sasl1.pobox.com (Postfix) with ESMTPSA id 53AA4319D4; Sat, 3 Sep 2016 05:55:06 -0400 (EDT) From: Andy Wingo References: <891b344e747119b497e1d0a17b62b81b@hypermove.net> Date: Sat, 03 Sep 2016 11:54:58 +0200 In-Reply-To: <891b344e747119b497e1d0a17b62b81b@hypermove.net> (Amirouche Boubekki's message of "Sat, 03 Sep 2016 09:20:36 +0200") Message-ID: <87d1kli9zh.fsf@pobox.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Pobox-Relay-ID: 7E2B4D98-71BC-11E6-8AD6-CE686462E9F6-02397024!pb-sasl1.pobox.com X-Spam-Score: -1.5 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.5 (-) 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. Andy From unknown Sun Aug 17 01:00:54 2025 X-Loop: help-debbugs@gnu.org Subject: bug#24357: pure guile program leaks memory 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: To: Andy Wingo Cc: 24357@debbugs.gnu.org Received: via spool by 24357-submit@debbugs.gnu.org id=B24357.14729285872999 (code B ref 24357); Sat, 03 Sep 2016 18:50:01 +0000 Received: (at 24357) by debbugs.gnu.org; 3 Sep 2016 18:49:47 +0000 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 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 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 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 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) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=_508a2b20f016be65a5503180d0371867" Date: Sat, 03 Sep 2016 20:49:41 +0200 From: Amirouche Boubekki In-Reply-To: <87d1kli9zh.fsf@pobox.com> References: <891b344e747119b497e1d0a17b62b81b@hypermove.net> <87d1kli9zh.fsf@pobox.com> Message-ID: <720a442d3c0733ce6ddcb8f0e80a921a@hypermove.net> X-Sender: amirouche@hypermove.net User-Agent: Roundcube Webmail/1.1.2 X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --=_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-- From unknown Sun Aug 17 01:00:54 2025 X-Loop: help-debbugs@gnu.org Subject: bug#24357: pure guile program leaks memory Resent-From: Amirouche Boubekki Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Mon, 12 Sep 2016 17:48:02 +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: To: Andy Wingo Cc: bug-guile , 24357@debbugs.gnu.org Received: via spool by 24357-submit@debbugs.gnu.org id=B24357.14737024274894 (code B ref 24357); Mon, 12 Sep 2016 17:48:02 +0000 Received: (at 24357) by debbugs.gnu.org; 12 Sep 2016 17:47:07 +0000 Received: from localhost ([127.0.0.1]:57897 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bjVJz-0001Gr-77 for submit@debbugs.gnu.org; Mon, 12 Sep 2016 13:47:07 -0400 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:49127) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bjVJw-0001Gj-WF for 24357@debbugs.gnu.org; Mon, 12 Sep 2016 13:47:05 -0400 Received: from mfilter23-d.gandi.net (mfilter23-d.gandi.net [217.70.178.151]) by relay4-d.mail.gandi.net (Postfix) with ESMTP id E84741720A3; Mon, 12 Sep 2016 19:47:03 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mfilter23-d.gandi.net Received: from relay4-d.mail.gandi.net ([IPv6:::ffff:217.70.183.196]) by mfilter23-d.gandi.net (mfilter23-d.gandi.net [::ffff:10.0.15.180]) (amavisd-new, port 10024) with ESMTP id 8D9pabhdWZ5i; Mon, 12 Sep 2016 19:47:02 +0200 (CEST) X-Originating-IP: 10.58.1.150 Received: from webmail.gandi.net (webmail10-d.mgt.gandi.net [10.58.1.150]) (Authenticated sender: amirouche@hypermove.net) by relay4-d.mail.gandi.net (Postfix) with ESMTPA id 510C91720BE; Mon, 12 Sep 2016 19:47:02 +0200 (CEST) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 12 Sep 2016 19:47:02 +0200 From: Amirouche Boubekki In-Reply-To: <720a442d3c0733ce6ddcb8f0e80a921a@hypermove.net> References: <891b344e747119b497e1d0a17b62b81b@hypermove.net> <87d1kli9zh.fsf@pobox.com> <720a442d3c0733ce6ddcb8f0e80a921a@hypermove.net> Message-ID: <6c2a865a123673b1aa7cb101e1aa880b@hypermove.net> X-Sender: amirouche@hypermove.net User-Agent: Roundcube Webmail/1.1.2 X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 2016-09-03 20:49, Amirouche Boubekki wrote: > 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 > Internet says this a curl issue. Please close this bug. From unknown Sun Aug 17 01:00:54 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Amirouche Boubekki Subject: bug#24357: closed (Re: bug#24357: pure guile program leaks memory) Message-ID: References: <8737exjrh1.fsf@pobox.com> <891b344e747119b497e1d0a17b62b81b@hypermove.net> X-Gnu-PR-Message: they-closed 24357 X-Gnu-PR-Package: guile Reply-To: 24357@debbugs.gnu.org Date: Wed, 01 Mar 2017 09:08:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1488359282-29706-1" This is a multi-part message in MIME format... ------------=_1488359282-29706-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #24357: pure guile program leaks memory which was filed against the guile package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 24357@debbugs.gnu.org. --=20 24357: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D24357 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1488359282-29706-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 24357-done) by debbugs.gnu.org; 1 Mar 2017 09:07:02 +0000 Received: from localhost ([127.0.0.1]:60977 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cj0Dt-0007hR-KM for submit@debbugs.gnu.org; Wed, 01 Mar 2017 04:07:01 -0500 Received: from pb-sasl1.pobox.com ([64.147.108.66]:52430 helo=sasl.smtp.pobox.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cj0Dr-0007hK-V1 for 24357-done@debbugs.gnu.org; Wed, 01 Mar 2017 04:07:00 -0500 Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by pb-sasl1.pobox.com (Postfix) with ESMTP id AE57E48E37; Wed, 1 Mar 2017 04:06:58 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=Azh6DdSSAiqbV1Csb+cjeYkmqXQ=; b=c7BrFe WZCfbeAnZ75i9/N0clc3UChLDJPOHThWC7Y9zJ1Sz48Nj65woowEr+G0VgPTPEzM O5pBqN46kL31IWLjpO1yRn3kNtTxQheShYumvMPILg1T8evfWmolur6nGk3zQjb8 ktJ/ipWCWGNCvh7I2ndG7+s9U5b1NuJJya2GE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=jR6y6we6+2yWkNKXE8i/FIZx1CQ72Byn 5/VkfrV4Zwu0ZoIF7VxfLOSZ6Ln2f9tZ96IKARL7bP+cf3rTtPhCqtY9biHOJCV6 T1OF5d1KmmVUFycInHD8objkwxTzWvWgrakU5cMYbrK06lHvnc8OSLQglKE3fZIb 1wyugfvO4ak= Received: from pb-sasl1.nyi.icgroup.com (unknown [127.0.0.1]) by pb-sasl1.pobox.com (Postfix) with ESMTP id A6C6448E34; Wed, 1 Mar 2017 04:06:58 -0500 (EST) Received: from clucks (unknown [109.190.228.233]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by pb-sasl1.pobox.com (Postfix) with ESMTPSA id D762948E33; Wed, 1 Mar 2017 04:06:57 -0500 (EST) From: Andy Wingo To: Amirouche Boubekki Subject: Re: bug#24357: pure guile program leaks memory References: <891b344e747119b497e1d0a17b62b81b@hypermove.net> <87d1kli9zh.fsf@pobox.com> <720a442d3c0733ce6ddcb8f0e80a921a@hypermove.net> <6c2a865a123673b1aa7cb101e1aa880b@hypermove.net> Date: Wed, 01 Mar 2017 10:06:50 +0100 In-Reply-To: <6c2a865a123673b1aa7cb101e1aa880b@hypermove.net> (Amirouche Boubekki's message of "Mon, 12 Sep 2016 19:47:02 +0200") Message-ID: <8737exjrh1.fsf@pobox.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Pobox-Relay-ID: 6C66B190-FE5E-11E6-861F-B667064AB293-02397024!pb-sasl1.pobox.com X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 24357-done Cc: 24357-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) On Mon 12 Sep 2016 19:47, Amirouche Boubekki writes: > On 2016-09-03 20:49, Amirouche Boubekki wrote: >> 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 > > Internet says this a curl issue. Please close this bug. No problem. For reference, in the future just add "-done" after the bug number in the mail, as I did above. Cheers :) Andy ------------=_1488359282-29706-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 3 Sep 2016 07:20:53 +0000 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 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 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 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_40 autolearn=disabled version=3.3.2 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 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 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 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 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 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 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) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=_809bb6b0cdfb2305df45b7e3b9837a08" Date: Sat, 03 Sep 2016 09:20:36 +0200 From: Amirouche Boubekki To: bug-guile@gnu.org Subject: pure guile program leaks memory Message-ID: <891b344e747119b497e1d0a17b62b81b@hypermove.net> X-Sender: amirouche@hypermove.net User-Agent: Roundcube Webmail/1.1.2 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-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) --=_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-- ------------=_1488359282-29706-1--