On Thursday 07 August 2008 05:16:40 Carl Mäsak wrote: > r30087: > $ ./perl6 -e 'subset A of Int where 1; my A $a = 1' # this works > $ ./perl6 -e 'subset A of Int where 1; my A $a = 0' # this fails (as > it should) but segfaults > Type check failed > [...] > Segmentation fault > > I was not able to produce a failing type check of any kind without > also triggering the segfault.
It's not really a segfault, but libc sending SIGABRT on a dodgy memory free: Program received signal SIGABRT, Aborted. [Switching to Thread 0xb7b988d0 (LWP 9520)] 0xb7f5f410 in __kernel_vsyscall () (gdb) bt #0 0xb7f5f410 in __kernel_vsyscall () #1 0x4810b085 in raise () from /lib/tls/i686/cmov/libc.so.6 #2 0x4810ca01 in abort () from /lib/tls/i686/cmov/libc.so.6 #3 0x4814e835 in free_check () from /lib/tls/i686/cmov/libc.so.6 #4 0x4814f495 in free () from /lib/tls/i686/cmov/libc.so.6 #5 0xb7cf7a01 in mem_sys_free (from=0x0) at src/gc/memory.c:304 #6 0xb7cf813a in destroy_context (interp=0x81e6008) at src/gc/register.c:163 #7 0xb7cfeb5b in Parrot_really_destroy (interp=0x81e6008, exit_code_unused=1, arg_unused=0x0) at src/inter_create.c:444 #8 0xb7cf1a99 in Parrot_exit (interp=0x81e6008, status=1) at src/exit.c:89 #9 0xb7cf1466 in find_exception_handler (interp=0x81e6008, exception=0x4822b864) at src/exceptions.c:149 #10 0xb7cf14f7 in Parrot_ex_throw_from_c (interp=0x81e6008, exception=0xb778cb30) at src/exceptions.c:259 #11 0xb7cf19a1 in Parrot_ex_throw_from_c_args (interp=0x81e6008, ret_addr=0x0, exitcode=20, format=0xb7ae3528 <Address 0xb7ae3528 out of bounds>) at src/exceptions.c:339 The relevant code is: /* clear freed contexts */ for (slot = 0; slot < interp->ctx_mem.n_free_slots; ++slot) { void *ptr = interp->ctx_mem.free_list[slot]; while (ptr) { void * const next = *(void **) ptr; mem_sys_free(ptr); ptr = next; } } mem_sys_free(interp->ctx_mem.free_list); ... and slot is 8. I don't know how many links in the list it has gone through though. I'll keep digging, unless someone else beats me to it first. (The rest of the backtrace is amusing. It appears that an exception handler catches the "Class already registered" exception, then tries to register another class, which throws the same exception, and eventually it fails.) -- c