# New Ticket Created by  Mark Glines 
# Please include the string:  [perl #53754]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=53754 >


[this is a resend; first one apparently didn't get through.]


There is a TODO comment in this function, which has been there for
quite some time.  We need to figure out if this is still valid, and
either make the change, or remove the comment.

>From src/packfile.c:

    /*
     * TODO use thaw_constants
     * current issue: a constant Sub with attached properties
     *                doesn't DOD mark the properties
     * for a constant PMC *all* contents have to be in the constant pools */
    pmc = Parrot_thaw(interp, image);


I noticed this comment while looking into that Parrot_thaw line for other
reasons... specifically, valgrind is reporting a leak from this line.

So I was curious.  I changed Parrot_thaw to Parrot_thaw_constant, and it
built fine.  But the change causes the following tests to fail:

Failed Test           Stat Wstat Total Fail  List of Failed
-------------------------------------------------------------------------------
t/library/iter.t         0    11    47   42  27-47
t/library/range.t        0    11    78   80  39-78
t/op/cmp-nonbranch.t     0    11    88   58  60-88
t/pmc/hash.t             1   256   147  242  27-147
t/pmc/n_arithmetics.t    0    11    73   70  39-73


4 out of 5 of those failures are caused by a segfault in mmd_distance():

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x2ac127b99cf0 (LWP 22652)]
0x00002ac1229cf74d in mmd_distance (interp=0x60a080, pmc=0x9e2f58, 
arg_tuple=0x9c7880) at src/mmd.c:1520
1520            if (multi_sig->vtable->base_type == enum_class_FixedPMCArray) {
(gdb) bt
#0  0x00002ac1229cf74d in mmd_distance (interp=0x60a080, pmc=0x9e2f58, 
arg_tuple=0x9c7880) at src/mmd.c:1520
#1  0x00002ac1229cfa38 in mmd_sort_candidates (interp=0x60a080, 
arg_tuple=0x9c7880, cl=0x9c6ea8) at src/mmd.c:1649
#2  0x00002ac1229cebcf in Parrot_mmd_sort_candidate_list (interp=0x60a080, 
candidates=0x9c6ea8) at src/mmd.c:1124
#3  0x00002ac122b26111 in Parrot_MultiSub_invoke (interp=0x60a080, 
pmc=0xa16428, next=0xaa31e8) at ./src/pmc/multisub.pmc:61
#4  0x00002ac12294080c in Parrot_invokecc_p (cur_opcode=0xaa31d8, 
interp=0x60a080) at src/ops/core.ops:413
#5  0x00002ac1229f4767 in runops_slow_core (interp=0x60a080, pc=0xaa31d8) at 
src/runops_cores.c:219
#6  0x00002ac1229c605d in runops_int (interp=0x60a080, offset=0) at 
src/interpreter.c:916
#7  0x00002ac1229c6ae0 in runops (interp=0x60a080, offs=0) at 
src/inter_run.c:104
#8  0x00002ac1229c6d78 in runops_args (interp=0x60a080, sub=0xa175a8, 
obj=0x65ac00, meth_unused=0x0, sig=0x2ac122bb3133 "vP", ap=0x7fff88525230) at 
src/inter_run.c:230
#9  0x00002ac1229c6f6b in Parrot_runops_fromc_args (interp=0x60a080, 
sub=0xa175a8, sig=0x2ac122bb3133 "vP") at src/inter_run.c:299
#10 0x00002ac1229ac92e in Parrot_runcode (interp=0x60a080, argc=1, 
argv=0x7fff88525520) at src/embed.c:941
#11 0x00002ac122b8e3f8 in imcc_run_pbc (interp=0x60a080, obj_file=0, 
output_file=0x0, argc=1, argv=0x7fff88525520) at compilers/imcc/main.c:781
#12 0x00002ac122b8ecf7 in imcc_run (interp=0x60a080, sourcefile=0x7fff88527350 
"t/pmc/n_arithmetics.t", argc=1, argv=0x7fff88525520) at 
compilers/imcc/main.c:1069
#13 0x0000000000400c34 in main (argc=1, argv=0x7fff88525520) at src/main.c:61
(gdb) print multi_sig
$3 = (PMC *) 0xae3a90
(gdb) print multi_sig->vtable
$4 = (VTABLE *) 0xdeadbeef

Reply via email to