From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 569E31F8C8 for ; Tue, 5 Oct 2021 11:33:12 +0000 (UTC) Date: Tue, 5 Oct 2021 11:33:12 +0000 From: Eric Wong To: meta@public-inbox.org Subject: Encode.pm leak Message-ID: <20211005112531.13664-1@dcvr> References: <20210904235305.GA22009@dcvr> <20211004000717.18965-1-e@80x24.org> <20211004225131.GA726@dcvr> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20211004225131.GA726@dcvr> List-Id: The leak's been there for a while, but I couldn't find other reports of it: https://rt.cpan.org/Public/Bug/Display.html?id=139622 Anybody else want to try this and see which versions of Encode or Perl hit this leak? Encode is bundled with Perl, but at least Debian also provides an optional standalone package, too. In the meantime, I may need to put in my own workaround for it PublicInbox::Eml because distros are slow moving... ----8<---- #!perl -w use v5.10.1; use Encode qw(decode); say "Encode::VERSION=$Encode::VERSION"; my $blob = "\xef\xbf\xbd" x 1000; my $nr = $ENV{NR} || 10000; # higher => more memory my $warn = $ENV{FB_WARN}; for (0..$nr) { if ($warn) { decode('us-ascii', $blob, Encode::FB_WARN); } else { eval { decode('us-ascii', $blob, Encode::FB_CROAK) }; } }