Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parrot segfaults after subtype type check fails #218

Closed
p6rt opened this issue Aug 7, 2008 · 5 comments
Closed

Parrot segfaults after subtype type check fails #218

p6rt opened this issue Aug 7, 2008 · 5 comments

Comments

@p6rt
Copy link

p6rt commented Aug 7, 2008

Migrated from rt.perl.org#57710 (status was 'resolved')

Searchable as RT57710$

@p6rt
Copy link
Author

p6rt commented Aug 7, 2008

From @masak

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.

@p6rt
Copy link
Author

p6rt commented Aug 7, 2008

From @chromatic

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

@p6rt
Copy link
Author

p6rt commented Aug 7, 2008

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Nov 23, 2008

From @masak

This works now.

@p6rt
Copy link
Author

p6rt commented Nov 23, 2008

@masak - Status changed from 'open' to 'resolved'

@p6rt p6rt closed this as completed Nov 23, 2008
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant