[Perl/perl5] 24b19b: fix leaks in new ${^HOOK}{require__*} facility

2023-08-04 Thread iabyn via perl5-changes
  Branch: refs/heads/smoke-me/davem/rc_stack2
  Home:   https://github.com/Perl/perl5
  Commit: 24b19b5ff0128e55c377933f81cbdada1ce4c4a7
  
https://github.com/Perl/perl5/commit/24b19b5ff0128e55c377933f81cbdada1ce4c4a7
  Author: David Mitchell 
  Date:   2023-08-04 (Fri, 04 Aug 2023)

  Changed paths:
M pp_ctl.c
M t/op/svleak.t

  Log Message:
  ---
  fix leaks in new ${^HOOK}{require__*} facility

In the initial implementation, a few temporary SVs ended up with a ref
count one too high.


  Commit: af26e127b2471ce18f7cda719f4c91a10a51b3f1
  
https://github.com/Perl/perl5/commit/af26e127b2471ce18f7cda719f4c91a10a51b3f1
  Author: David Mitchell 
  Date:   2023-08-04 (Fri, 04 Aug 2023)

  Changed paths:
M perl.c
M perl.h

  Log Message:
  ---
  add PERL_RC_STACK define (not yet defined)

This macro turns on stack reference counting.
Add the macro, but commented out for now.

In addition, temporarily define and enable PERL_XXX_TMP_NORC.

This is a temporary transition measure: even in the presence of
PERL_RC_STACK, do not actually modify reference counts yet. So
PERL_RC_STACK will still define all the new static functions and code
behaviour, except for the bits that actually modify reference counts in
ways that assume the stack is reference counted. It allows this branch
to have many commits which incrementally deal with adding support for
PERL_RC_STACK, with each individual commit still working while half of
the core is still not yet "ref count aware".


  Commit: 45c43ff3713fb60dcb508257dc402d4c0e8196e4
  
https://github.com/Perl/perl5/commit/45c43ff3713fb60dcb508257dc402d4c0e8196e4
  Author: David Mitchell 
  Date:   2023-08-04 (Fri, 04 Aug 2023)

  Changed paths:
M lib/Internals.pod
M universal.c

  Log Message:
  ---
  add Internals::stack_refcounted()

This indicates whether perl has been built with PERL_RC_STACK.
For now this should only be used by core; It's not yet decided whether
CPAN modules have a use case too.


  Commit: 0315e7ccaf8c1d4fd605120946a774608a209ff6
  
https://github.com/Perl/perl5/commit/0315e7ccaf8c1d4fd605120946a774608a209ff6
  Author: David Mitchell 
  Date:   2023-08-04 (Fri, 04 Aug 2023)

  Changed paths:
M ext/Devel-Peek/t/Peek.t

  Log Message:
  ---
  ext/Devel-Peek/t/Peek.t: fixup top refcount

There are a few 'expected' Dump() output patterns which expect the
refcount of the top-most SV in the tree to be fixed number like

REFCNT = 1

Change all those occurrences to

REFCNT = \d+

or similar, since a reference-counted stack will cause higher values


  Commit: eefb89f8710557e8293fe07268ac60118b4689c0
  
https://github.com/Perl/perl5/commit/eefb89f8710557e8293fe07268ac60118b4689c0
  Author: David Mitchell 
  Date:   2023-08-04 (Fri, 04 Aug 2023)

  Changed paths:
M pp_ctl.c
M scope.c

  Log Message:
  ---
  pp_dbstate: skip SAVESTACK_POS()

On PERL_RC_STACK builds, skip the call to SAVESTACK_POS().
I suspect that saving the stack position is no longer
required. It was added in 5.001 by:

NETaa13155: ::DB left trash on the stack.
From: Thomas Koenig
Files patched: lib/perl5db.pl pp_ctl.c
 The call by pp_dbstate() to ::DB left trash on the
 stack.  It now calls DB in list context, and DB returns
 ().

but the details of what bug it fixed are long lost to history.
SAVESTACK_POS() doesn't work well with stacks which may be split into
partly reference-counted and partly not halves, so skip it and hope it
doesn't cause any problems.

Also, assert that SAVEt_STACK_POS isn't used anywhere any more.


  Commit: 483d0748e726d2f2fc3ac0bf08d1c46d00e04835
  
https://github.com/Perl/perl5/commit/483d0748e726d2f2fc3ac0bf08d1c46d00e04835
  Author: David Mitchell 
  Date:   2023-08-04 (Fri, 04 Aug 2023)

  Changed paths:
