[perl #39807] [BUG] load_bytecode of .pir files fails (sometimes)

Klaas-Jan Stol via RT parrotbug-followup at parrotcode.org
Sun Jan 4 14:38:08 UTC 2009


On Sun Jan 04 06:03:03 2009, rurban wrote:
> The imcc problem is still there. Found by testing TT #127.
> 
> If in Data/Dumper/Default.pir,
>   load_bytecode "Data/Dumper/Base"
> is used, it fails. With
>   load_bytecode "Data/Dumper/Base.pbc"
> it works fine.
> 
> The error is visible in t/pmc/sub.t tests 54+55, marked with #39807
> if you do the above change to Data/Dumper/Default.pir.
> The library loader Parrot_locate_runtime_file_str() works fine and is
> tested in t/op/load_bytecode.t
> 
> error:imcc:syntax error, unexpected $end (' ')
>         in file
> 
'/usr/src/perl/parrot/branches/pdd30install_stage3/runtime/parrot/librar
y/Data/Dumper/Base.pbc'
> line 1
> Null PMC access in get_string()
> current instr.: '__library_data_dumper_default_onload' pc 13
> (runtime/parrot/library/Data/Dumper/Default.pir:29)
> called from Sub '__library_data_dumper_onload' pc 8
> (runtime/parrot/library/Data/Dumper.pir:9)
> called from Sub '_global_dumper' pc 106
> 
(/usr/src/perl/parrot/branches/pdd30install_stage3/runtime/parrot/librar
y/dumper.pir:153)
> called from Sub '_dumper' pc 26
> 
(/usr/src/perl/parrot/branches/pdd30install_stage3/runtime/parrot/librar
y/dumper.pir:84)
> called from Sub 'main' pc 33 (t-sub1.pir:10)
> 
> The trace shows some off-by-one string failures:
> 
>     98 get_class P0, "Data::Dumper"     P0=PMCNULL
>    101 if_null P0, 5                    P0=PMCNULL
>    106 load_bytecode "Data/Dumper.pbc"
>      0 get_class P1, "Data::Dumper"     P1=PMCNULL
>      3 if_null P1, 5                    P1=PMCNULL
>      8 load_bytecode "Data/Dumper/Default."
>      0 get_class P1, "Data::Dumper::Defaul"     P1=PMCNULL
>      3 if_null P1, 5                    P1=PMCNULL
>      8 load_bytecode "Data/Dumper/Base"

I doubt whether it's IMCC. Compiling this to bytecode:

.sub main
    load_bytecode "test.pir"
.end

and disassembling gives:

  Seq_Op_Num- Relative-PC SrcLn#:
Current Source Filename loadbc.pir
000000000000-000000000000 000002:       load_bytecode_sc "test.pir"
000000000001-000000000002 000002:       set_returns_pc PMC_CONST(2)
000000000002-000000000004 000002:       returncc

So, the string test.pir is still there, implying imcc parses it 
correctly, I think.

kjs






More information about the parrot-dev mailing list