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