Skip to content

Instantly share code, notes, and snippets.

@dogbert17
Last active December 5, 2016 12: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 dogbert17/c88ee798bb0789708ffcf5e4960e885b to your computer and use it in GitHub Desktop.
Save dogbert17/c88ee798bb0789708ffcf5e4960e885b to your computer and use it in GitHub Desktop.
t/04-nativecall/08-callbacks.t
dogbert@dogbert-VirtualBox ~/repos/rakudo $ ./perl6-valgrind-m t/04-nativecall/08-callbacks.t
================================================================================================
This is Rakudo Perl 6 running in valgrind, a tool for debugging and profiling programs.
Running a program in valgrind usually takes *a lot* more time than running it directly,
so please be patient.
This Rakudo version is 2016.11.134.gb.96.bf.5.bd.0 built on MoarVM version 2016.11.25.g.4.be.6.b.384,
running on ubuntu (14.04.3.LTS.Trusty.Tahr) / linux (3.19.0.32.generic)
------------------------------------------------------------------------------------------------
==31218== Memcheck, a memory error detector
==31218== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==31218== Using Valgrind-3.10.1 and LibVEX; rerun with -h for copyright info
==31218== Command: /home/dogbert/repos/rakudo/install/bin/moar --full-cleanup --execname=./perl6-valgrind-m --libpath=/home/dogbert/repos/rakudo/install/share/nqp/lib --libpath=/share/nqp/lib --libpath=. /home/dogbert/repos/rakudo/perl6.moarvm --nqp-lib=blib t/04-nativecall/08-callbacks.t
==31218==
1..8
ok 1 - simple callback
==31218== Invalid read of size 4
==31218== at 0x41BFEA3: ??? (in /home/dogbert/repos/rakudo/install/lib/libmoar.so)
==31218== Address 0xbeefcb94 is on thread 1's stack
==31218== 12 bytes below stack pointer
==31218==
==31218== Invalid read of size 4
==31218== at 0x41BFEAD: ??? (in /home/dogbert/repos/rakudo/install/lib/libmoar.so)
==31218== Address 0xbeefcb98 is on thread 1's stack
==31218== 4 bytes below stack pointer
==31218==
==31218== Invalid read of size 4
==31218== at 0x41BFEB8: ??? (in /home/dogbert/repos/rakudo/install/lib/libmoar.so)
==31218== by 0x41BF644: ??? (in /home/dogbert/repos/rakudo/install/lib/libmoar.so)
==31218== by 0x41BF041: dc_callvm_call_x86_cdecl (in /home/dogbert/repos/rakudo/install/lib/libmoar.so)
==31218== by 0x41BEC16: dcCallVoid (in /home/dogbert/repos/rakudo/install/lib/libmoar.so)
==31218== by 0x4103BA5: MVM_nativecall_invoke (nativecall_dyncall.c:584)
==31218== by 0x40DC2DD: MVM_interp_run (interp.c:3952)
==31218== by 0x41BC557: MVM_vm_run_file (moar.c:309)
==31218== by 0x8048EA5: main (main.c:192)
==31218== Address 0xbeefcb78 is on thread 1's stack
==31218== 36 bytes below stack pointer
==31218==
==31218== Invalid read of size 4
==31218== at 0x41BFEBA: ??? (in /home/dogbert/repos/rakudo/install/lib/libmoar.so)
==31218== by 0x41BF644: ??? (in /home/dogbert/repos/rakudo/install/lib/libmoar.so)
==31218== by 0x41BF041: dc_callvm_call_x86_cdecl (in /home/dogbert/repos/rakudo/install/lib/libmoar.so)
==31218== by 0x41BEC16: dcCallVoid (in /home/dogbert/repos/rakudo/install/lib/libmoar.so)
==31218== by 0x4103BA5: MVM_nativecall_invoke (nativecall_dyncall.c:584)
==31218== by 0x40DC2DD: MVM_interp_run (interp.c:3952)
==31218== by 0x41BC557: MVM_vm_run_file (moar.c:309)
==31218== by 0x8048EA5: main (main.c:192)
==31218== Address 0xbeefcb7c is on thread 1's stack
==31218== 32 bytes below stack pointer
==31218==
ok 2 - int callback argument
ok 3 - string callback argument
ok 4 - struct callback string argument
ok 5 - struct callback int argument
==31218== Invalid read of size 8
==31218== at 0x41BFEC1: ??? (in /home/dogbert/repos/rakudo/install/lib/libmoar.so)
==31218== by 0x41BF644: ??? (in /home/dogbert/repos/rakudo/install/lib/libmoar.so)
==31218== by 0x41BF041: dc_callvm_call_x86_cdecl (in /home/dogbert/repos/rakudo/install/lib/libmoar.so)
==31218== by 0x41BEC92: dcCallInt (in /home/dogbert/repos/rakudo/install/lib/libmoar.so)
==31218== by 0x4103C84: MVM_nativecall_invoke (nativecall_dyncall.c:584)
==31218== by 0x40DC2DD: MVM_interp_run (interp.c:3952)
==31218== by 0x41BC557: MVM_vm_run_file (moar.c:309)
==31218== by 0x8048EA5: main (main.c:192)
==31218== Address 0xbeefcb68 is on thread 1's stack
==31218== 36 bytes below stack pointer
==31218==
ok 6 - callback returned a float to C
==31218== Invalid read of size 4
==31218== at 0x41BFEB8: ??? (in /home/dogbert/repos/rakudo/install/lib/libmoar.so)
==31218== by 0x41BF644: ??? (in /home/dogbert/repos/rakudo/install/lib/libmoar.so)
==31218== by 0x41BF041: dc_callvm_call_x86_cdecl (in /home/dogbert/repos/rakudo/install/lib/libmoar.so)
==31218== by 0x41BEC92: dcCallInt (in /home/dogbert/repos/rakudo/install/lib/libmoar.so)
==31218== by 0x4103C84: MVM_nativecall_invoke (nativecall_dyncall.c:584)
==31218== by 0x40DC2DD: MVM_interp_run (interp.c:3952)
==31218== by 0x41BC557: MVM_vm_run_file (moar.c:309)
==31218== by 0x8048EA5: main (main.c:192)
==31218== Address 0xbeefcb58 is on thread 1's stack
==31218== 36 bytes below stack pointer
==31218==
==31218== Invalid read of size 4
==31218== at 0x41BFEBA: ??? (in /home/dogbert/repos/rakudo/install/lib/libmoar.so)
==31218== by 0x41BF644: ??? (in /home/dogbert/repos/rakudo/install/lib/libmoar.so)
==31218== by 0x41BF041: dc_callvm_call_x86_cdecl (in /home/dogbert/repos/rakudo/install/lib/libmoar.so)
==31218== by 0x41BEC92: dcCallInt (in /home/dogbert/repos/rakudo/install/lib/libmoar.so)
==31218== by 0x4103C84: MVM_nativecall_invoke (nativecall_dyncall.c:584)
==31218== by 0x40DC2DD: MVM_interp_run (interp.c:3952)
==31218== by 0x41BC557: MVM_vm_run_file (moar.c:309)
==31218== by 0x8048EA5: main (main.c:192)
==31218== Address 0xbeefcb5c is on thread 1's stack
==31218== 32 bytes below stack pointer
==31218==
ok 7 - callback returned a string to C
ok 8 - callback returned a struct to C
==31218==
==31218== HEAP SUMMARY:
==31218== in use at exit: 153,694 bytes in 48,366 blocks
==31218== total heap usage: 464,424 allocs, 416,058 frees, 111,705,000 bytes allocated
==31218==
==31218== LEAK SUMMARY:
==31218== definitely lost: 5,707 bytes in 43,906 blocks
==31218== indirectly lost: 14,295 bytes in 677 blocks
==31218== possibly lost: 120,032 bytes in 3,751 blocks
==31218== still reachable: 13,660 bytes in 32 blocks
==31218== suppressed: 0 bytes in 0 blocks
==31218== Rerun with --leak-check=full to see details of leaked memory
==31218==
==31218== For counts of detected and suppressed errors, rerun with: -v
==31218== ERROR SUMMARY: 27 errors from 7 contexts (suppressed: 0 from 0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment