Created
June 1, 2013 15:39
-
-
Save arnsholt/5690787 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
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
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