Skip to content

Instantly share code, notes, and snippets.

@arnsholt
Created June 1, 2013 15:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arnsholt/5690787 to your computer and use it in GitHub Desktop.
Save arnsholt/5690787 to your computer and use it in GitHub Desktop.
# Expects to be live in .../zavolaj/
use lib '.';
use t::CompileTestLib;
use NativeCall;
compile_test_lib('08-callbacks');
sub TakeACallback(&cb()) is native('./08-callbacks') { * }
sub simple_callback() {
say 'simple callback';
}
TakeACallback(&simple_callback);
pir::sweep__vi(1);
# vim:ft=perl6
@leto
Copy link

leto commented Jun 1, 2013

Just for the elucidation of others working on this, the last line of code (the call to sweep) is what triggers the problem.

There is some kind of memory corruption going on, because one of the pointers just before the segfault has a pointer value of 0x21, which is an invalid memory address.

We are currently debugging this at the YAPC::NA hackathon

@leto
Copy link

leto commented Jun 1, 2013

And for reference, the pointer value changes a bit on each run (it could be a counter getting overridden a pointer) but it is consistently a very low hexadecimal number that is not a valid memory address.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment