On Wed Jul 04 07:41:13 2018, haarg wrote:
Show quoted text> This module breaks loading DynaLoader on perl 5.8. If DynaLoader is
> loaded before XSLoader, it will fail.
>
> DynaLoader creates a $VERSION variable but doesn't assign to it until
> after loading Config. Config (XSConfig) then loads XSLoader, which
> bootstraps DynaLoader. That bootstrapping fails because $VERSION
> doesn't match the object version.
DynaLoader's from 5.8.7 bootstrap doesn't check version. I need a 1 liner showing the bug.
---------------------------------
void __cdecl boot_DynaLoader(interpreter *my_perl, cv *cv)
{
interpreter *v2; // edi@1
int *v3; // ecx@1
int v4; // eax@1
int v5; // ebp@1
sv *v6; // eax@1
sv *v7; // eax@1
sv *v8; // eax@1
sv *v9; // eax@1
sv *v10; // eax@1
v2 = my_perl;
v3 = my_perl->Tmarkstack_ptr;
v4 = (4 * *v3 >> 2) + 1;
my_perl->Tmarkstack_ptr = v3 - 1;
v5 = v4;
v6 = (sv *)Perl_newXS(my_perl, "DynaLoader::dl_load_file", XS_DynaLoader_dl_load_file, "dl_win32.c");
Perl_sv_setpv(my_perl, v6, "$;$");
v7 = (sv *)Perl_newXS(my_perl, "DynaLoader::dl_find_symbol", XS_DynaLoader_dl_find_symbol, "dl_win32.c");
Perl_sv_setpv(my_perl, v7, "$$");
v8 = (sv *)Perl_newXS(my_perl, "DynaLoader::dl_undef_symbols", XS_DynaLoader_dl_undef_symbols, "dl_win32.c");
Perl_sv_setpv(my_perl, v8, pv);
v9 = (sv *)Perl_newXS(my_perl, "DynaLoader::dl_install_xsub", XS_DynaLoader_dl_install_xsub, "dl_win32.c");
Perl_sv_setpv(my_perl, v9, "$$;$");
v10 = (sv *)Perl_newXS(my_perl, "DynaLoader::dl_error", XS_DynaLoader_dl_error, "dl_win32.c");
Perl_sv_setpv(my_perl, v10, pv);
dl_generic_private_init(my_perl);
v2->Tstack_base[v5] = &v2->Isv_yes;
v2->Tstack_sp = &v2->Tstack_base[v5];
}
---------------------------------
Show quoted text>
> If XSLoader is loaded first, it bootstraps DynaLoader itself without
> loading DynaLoader.pm or creating the $DynaLoader::VERSION variable.
> When the variable doesn't exist, the bootstrapping doesn't do any
> version checks.