Skip to content

Instantly share code, notes, and snippets.

@tadzik
Created September 1, 2012 17:24
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 tadzik/3580903 to your computer and use it in GitHub Desktop.
Save tadzik/3580903 to your computer and use it in GitHub Desktop.
┌─[tadzik@yavin4]─[~]
└─[%]─> cat threads.pl
my Mu $x := 42;
sub foo {
nqp::say($x);
}
my Mu $code := nqp::getattr(&foo, Code, '$!do');
nqp::say pir::typeof__SP $code;
my Mu $task := pir::new__PSP('Task', $code);
nqp::say pir::typeof__SP $task;
pir::schedule__0P($task);
┌─[tadzik@yavin4]─[~]
└─[%]─> gdb perl6
GNU gdb (GDB) 7.4.1-debian
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/tadzik/src/parrot/install/bin/perl6...(no debugging symbols found)...done.
(gdb) run threads.pl
Starting program: /home/tadzik/src/parrot/install/bin/perl6 threads.pl
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff423c700 (LWP 5060)]
Sub
Task
[New Thread 0x7fffef247700 (LWP 5062)]
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffef247700 (LWP 5062)]
0x0000000000000000 in ?? ()
(gdb) bt
#0 0x0000000000000000 in ?? ()
#1 0x00007ffff7a5592f in Parrot_pmc_new ()
from /home/tadzik/src/parrot/install/lib/libparrot.so.4.7.0
#2 0x00007ffff7a2e8ce in Parrot_ex_build_exception ()
from /home/tadzik/src/parrot/install/lib/libparrot.so.4.7.0
#3 0x00007ffff79fc45f in Parrot_ex_throw_from_c_args ()
from /home/tadzik/src/parrot/install/lib/libparrot.so.4.7.0
#4 0x00007ffff7a6fdab in cant_do_method ()
from /home/tadzik/src/parrot/install/lib/libparrot.so.4.7.0
#5 0x00007ffff7a6ffae in Parrot_default_get_integer ()
from /home/tadzik/src/parrot/install/lib/libparrot.so.4.7.0
#6 0x00007ffff7a7eb7b in Parrot_Timer_init_pmc ()
from /home/tadzik/src/parrot/install/lib/libparrot.so.4.7.0
#7 0x00007ffff7a55b3f in Parrot_pmc_new_init ()
from /home/tadzik/src/parrot/install/lib/libparrot.so.4.7.0
#8 0x00007ffff7a812b6 in Parrot_Sub_invoke ()
from /home/tadzik/src/parrot/install/lib/libparrot.so.4.7.0
#9 0x00007ffff7a3b24a in Parrot_pcc_invoke_from_sig_object ()
from /home/tadzik/src/parrot/install/lib/libparrot.so.4.7.0
#10 0x00007ffff7a2f32c in Parrot_ext_call ()
from /home/tadzik/src/parrot/install/lib/libparrot.so.4.7.0
#11 0x00007ffff7b11b86 in Parrot_Task_invoke ()
from /home/tadzik/src/parrot/install/lib/libparrot.so.4.7.0
#12 0x00007ffff7a3b24a in Parrot_pcc_invoke_from_sig_object ()
from /home/tadzik/src/parrot/install/lib/libparrot.so.4.7.0
#13 0x00007ffff7a2f32c in Parrot_ext_call ()
from /home/tadzik/src/parrot/install/lib/libparrot.so.4.7.0
#14 0x00007ffff7a5b46e in Parrot_thread_outer_runloop ()
from /home/tadzik/src/parrot/install/lib/libparrot.so.4.7.0
#15 0x00007ffff6cbab50 in start_thread (arg=<optimized out>)
at pthread_create.c:304
#16 0x00007ffff4a5b70d in clone ()
at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#17 0x0000000000000000 in ?? ()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment