Bleadperl breaks Devel::FindRef #16526
Created by @dur-randir
free up CvPADLIST slot for XSUBs for future use
broke Devel::FindRef for perls compiled with -DDEBUGGING with the
perl: FindRef.xs:180: XS_Devel__FindRef_find_: Assertion
While a patch for Devel::FindRef is quite trivial, I'd like to know,
On Mon, Apr 23, 2018 at 04:52:26AM -0700, Sergey Aleynikov wrote:
I think Daniel would have to be the one to answer that question,
(Since this change was in 5.22.0, I'm removing this ticket from the 5.28
On Wed, 25 Apr 2018 03:56:42 -0700, davem wrote:
The assertion stops XS code from reading the "padlist" of an XSUB. There is no legitimate reason to read the "padlist" of an XSUB since XSUBs dont have any and the proc will probably SEGV. The padlist slot in XSUBs is used on unthreaded perl to pass a magic unique value that must round trip from the caller (IE libperl) of the XSUB, through the XSUB and back into libperl. This stops a scenario where an XS SO/DLL compiled against another perl version, is loaded by one perl (a PATH/CWD/PERL5DB/PERL5LIB/sitecustomize/@INC/didnt delete "site/lib/auto" dir when upgrading perl/copy paste XS binaries mistake), and that XS SO/DLL then loads its original compiled against libperl into the process, and takes data structs from the caller libperl and passes them to the second libperl and there is a SEGV inside the 2nd libperl.
Fixing Devel::FindRef is very easy. I did see the assert failure. But it was easy to fix.
and add a matching "}" after the end of "if (padlist)"'s "}".
This is more crude but also works.