Re: Access violation in SV.C new_body_inline()

"John E. Malmberg" <[email protected]>
Newsgroups gmane.comp.lang.perl.perl5.porters,gmane.comp.lang.perl.ports.vms
Message-ID <[email protected]>
John E. Malmberg wrote:
> John E. Malmberg wrote:
>> Nicholas Clark wrote:
>>> On Mon, Apr 27, 2009 at 12:27:02AM -0500, John E. Malmberg wrote:
>>>> I just started looking into a failure of 19_CPANPLUS-Dist.  I have 
>>>> not determined what exactly is wrong, and am out of time for the 
>>>> moment.
>>>>
>>>> I will try to get some more information later.
>>>>
>>>> It is failing from an access violation in SV.C.
>>>>
>>>> ok 57 -    Perl version not high enough
>>>> %SYSTEM-F-ACCVIO, access violation, reason mask=00, virtual 
>>>> address=000000000000002C, PC=00000000000F9AB8, PS=0000001B
>>>> %TRACE-F-TRACEBACK, symbolic stack dump follows
>>>>   image    module    routine             line      rel PC
>>>> abs PC
>>>>  DBGPERLSHR  SV  Perl_sv_upgrade        73671 0000000000001F58 
> 
>>> #define new_body_inline(xpv, sv_type) \
>>>     STMT_START { \
>>>     void ** const r3wt = &PL_body_roots[sv_type]; \
>>>     xpv = (PTR_TBL_ENT_t*) (*((void **)(r3wt))      \
>>>       ? *((void **)(r3wt)) : more_bodies(sv_type)); \
>>>     *(r3wt) = *(void**)(xpv); \
>>>     } STMT_END
>>>
>>> I'm curious what the value of sv_type is. It's the second (real) 
>>> parameter:
>>>
>>> void
>>> Perl_sv_upgrade(pTHX_ register SV *const sv, svtype new_type)
>>
>> case SVt_PVMG:
>>      ...
>>     new_body_inline(new_body, new_type);
>>
>> new_type = SVt_PVMG,
>> SVt_PVMG has a value of 7.
>>
>> new_body = 44.
>>
>> PL_Body_roots[sv_type] = 44.
>>
>>  From the code, it looks like this was expected to contain a valid 
>> pointer.
> 
>  From looking at the source code, it appears that the linked list of 
> bodies is corrupted.  my_perl->Ibodyroots[7] has 44.
> 
> I have been looking at the S_more_bodies routine.  Would it be practical 
> to put an assert on for a pointer being added to the linked list with a 
> value above 512?  On VMS, the first page of memory is protected no access.

I put a modified test script at 
http://eisner.encompasserve.org/~malmberg/perl/19_CPANPLUS-DIST.TXT

I commented out as much as I could and still reproduce the access violation.

-John
[email protected]
Personal Opinion Only
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.