Devel::PPPort: skip calling a pp func from an XSUB with RC stack #24953
@tonycoz, in https://github.com/Perl/perl5/issues/24954 I have raised the question of why dist/Devel-PPPort/t/testutil.pl has #last SKIP; commented out. The discussion in that ticket may allow us to take a different approach here.
I used the GH web interface to resolve the merge conflicts in Changes. Our GH CI then re-started and all rigs have PASSed. Except for the question I posed above, the p.r. looks good and it addresses the problem described in GH #24938. However, I don't know why the web interface is still displaying the message "This branch cannot be rebased due to conflicts".
However, I don't know why the web interface is still displaying the message "This branch cannot be rebased due to conflicts".
I built a local branch based on this pull request, but when I called git rebase blead, I got notification of merge conflicts -- the same few lines which I had earlier corrected in the GH web interface -- which I had to manually resolve to continue rebasing and testing. So now I question whether resolving merge conflicts through the web interface actually works!
So now I question whether resolving merge conflicts through the web interface actually works!
I don't know why it complained, I rebased on blead and applied the same resolution to Changes you did, and the difference between my commit and yours was the sync-with-cpan change, I expect I rebased on a later blead.
Your commit was a large merge commit which may have confused the conflict detection.
This p.r. tests satisfactorily against a perl configured like this:
$ ./perl -Ilib -V:config_args
config_args='-des -Dusedevel -Accflags=-DPERL_RC_STACK';
But it would be good if someone familiar with
PL_ppaddr could confirm that this is an appropriate use thereof. Once that happens, the p.r. should be good to merge.Could we get some eyeballs on this code from contributors who have touched it in the past? Thanks!
@wolfsage @atoomic @mhx
I'm not very familiar with PL_ppaddr in PPPort, but having a quick eyeball at it, it seems reasonable.
The test in #24938 is essentially achieving uc "mhx" by calling the uc function (pp_uc) directly via:
void
PL_ppaddr(string)
char *string
PPCODE:
PUSHMARK(SP);
mXPUSHs(newSVpv(string, 0));
PUTBACK;
ENTER;
(void)*(PL_ppaddr[OP_UC])(aTHXR);
SPAGAIN;
LEAVE;
XSRETURN(1);
That is an XSUB, operating on a non-refcounted stack even under
PERL_RC_STACK, calling a pp_ function which does operate on a refcounted-stack under PERL_RC_STACK. pp_uc is still PP_wrapped, so calls Perl_pp_wrap, which tweaks argument refcounts and duplicates the argument to boot.Addressing #24938 boils down to either:
modifying the PL_ppaddr XSUB above to understand all those the stack adjustments
skipping the affected test under RC_STACK builds
The test doesn't seem to provide enough benefit to make the first option a good use of time.
@tonycoz: Here @richardleach appears to disagree with your change to .../parts/inc/variables. Would you like to comment?
@tonycoz: Here @richardleach appears to disagree with your change to .../parts/inc/variables. Would you like to comment?
Apologies, that wasn't my intention. I meant to say that I can see what this PR is doing and why, and it seems reasonable.
Apologies, that wasn't my intention. I meant to say that I can see what this PR is doing and why, and it seems reasonable.
That's how I read it.
It appears
if (defined &Internals::stack_refcounted && (Internals::stack_refcounted() & 1)
is the right way to check for this?
I think you're right, updated.
Thanks
Also bumped the version and moved the change in Changes to the new version, since the new dev release is due.
Approved these changes.
@richardleach @Leont, Can we go forward with this pull request? (We would then be able to work on GH #24936.) Thanks.
@richardleach @Leont, Can we go forward with this pull request? (We would then be able to work on GH #24936.) Thanks.
LGTM
jkeenan
tonycoz
Fixes #24938
-------------------------------------------------------------------------------
<!--
Significant or noteworthy changes to Perl must be documented in pod/perldelta.pod.
Consider if the changes in this pull request are worthy of a perldelta
entry, then pick the appropriate line below and remove the others.
-->