M pp_ctl.c

  Log Message:
  ---
  pp_mapwhile(): null out holes in stack

>From time to time, pp_mapwhile() shifts up any remaining args on the
stack, in order to leave enough space to add the current results to any
accumulated results. This leaves a hole in the stack, which might not be
fully filled until the last iteration. As well as making the output of
perl -Ds confusing, any garbage left in the hole will double-count
towards the reference count of each SV once the stack becomes
reference-counted.

So fill the newly-created hole in the stack with NULL pointers.


  Commit: 4450252fdf1e1cfb154100e816b3edf610af2306
  
https://github.com/Perl/perl5/commit/4450252fdf1e1cfb154100e816b3edf610af2306
  Author: David Mitchell 
  Date:   2023-08-04 (Fri, 04 Aug 2023)

  Changed paths:
M av.c
M embed.fnc
M embed.h
M inline.h
M proto.h

  Log Message:
  ---
  Add av_remove_offset() core-only function

This function abstracts away removing any AvARRAY(av) - AvALLOC(av)
offset from an array (previously added by av_shift()).

Also use Zero() rather than a loop to NULL out any elements in the
offset area.


  

[Perl/perl5] 3afe15: Raw, uncorrected synch of Pod-Simple-3.45

2023-08-04 Thread James E Keenan via perl5-changes
  Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: 3afe150007cdc8bf8a163fb0ad1bd21d022b1339
  
https://github.com/Perl/perl5/commit/3afe150007cdc8bf8a163fb0ad1bd21d022b1339
  Author: James E Keenan 
  Date:   2023-08-04 (Fri, 04 Aug 2023)

  Changed paths:
