#218: can't sort a PIR subclass of an RPA.
--------------------+-------------------------------------------------------
Reporter: coke | Owner: whiteknight
Type: bug | Status: assigned
Priority: normal | Milestone: 1.1
Component: core | Version:
Severity: high | Keywords: tcl blocker
Lang: | Patch:
Platform: all |
--------------------+-------------------------------------------------------
Comment(by whiteknight):
In r38217 I made a small change to the sort method. Previously, it was
using the macro PMC_size() to determine the number of elements in the
array, which only worked with FixedPMCArray PMCs, and not subclasses. So I
changed that to a call to VTABLE_elements, which solves that one problem.
Of course, that didn't solve the ticket entirely (or I would have closed
it). It gets past the part where it was failing previously, and now
segfaults somewhere in the call to the comparison PIR function. I don't
have time to dig into it tonight. Here's the backtrace in case anybody
wants to play with it:
{{{
Program received signal SIGSEGV, Segmentation fault.
0x00007f1f053c5382 in Parrot_convert_arg (interp=0x6fd080,
st=0x7fff0db07860)
at src/call/pcc.c:1126
1126 UVal_str(st->val) = VTABLE_get_string(interp,
UVal_pmc(st->val));
(gdb) bt
#0 0x00007f1f053c5382 in Parrot_convert_arg (interp=0x6fd080,
st=0x7fff0db07860) at src/call/pcc.c:1126
#1 0x00007f1f053c5ad2 in Parrot_process_args (interp=0x6fd080,
st=0x7fff0db07860, param_or_result=<value optimized out>)
at src/call/pcc.c:1705
#2 0x00007f1f053c6942 in parrot_pass_args_fromc (interp=0x6fd080,
sig=0x7f1f0556b42c "PP", dest=0x85fef8, old_ctxp=0x85bee0,
ap=0x7fff0db07a00) at src/call/pcc.c:1927
#3 0x00007f1f053c9c39 in runops_args (interp=0x6fd080, sub=0x7f9480,
obj=0x7862c0, meth_unused=<value optimized out>, sig=0x7f1f0556b42b
"IPP",
ap=0x7fff0db07a00) at src/call/ops.c:241
#4 0x00007f1f053ca377 in Parrot_runops_fromc_args_reti (interp=0x6fd080,
sub=0x0, sig=0x7f1f0556b42b "IPP") at src/call/ops.c:403
#5 0x00007f1f0541386e in Parrot_quicksort (interp=0x6fd080,
data=0x7f6db0,
n=2, cmp=0x7f9480) at src/utils.c:941
#6 0x00007f1f054ede2f in Parrot_FixedPMCArray_nci_sort (interp=0x6fd080,
pmc=<value optimized out>) at ./src/pmc/fixedpmcarray.pmc:50
#7 0x00007f1f054991a2 in Parrot_NCI_invoke (interp=0x6fd080, pmc=0x0,
next=0x85feb0) at ./src/pmc/nci.pmc:329
#8 0x00007f1f0540bafd in runops_slow_core (interp=0x6fd080, pc=0x85fe98)
at src/runops_cores.c:461
#9 0x00007f1f053c8ef2 in runops_int (interp=0x6fd080, offset=0)
at src/interpreter.c:982
#10 0x00007f1f053c9a5b in runops (interp=0x6fd080, offs=<value optimized
out>)
at src/call/ops.c:107
#11 0x00007f1f053c9bd0 in runops_args (interp=0x6fd080, sub=0x7f94e0,
obj=<value optimized out>, meth_unused=<value optimized out>,
sig=0x7f1f0555d9c5 "vP", ap=0x7fff0db07cf0) at src/call/ops.c:255
#12 0x00007f1f053ca5c7 in Parrot_runops_fromc_args (interp=0x6fd080,
sub=0x0,
sig=0x7f1f0555d9c5 "vP") at src/call/ops.c:324
#13 0x00007f1f0554c7a3 in imcc_run (interp=0x6fd080,
sourcefile=0x7fff0db086e1 "subclasstest.pir", argc=1,
argv=0x7fff0db07f40)
at compilers/imcc/main.c:806
#14 0x0000000000400bb2 in main (argc=1, argv=0x7fff0db07f40) at
src/main.c:61
}}}
--
Ticket URL: <https://trac.parrot.org/parrot/ticket/218#comment:6>
Parrot <https://trac.parrot.org/parrot/>
Parrot Development
_______________________________________________
parrot-tickets mailing list
[email protected]
http://lists.parrot.org/mailman/listinfo/parrot-tickets