Ticket #256 (closed bug: fixed)
bad PAST->PIR generation
Reported by: | TiMBuS | Owned by: | pmichaud |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | PCT | Version: | trunk |
Severity: | medium | Keywords: | |
Cc: | Language: | ||
Patch status: | Platform: | linux |
Description
Ok, this one is just strange. My compiler has stopped working today, and I've pinned it down to a malformed PIR instruction when I try to construct a method call with exactly seven arguments. Yes, it works with any other number of arguments.
So, when given the following PAST:
"past" => PMC 'PAST;Block' { <blocktype> => "declaration" <pirflags> => ":load" [0] => PMC 'PAST;Op' { <name> => "push" <pasttype> => "callmethod" [0] => PMC 'PAST;Var' { <name> => "funstack" <scope> => "package" <namespace> => "private" } [1] => PMC 'PAST;Val' { <value> => "1" <returns> => "Integer" } [2] => PMC 'PAST;Val' { <value> => "2" <returns> => "Integer" } [3] => PMC 'PAST;Val' { <value> => "3" <returns> => "Integer" } [4] => PMC 'PAST;Val' { <value> => "4" <returns> => "Integer" } [5] => PMC 'PAST;Val' { <value> => "5" <returns> => "Integer" } [6] => PMC 'PAST;Val' { <value> => "6" <returns> => "Integer" } [7] => PMC 'PAST;Val' { <value> => "7" <returns> => "Integer" } } }
I will get the following PIR:
.namespace [] .sub "_block11" :load :anon :subid("10") get_hll_global $P13, ["private"], "funstack" $P14 = 1."push"(2, 3, 4, 5, 6, 7, ) .return ($P14) .end
Which is broken. it should be $P14 = $P13."push"(1, 2, 3, 4, 5, 6, 7)
Sometimes, instead of the off-by-one thing above, it will get a crash and the following error:
*** glibc detected *** ../../parrot: realloc(): invalid next size: 0x00000000028197e0 *** ======= Backtrace: ========= /lib/libc.so.6[0x7fc189000938] /lib/libc.so.6[0x7fc189004c31] /lib/libc.so.6(realloc+0x12e)[0x7fc189005abe] /home/timbus/parrot/blib/lib/libparrot.so.0.9.0(mem_sys_realloc+0x2b)[0x7fc18a0baa7b] /home/timbus/parrot/blib/lib/libparrot.so.0.9.0(Parrot_ResizablePMCArray_set_integer_native+0x131)[0x7fc18a2c3531] /home/timbus/parrot/blib/lib/libparrot.so.0.9.0(Parrot_ResizablePMCArray_push_pmc+0x40)[0x7fc18a2bf640] /home/timbus/parrot/blib/lib/libparrot.so.0.9.0(Parrot_process_args+0x461)[0x7fc18a0c8ec1] /home/timbus/parrot/blib/lib/libparrot.so.0.9.0(parrot_pass_args+0x1ab)[0x7fc18a0c928b] /home/timbus/parrot/blib/lib/libparrot.so.0.9.0(Parrot_get_params_pc+0xd3)[0x7fc18a06f543] /home/timbus/parrot/blib/lib/libparrot.so.0.9.0[0x7fc18a105365] /home/timbus/parrot/blib/lib/libparrot.so.0.9.0[0x7fc18a0cd9c5] /home/timbus/parrot/blib/lib/libparrot.so.0.9.0[0x7fc18a0ce4ca] /home/timbus/parrot/blib/lib/libparrot.so.0.9.0[0x7fc18a0ce8a8] /home/timbus/parrot/blib/lib/libparrot.so.0.9.0(Parrot_runops_fromc_args+0x17c)[0x7fc18a0cfc7c] /home/timbus/parrot/blib/lib/libparrot.so.0.9.0(Parrot_runcode+0x27e)[0x7fc18a0a9e9e] /home/timbus/parrot/blib/lib/libparrot.so.0.9.0[0x7fc18a2fad64] /home/timbus/parrot/blib/lib/libparrot.so.0.9.0(imcc_run+0x377)[0x7fc18a2fb9f7] ../../parrot[0x400ba4] /lib/libc.so.6(__libc_start_main+0xe6)[0x7fc188fa5466] ../../parrot[0x400a49]
I'm not sure how to even work around this.. what is going on?
This is a clean checkout of parrot, r36168, running on ubuntu 8.10 64-bit.
Attachments
Change History
Note: See
TracTickets for help on using
tickets.