M MANIFEST
M Porting/Maintainers.pl
M cpan/Pod-Simple/lib/Pod/Simple.pm
M cpan/Pod-Simple/lib/Pod/Simple.pod
M cpan/Pod-Simple/lib/Pod/Simple/BlackBox.pm
M cpan/Pod-Simple/lib/Pod/Simple/Checker.pm
M cpan/Pod-Simple/lib/Pod/Simple/Debug.pm
M cpan/Pod-Simple/lib/Pod/Simple/DumpAsText.pm
M cpan/Pod-Simple/lib/Pod/Simple/DumpAsXML.pm
M cpan/Pod-Simple/lib/Pod/Simple/HTML.pm
M cpan/Pod-Simple/lib/Pod/Simple/HTMLBatch.pm
M cpan/Pod-Simple/lib/Pod/Simple/HTMLLegacy.pm
M cpan/Pod-Simple/lib/Pod/Simple/JustPod.pm
M cpan/Pod-Simple/lib/Pod/Simple/LinkSection.pm
M cpan/Pod-Simple/lib/Pod/Simple/Methody.pm
M cpan/Pod-Simple/lib/Pod/Simple/Progress.pm
M cpan/Pod-Simple/lib/Pod/Simple/PullParser.pm
M cpan/Pod-Simple/lib/Pod/Simple/PullParserEndToken.pm
M cpan/Pod-Simple/lib/Pod/Simple/PullParserStartToken.pm
M cpan/Pod-Simple/lib/Pod/Simple/PullParserTextToken.pm
M cpan/Pod-Simple/lib/Pod/Simple/PullParserToken.pm
M cpan/Pod-Simple/lib/Pod/Simple/RTF.pm
M cpan/Pod-Simple/lib/Pod/Simple/Search.pm
M cpan/Pod-Simple/lib/Pod/Simple/SimpleTree.pm
M cpan/Pod-Simple/lib/Pod/Simple/Subclassing.pod
M cpan/Pod-Simple/lib/Pod/Simple/Text.pm
M cpan/Pod-Simple/lib/Pod/Simple/TextContent.pm
M cpan/Pod-Simple/lib/Pod/Simple/TiedOutFH.pm
M cpan/Pod-Simple/lib/Pod/Simple/Transcode.pm
M cpan/Pod-Simple/lib/Pod/Simple/TranscodeDumb.pm
M cpan/Pod-Simple/lib/Pod/Simple/TranscodeSmart.pm
M cpan/Pod-Simple/lib/Pod/Simple/XHTML.pm
M cpan/Pod-Simple/lib/Pod/Simple/XMLOutStream.pm
M cpan/Pod-Simple/t/00about.t
R cpan/Pod-Simple/t/20_skip.t
M cpan/Pod-Simple/t/JustPod01.t
M cpan/Pod-Simple/t/JustPod02.t
M cpan/Pod-Simple/t/JustPod_corpus.t
M cpan/Pod-Simple/t/ac_d.t
M cpan/Pod-Simple/t/accept01.t
M cpan/Pod-Simple/t/accept05.t
M cpan/Pod-Simple/t/basic.t
M cpan/Pod-Simple/t/begin.t
M cpan/Pod-Simple/t/cbacks.t
M cpan/Pod-Simple/t/chunking.t
M cpan/Pod-Simple/t/closeys.t
M cpan/Pod-Simple/t/content_seen.t
M cpan/Pod-Simple/t/corpus.t
M cpan/Pod-Simple/t/emptylists.t
M cpan/Pod-Simple/t/enc-chars.t
M cpan/Pod-Simple/t/encod01.t
M cpan/Pod-Simple/t/encod02.t
M cpan/Pod-Simple/t/encod03.t
M cpan/Pod-Simple/t/encod04.t
M cpan/Pod-Simple/t/end_over.t
M cpan/Pod-Simple/t/eol.t
M cpan/Pod-Simple/t/eol2.t
M cpan/Pod-Simple/t/fake-closers.t
M cpan/Pod-Simple/t/fcodes.t
M cpan/Pod-Simple/t/fcodes_e.t
M cpan/Pod-Simple/t/fcodes_l.t
M cpan/Pod-Simple/t/fcodes_s.t
M cpan/Pod-Simple/t/for.t
M cpan/Pod-Simple/t/fornot.t
M cpan/Pod-Simple/t/github_issue_79.t
M cpan/Pod-Simple/t/heads.t
M cpan/Pod-Simple/t/html01.t
M cpan/Pod-Simple/t/html02.t
M cpan/Pod-Simple/t/html03.t
M cpan/Pod-Simple/t/htmlbat.t
M cpan/Pod-Simple/t/items.t
M cpan/Pod-Simple/t/items02.t
M cpan/Pod-Simple/t/itemstar.t
M cpan/Pod-Simple/t/lib/helpers.pm
M cpan/Pod-Simple/t/linkclas.t
M cpan/Pod-Simple/t/output.t
M cpan/Pod-Simple/t/puller.t
M cpan/Pod-Simple/t/pulltitl.t
M cpan/Pod-Simple/t/reinit.t
M cpan/Pod-Simple/t/render.t
M cpan/Pod-Simple/t/rtf_utf8.t
M cpan/Pod-Simple/t/search05.t
M cpan/Pod-Simple/t/search10.t
M cpan/Pod-Simple/t/search12.t
M cpan/Pod-Simple/t/search20.t
M cpan/Pod-Simple/t/search22.t
M cpan/Pod-Simple/t/search25.t
M cpan/Pod-Simple/t/search26.t
M cpan/Pod-Simple/t/search27.t
M cpan/Pod-Simple/t/search28.t
M cpan/Pod-Simple/t/search29.t
M cpan/Pod-Simple/t/search50.t
M cpan/Pod-Simple/t/search60.t
M cpan/Pod-Simple/t/stree.t
M cpan/Pod-Simple/t/strpvbtm.t
M cpan/Pod-Simple/t/tiedfh.t
M cpan/Pod-Simple/t/verb_fmt.t
M cpan/Pod-Simple/t/verbatim.t
M cpan/Pod-Simple/t/whine.t
M cpan/Pod-Simple/t/x_nixer.t
M cpan/Pod-Simple/t/xhtml-bkb.t
M cpan/Pod-Simple/t/xhtml01.t
M cpan/Pod-Simple/t/xhtml05.t
M cpan/Pod-Simple/t/xhtml10.t
M cpan/Pod-Simple/t/xhtml15.t
M cpan/Pod-Simple/t/xhtml20.t
A cpan/Pod-Simple/t/xhtml25.t

  Log Message:
  ---
  Raw, uncorrected synch of Pod-Simple-3.45

Synch Pod-Simple-3.45 into blead, without (yet) correcting the two test
failures reported in https://github.com/Perl/perl5/issues/21311.

There are test failures in t/porting/cmp_version.t and
ext/Pod-Html/t/anchorify.t.


  Commit: 6ea7dace3401e25dcf8318146be82c03e07a6a72
  
https://github.com/Perl/perl5/commit/6ea7dace3401e25dcf8318146be82c03e07a6a72
  Author: James E Keenan 
  Date:   2023-08-04 (Fri, 04 Aug 2023)

  Changed paths:
M