Skip Menu |

This queue is for tickets about the version CPAN distribution.

Report information
The Basics
Id: 107459
Status: rejected
Priority: 0/
Queue: version

People
Owner: Nobody in particular
Requestors: RURBAN [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: %version:: has an invalid SvSTASH
Easy to repro: perl -MDevel::Peek=Dump -E'version->new("v5.22.0");Dump(\%version::)' Or: $ gdb --args perl -E'version->new("v5.22.0");dump' (gdb) run (gdb) p *(XPVHV*)(Perl_get_hv("version::", 0)->sv_any) $3 = {xmg_stash = 0x18, xmg_u = {xmg_magic = 0xae1270, xmg_hash_index = 11407984}, xhv_keys = 31, xhv_max = 31} (gdb) p Perl_sv_dump(Perl_get_hv("version::", 0)) SEGV at HvNAME_get(sv) with 0x18 I haven't out yet where you write this 0x18. This bug is in core since 5.18 See also https://rt.cpan.org/Ticket/Display.html?id=81635 where I have out about this bug.
On Fri Oct 02 03:49:32 2015, RURBAN wrote: Show quoted text
> Easy to repro: perl -MDevel::Peek=Dump -E'version-
> >new("v5.22.0");Dump(\%version::)'
> > Or: > $ gdb --args perl -E'version->new("v5.22.0");dump' > (gdb) run > (gdb) p *(XPVHV*)(Perl_get_hv("version::", 0)->sv_any) > > $3 = {xmg_stash = 0x18, xmg_u = {xmg_magic = 0xae1270, xmg_hash_index > = > 11407984}, xhv_keys = 31, > xhv_max = 31} > > (gdb) p Perl_sv_dump(Perl_get_hv("version::", 0)) > SEGV at HvNAME_get(sv) with 0x18 > > I haven't out yet where you write this 0x18. > This bug is in core since 5.18 > > See also https://rt.cpan.org/Ticket/Display.html?id=81635 where I have > out about this bug.
I'd like to fix this, but I have no idea how. This is the likely source of the confusion: /* Now that we are through the prescan, start creating the object */ av = newAV(); hv = newSVrv(rv, "version"); /* create an SV and upgrade the RV */ (void)sv_upgrade(hv, SVt_PVHV); /* needs to be an HV type */ There isn't a "sv_setref_hv" to create an hv as an RV nor can I apparently created hv directly using newHV() and then upgrade that to an rv, i.e. --- a/vutil/vutil.c Fri Jan 01 08:08:53 2016 -0600 +++ b/vutil/vutil.c Fri Jan 01 08:30:16 2016 -0600 @@ -301,8 +301,8 @@ /* Now that we are through the prescan, start creating the object */ av = newAV(); - hv = newSVrv(rv, "version"); /* create an SV and upgrade the RV */ - (void)sv_upgrade(hv, SVt_PVHV); /* needs to be an HV type */ + hv = (SV*) newHV(); + rv = (SV*) newSVrv(hv, "version"); /* create an SV and upgrade the RV */ #ifndef NODEFAULT_SHAREKEYS HvSHAREKEYS_on(hv); /* key-sharing on by default */ If someone can tell me what to do, I will fix this. John
On Fri Oct 02 03:49:32 2015, RURBAN wrote: Show quoted text
> Easy to repro: perl -MDevel::Peek=Dump -E'version-
> >new("v5.22.0");Dump(\%version::)'
> > Or: > $ gdb --args perl -E'version->new("v5.22.0");dump' > (gdb) run > (gdb) p *(XPVHV*)(Perl_get_hv("version::", 0)->sv_any) > > $3 = {xmg_stash = 0x18, xmg_u = {xmg_magic = 0xae1270, xmg_hash_index > = > 11407984}, xhv_keys = 31, > xhv_max = 31} > > (gdb) p Perl_sv_dump(Perl_get_hv("version::", 0)) > SEGV at HvNAME_get(sv) with 0x18 > > I haven't out yet where you write this 0x18. > This bug is in core since 5.18 > > See also https://rt.cpan.org/Ticket/Display.html?id=81635 where I have > out about this bug.
I can also reproduce this by doing «perl -MEnv -MDevel::Peek -E 'print Dump(\%Env::)», so it doesn't look like an issue in version.pm. I bisected it to 7cc6787e. My quick reading would be that sv_dump shouldn't threat SvSTASH as a usable pointer unless SvOBJECT is true. Leon
Turns out this is a bug in Perl itself, so rejecting.