On Fri, 01 Jul 2016 22:36:25 -0700, lloyd.fo...@gmail.com wrote:
> class Foo { has $.a = Metamodel::ClassHOW.new_type(name => "Bar");
> method
> comp { $!a.^compose } };
> my $obj = Foo.new;
> $obj.comp;
> say $obj;
> 
> Program received signal SIGSEGV, Segmentation fault.
> MVM_6model_istype (tc=0x6037c0, obj=0x207fff00000001, type=0xe19b28,
> res=0xea2308) at src/6model/6model.c:287
> 287    st    = STABLE(obj);
> (gdb) bt
> #0  MVM_6model_istype (tc=0x6037c0, obj=0x207fff00000001,
> type=0xe19b28,
> res=0xea2308) at src/6model/6model.c:287
> #1  0x00007ffff78cecc8 in MVM_interp_run (tc=tc@entry=0x6037c0,
> initial_invoke=0x603010, invoke_data=0xe19b28) at
> src/core/interp.c:1777
> #2  0x00007ffff798c589 in MVM_vm_run_file (instance=0x603010,
> filename=0x7fffffffe323
> "/home/llfourn/.rakudobrew/moar-
> nom/install/share/perl6/runtime/perl6.moarvm")
>     at src/moar.c:304
> #3  0x0000000000401047 in main (argc=8, argv=0x7fffffffdec8) at
> src/main.c:191
> (gdb) p STABLE(obj)
> Cannot access memory at address 0x207fff00000011
> 
> =======
> This seems to be caused by doing .^compose on a $! sigiled attribute.

The SEGV was thanks to MoarVM accidentally allowing recomposition of a 
P6opaque; I added a check to forbid this and that had the code reliably failing 
instead of SEGVing. A second fix in the MOP code to always decontainerize the 
argument to the composetype op was the second part, and this code now works 
fine. Added a test in S12-meta/classhow.t.

/jnthn

Reply via email to