[Perl/perl5] 42557c: README: make the GitHub readme Markdown just use t...

2022-10-21 Thread Ricardo Signes via perl5-changes
  Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: 42557cf44325545afd1c1455ebfeecbc2d23157c
  
https://github.com/Perl/perl5/commit/42557cf44325545afd1c1455ebfeecbc2d23157c
  Author: Ricardo Signes 
  Date:   2022-10-21 (Fri, 21 Oct 2022)

  Changed paths:
R .github/README.md
A .github/README.md
M README

  Log Message:
  ---
  README: make the GitHub readme Markdown just use the root README


  Commit: 1831d2c96685897a88d92b66dc5ccbbfbf1f1540
  
https://github.com/Perl/perl5/commit/1831d2c96685897a88d92b66dc5ccbbfbf1f1540
  Author: Ricardo Signes 
  Date:   2022-10-21 (Fri, 21 Oct 2022)

  Changed paths:
M README

  Log Message:
  ---
  README: eliminate unneeded code blocks


  Commit: cd0eaede3642d9d687128d1ad1a699d94a1088e8
  
https://github.com/Perl/perl5/commit/cd0eaede3642d9d687128d1ad1a699d94a1088e8
  Author: Ricardo Signes 
  Date:   2022-10-21 (Fri, 21 Oct 2022)

  Changed paths:
R .github/README.md
A .github/README.md
M README

  Log Message:
  ---
  Merge branch 'readme-symlink' into blead


Compare: https://github.com/Perl/perl5/compare/bacfb30b229f...cd0eaede3642


[Perl/perl5] 5adc62: perl.c - add debug output to show when the run_bod...

2022-10-21 Thread Yves Orton via perl5-changes
  Branch: refs/heads/yves/fix_20396
  Home:   https://github.com/Perl/perl5
  Commit: 5adc629f0b9d31a4d3a0bc82f459dc1128008735
  
https://github.com/Perl/perl5/commit/5adc629f0b9d31a4d3a0bc82f459dc1128008735
  Author: Yves Orton 
  Date:   2022-10-21 (Fri, 21 Oct 2022)

  Changed paths:
M perl.c

  Log Message:
  ---
  perl.c - add debug output to show when the run_body() continues after eval 
fail

This can be helpful debugging issues related to phaser blocks and eval.


  Commit: 6aad84a18ceceb7824949d8fd0b9287fc2cc1c29
  
https://github.com/Perl/perl5/commit/6aad84a18ceceb7824949d8fd0b9287fc2cc1c29
  Author: Yves Orton 
  Date:   2022-10-21 (Fri, 21 Oct 2022)

  Changed paths:
M scope.c

  Log Message:
  ---
  scope.c - sanity check a var before we use it


  Commit: ecc557f4f12372982e0e5c0979d3055d5dd3e103
  
https://github.com/Perl/perl5/commit/ecc557f4f12372982e0e5c0979d3055d5dd3e103
  Author: Yves Orton 
  Date:   2022-10-21 (Fri, 21 Oct 2022)

  Changed paths:
M dist/Attribute-Handlers/lib/Attribute/Handlers.pm

  Log Message:
  ---
  Attribute-Handlers: rework eval code

This makes the logic a bit simpler, and makes it easier to debug
as well. Reducing the amount of code that needs to be inside
the eval makes it easier to debug what is going on, especially
from an internals point of view (eg with -Dl enabled).


  Commit: 2b163ef80b9f95adc5544180598a14b875c5eb56
  
https://github.com/Perl/perl5/commit/2b163ef80b9f95adc5544180598a14b875c5eb56
  Author: Yves Orton 
  Date:   2022-10-21 (Fri, 21 Oct 2022)

  Changed paths:
M perl.c
M pp_ctl.c
M t/op/eval.t

  Log Message:
  ---
  pp_ctl.c - in try_yyparse do not leak PL_restartop from compile that dies

Fix GH Issue #20396, try_yyparse() breaks Attribute::Handlers.

Reduced test case is:

perl -e'CHECK { eval "]" }'

which should not assert or segfault.

In c304acb49 we made it so that when doeval_compile() is executed and it
calls yyparse() inside of an eval any exceptions that occur during the
parse process are trapped by try_yyparse() so that exection would return
to doeval_compile(). This was done so that post eval compilation cleanup
logic could be handled similarly regardless of whether Perl_croak() was
called or not. However the logic to setup PL_restartop was not adjusted
accordingly.

