Groups | Search | Server Info | Login | Register


Groups > perl.perl5.changes > #34443

[Perl/perl5] 3ed243: Add SAVEt_PADSV; fixes memory leak in pp_methstart

Newsgroups perl.perl5.changes
Path csiph.com!fu-berlin.de!bofh.it!nntp.perl.org
Xref csiph.com perl.perl5.changes:34443
Return-Path <noreply@github.com>
Mailing-List contact perl5-changes-help@perl.org; run by ezmlm
Delivered-To mailing list perl5-changes@perl.org
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=perl.org; h=date :from:to:message-id:subject:mime-version:content-type :content-transfer-encoding:list-unsubscribe:reply-to; s=dr1; bh= bHoFn1KckxQlaZBUlycsTUEm0njC1Wk5wnZE8KwTfKo=; b=ezOmkFkOBYFdEjt9 0NhNSvWqDzUwGPrxJnatM9IbHZY8/44VYzfxIU/xCe5NSYZyvV144mRp90rinXks KhsLt9c7dPEQaPO1N6rRz1Mtg5Z4bTHOenbfrbMrBgFJUAq/wv30/u2iSA3Kxh76 eqs+fwNlVcHzk8/02aEN1eHijlOewKZ5pKbvos+4MvwomkNpa01Akkb1b985OKsQ AJhhP0qiT6uspwPyN+ZVDGwjaolCzeR0n5hpIsq/SXJmBbh+Ugu2IuFNR6ZgsEvo uVrygiZFYuFXYZTryPtCRtxlhGyN6ZaLs13CTRPQteJ1VojRHgy2XRo7v9tY4Wp5 Eo/JnA==
Received (qmail 11839 invoked from network); 9 Mar 2026 12:30:07 -0000
Received from xx1.develooper.com (147.75.38.233) by x6.develooper.com with SMTP; 9 Mar 2026 12:30:07 -0000
Received from inbound-egress-3.mailchannels.net (inbound-egress-3.mailchannels.net [34.214.167.131]) by xx1.develooper.com (Postfix) with ESMTP id 0F6277C1B3 for <perl5-changes@perl.org>; Mon, 9 Mar 2026 05:30:06 -0700 (PDT)
ARC-Seal i=1; a=rsa-sha256; d=mailchannels.net; s=arc-2022; cv=none; t=1773059405; b=G+iJZ/qNJiVuziMZN74xvpQJ/yMtEbMky3WF8nxpXA35vPj2teJM0T/VvOdKr5btQ2wm9W s5VqtWPeC3ApdDurE7FA0Z8a0OjFzdt0wGJZpbIkFHHH0UpQHTUkGrozaNisEcTpmM/Q5e 7mHCHrZjDGzuPIEHfItDIvs5i2i294ZyfTRDX70BM8iYJNh25/mvUTW6l0tRukGkgy/eJd UiKk9mn1QdsAkiTTwCmM11JdJkHpsgPUMORRkMyHjrfCftQuUz9AoQ1tYF5UpE2z/TAOYg g1DOSTm3e+8us62TXUPzNCh4OEi7GL7S5Htdq/TJPN7z6GdpnMbJy7QPWtjKUQ==
ARC-Message-Signature i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1773059405; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-unsubscribe: dkim-signature; bh=bHoFn1KckxQlaZBUlycsTUEm0njC1Wk5wnZE8KwTfKo=; b=EBp7CWnZvA3260D5u4nXvBHXRtSEJ97WZXRijDDZjo2iyW1wvACDn2U5k4r6gjHs6YiHtJ C6JpuvUWsO+8UWxSmXsvYThIfCOW9DvUe9UtUFVehNa535y5df8ara6qrJGm/RfM12LtRi jHZmgiPAJNECQieWI+ieLUu0swcb1lb37bpICqiABIglV487yr5gqaJRytVej8zZuyu64W WN+BuI4pTV3t/OzWRfrVkX0WaDbvYziwQ3ILNwxGP8zvb7zhAW3CrJLxFMDh2H+XLT7/5C AhBYyX3+sSji3b3u7eygDr8MqFb//FuLMOkErUM4m/IvZ+BgPMcvoEnar2PL/Q==
ARC-Authentication-Results i=1; inbound-rspamd-57bbd4d544-5pp5q; none
X-Message-ID LtHCwjJWFYIdsfjyj686hHqr
Received from out-28.smtp.github.com (out-28.smtp.github.com [192.30.252.211]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.112.107.160 (trex/7.1.3); Mon, 09 Mar 2026 12:30:06 +0000
Authentication-Results inbound.mailchannels.net; spf=pass smtp.mailfrom=noreply@github.com; dkim=pass header.d=github.com; dmarc=pass (policy=reject; pct=100; status=pass); arc=none
Received-SPF pass (dmarc-service-78968d7585-vnjcm: domain of github.com designates 192.30.252.211 as permitted sender) client-ip=192.30.252.211; envelope-from=noreply@github.com; helo=out-28.smtp.github.com;
Received from github.com (hubbernetes-node-f97290c.ash1-iad.github.net [10.56.200.67]) by smtp.github.com (Postfix) with ESMTPA id B468E921329 for <perl5-changes@perl.org>; Mon, 9 Mar 2026 05:30:04 -0700 (PDT)
Date Mon, 09 Mar 2026 05:30:04 -0700
To perl5-changes@perl.org
Message-ID <Perl/perl5/push/refs/heads/blead/1aa643-3ed243@github.com> (permalink)
Subject [Perl/perl5] 3ed243: Add SAVEt_PADSV; fixes memory leak in pp_methstart
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding 7bit
X-GitHub-Recipient-Address perl5-changes@perl.org
X-Auto-Response-Suppress All
Original-From Paul Evans <noreply@github.com>
Reply-To Paul Evans <noreply@github.com>,
Approved news@nntp.perl.org
From perl5-changes@perl.org (Paul Evans via perl5-changes)

Show key headers only | View raw


  Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: 3ed2439bc15f60b2ab82a0f91b568a32f9c8bd7d
      https://github.com/Perl/perl5/commit/3ed2439bc15f60b2ab82a0f91b568a32f9c8bd7d
  Author: Paul "LeoNerd" Evans <leonerd@leonerd.org.uk>
  Date:   2026-03-09 (Mon, 09 Mar 2026)

  Changed paths:
    M class.c
    M embed.fnc
    M embed.h
    M proto.h
    M regen/embed.pl
    M regen/scope_types.pl
    M scope.c
    M scope_types.h
    M sv.c
    M t/class/field.t

  Log Message:
  -----------
  Add SAVEt_PADSV; fixes memory leak in pp_methstart

The previous commit here (6b450442) intended to fix `pp_methstart` to
allow refaliasing operations on fields. The way it did this had the
unintended side-effect of no longer undoing the `SvREFCNT_inc` applied
to each field, and thus caused every method call to leak SV references
to every field it captured.

This change fixes this, by introducing a new savestack operation,
`SAVEt_PADSV`. This operation saves the current SV in a pad slot, then
on scope exit restores it back by first decrementing the reference count
of *whatever SV* is now found in that pad slot. This was the original
bug in `pp_methstart` that refaliasing into fields highlighted and the
previous commit intended to fix.

In addition to the bugfix, this new savestack operation makes it more
efficient than the previous code, as it combines into a single operation
the two behaviours which previously required two separate ones
(SAVEt_SPTR + SAVEt_CLEARSV).



To unsubscribe from these emails, change your notification settings at https://github.com/Perl/perl5/settings/notifications

Back to perl.perl5.changes | Previous | Next | Find similar


Thread

[Perl/perl5] 3ed243: Add SAVEt_PADSV; fixes memory leak in pp_methstart perl5-changes@perl.org (Paul Evans via perl5-changes) - 2026-03-09 05:30 -0700

csiph-web