The opcode that calls doeval_compile() setups an eval context data
before it calls doeval_compile(). This data includes the "retop" which
is used to return control to after the eval should it die and is set to
the be the evaling opcodes op_next. When Perl_die_unwind() is called it
sets PL_restartop to be the "retop" of the of the current eval frame,
and then does a longjmp, on the assumption it will end up inside of a
"run loop enabled jump enviornment", where it restarts the run loop
based on the value of PL_restartop, zeroing it aftewards.

After c304acb49 however, a die inside of try_yyparse the die_unwind
returns control back to the try_yyparse, which ignores PL_restartop, and
leaves it set. Code then goes through the "compilation failed" branch
and execution returns to PL_restartop /anyway/, as PL_op hasn't changed
and pp_entereval returns control to PL_op->op_next, which is what we
pushed into the eval context anyway for the PL_restartop.

The end result of this however is that PL_restartop remains set when we
enter perl_run() for the first time. perl_run() is a "run loop enabled
jump enviornment" which uses run_body() to do its business, such that
when PL_restartop is NULL it executes the just compiled body of the
program, and when PL_restartop is not null it assumes it must be in the
eval handler from an eval from the main body and it should recontinue.
The leaked PL_restartop is thus executed instead of the main program
body and things go horribly wrong.

This patch changes it so that when try_yyparse traps an exception we
restore PL_restartop back to its old value. Same for its partner
PL_restartjmpenv. This is fine as they have been set to the values from
the beginning of the eval frame which we are part of, which is now over.


  Commit: 76e391085034f4cce4540d48f5e501cc8e1e55d3
  
https://github.com/Perl/perl5/commit/76e391085034f4cce4540d48f5e501cc8e1e55d3
  Author: Yves Orton 
  Date:   2022-10-21 (Fri, 21 Oct 2022)

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

  Log Message:
  ---
  pp_ctl.c - in try_run_unitcheck() guard against leaking PL_restartop

If we die while executing a UNITCHECK inside of an eval we shouldn't
leave PL_restartop set, as we will execute PL_op->op_next anyway. See
the previous commit for more details in the context yy_parse().

Thanks to Bram for coming up with a test case that demonstrated the
problem.


Compare: https://github.com/Perl/perl5/compare/0bd0ff76255f...76e391085034


[Perl/perl5] 041cf0: locale.c: Use buffer instead of SAVEFREEPV

2022-10-21 Thread Karl Williamson via perl5-changes
  Branch: refs/heads/smoke-me/khw-win_savefreepv
  Home:   https://github.com/Perl/perl5
  Commit: 041cf007d6a5cc7073ba3cc61ef9f579264f543b
  
https://github.com/Perl/perl5/commit/041cf007d6a5cc7073ba3cc61ef9f579264f543b
  Author: Karl Williamson 
  Date:   2022-10-21 (Fri, 21 Oct 2022)

  Changed paths:
M embedvar.h
M intrpvar.h
M locale.c
M makedef.pl
M sv.c

  Log Message:
  ---
  locale.c: Use buffer instead of SAVEFREEPV

This eliminates the use of temporaries here, as long suggested to do by
the comments




[Perl/perl5] 5879fa: t/test.pl: Fix threads signalling watchdog cancell...

2022-10-21 Thread Karl Williamson via perl5-changes
  Branch: refs/heads/smoke-me/khw-watchdoc
  Home:   https://github.com/Perl/perl5
  Commit: 5879fae80b626df51e697aa8af539bddc7f37266
  
https://github.com/Perl/perl5/commit/5879fae80b626df51e697aa8af539bddc7f37266
  Author: Karl Williamson 
  Date:   2022-10-21 (Fri, 21 Oct 2022)

  Changed paths:
M t/test.pl

  Log Message:
  ---
  t/test.pl: Fix threads signalling watchdog cancellation

Commit 4712a4c94e5974bba8ef97d68aadf2b99c0b4ff4 added the ability to
cancel a watchdog timer.  Unfortunately it doesn't work properly when
the timer method was using the thread signalling cancellation method.
This problem only shows up on slow systems under load, so the flaw
wasn't immediately discovered.  That commit lowered the incidence level
significantly.

This commit solves the problem by having the child thread detach itself,
after it sets up the needed code to handle a signal from the parent.
The parent thread signals the child, as currently when it is done
processing, but waits for the child being detached.  That is a cue to
the parent that it is safe to signal the child.