Skip to content

Instantly share code, notes, and snippets.

@dogbert17
Created October 6, 2016 19:19
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/b763306be530345d1da3a50323a56228 to your computer and use it in GitHub Desktop.
Save dogbert17/b763306be530345d1da3a50323a56228 to your computer and use it in GitHub Desktop.
Valgrind t/04-nativecall/15-rw-args.t on a 32 bit Linux VM
================================================================================================
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.09.132.gff.50.cef built on MoarVM version 2016.09.13.g.34.c.375.a,
running on ubuntu (14.04.3.LTS.Trusty.Tahr) / linux (3.19.0.32.generic)
------------------------------------------------------------------------------------------------
==14416== Memcheck, a memory error detector
==14416== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==14416== Using Valgrind-3.10.1 and LibVEX; rerun with -h for copyright info
==14416== Command: /home/dogbert/repos/rakudo/install/bin/moar --full-cleanup --execname=./perl6-valgrind-m --libpath=/home/dogbert/repos/rakudo/install/share/nqp/lib --libpath=. /home/dogbert/repos/rakudo/perl
6.moarvm -Ilib t/04-nativecall/15-rw-args.t
==14416==
1..22
ok 1 - Perl's rw variable was set by C (char)
ok 2 - Perl's rw variable was passed and returned by C (char)
ok 3 - Perl's rw variable was set by C (short)
ok 4 - Perl's rw variable was passed and returned by C (short)
ok 5 - Perl's rw variable was set by C (long)
ok 6 - Perl's rw variable was passed and returned by C (long)
==14416== Invalid write of size 4
==14416== at 0x410A492: MVM_nativecall_invoke (nativecall_dyncall.c:491)
==14416== by 0x40DC506: MVM_interp_run (interp.c:3955)
==14416== by 0x41C87D2: MVM_vm_run_file (moar.c:304)
==14416== by 0x8048EA5: main (main.c:191)
==14416== Address 0x946ac64 is 0 bytes after a block of size 4 alloc'd
==14416== at 0x402A17C: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==14416== by 0x4107897: MVM_malloc (alloc.h:2)
==14416== by 0x410A46A: MVM_nativecall_invoke (nativecall_dyncall.c:491)
==14416== by 0x40DC506: MVM_interp_run (interp.c:3955)
==14416== by 0x41C87D2: MVM_vm_run_file (moar.c:304)
==14416== by 0x8048EA5: main (main.c:191)
==14416==
==14416== Invalid write of size 4
==14416== at 0xC89F87D: SetLongLong (15-rw-args.c:33)
==14416== by 0x41CB8BF: ??? (in /home/dogbert/repos/rakudo/install/lib/libmoar.so)
==14416== by 0x41CB2BC: dc_callvm_call_x86_cdecl (in /home/dogbert/repos/rakudo/install/lib/libmoar.so)
==14416== by 0x41CAE91: dcCallVoid (in /home/dogbert/repos/rakudo/install/lib/libmoar.so)
==14416== by 0x410B455: MVM_nativecall_invoke (nativecall_dyncall.c:584)
==14416== by 0x40DC506: MVM_interp_run (interp.c:3955)
==14416== by 0x41C87D2: MVM_vm_run_file (moar.c:304)
==14416== by 0x8048EA5: main (main.c:191)
==14416== Address 0x946ac64 is 0 bytes after a block of size 4 alloc'd
==14416== at 0x402A17C: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==14416== by 0x4107897: MVM_malloc (alloc.h:2)
==14416== by 0x410A46A: MVM_nativecall_invoke (nativecall_dyncall.c:491)
==14416== by 0x40DC506: MVM_interp_run (interp.c:3955)
==14416== by 0x41C87D2: MVM_vm_run_file (moar.c:304)
==14416== by 0x8048EA5: main (main.c:191)
==14416==
==14416== Invalid read of size 4
==14416== at 0x410BA35: MVM_nativecall_invoke (nativecall_dyncall.c:680)
==14416== by 0x40DC506: MVM_interp_run (interp.c:3955)
==14416== by 0x41C87D2: MVM_vm_run_file (moar.c:304)
==14416== by 0x8048EA5: main (main.c:191)
==14416== Address 0x946ac64 is 0 bytes after a block of size 4 alloc'd
==14416== at 0x402A17C: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==14416== by 0x4107897: MVM_malloc (alloc.h:2)
==14416== by 0x410A46A: MVM_nativecall_invoke (nativecall_dyncall.c:491)
==14416== by 0x40DC506: MVM_interp_run (interp.c:3955)
==14416== by 0x41C87D2: MVM_vm_run_file (moar.c:304)
==14416== by 0x8048EA5: main (main.c:191)
==14416==
ok 7 - Perl's rw variable was set by C (long long)
==14416== Invalid read of size 4
==14416== at 0xC89F88C: PassLongLong (15-rw-args.c:37)
==14416== by 0x41CB8BF: ??? (in /home/dogbert/repos/rakudo/install/lib/libmoar.so)
==14416== by 0x41CB2BC: dc_callvm_call_x86_cdecl (in /home/dogbert/repos/rakudo/install/lib/libmoar.so)
==14416== by 0x41CAF4B: dcCallLongLong (in /home/dogbert/repos/rakudo/install/lib/libmoar.so)
==14416== by 0x410B55F: MVM_nativecall_invoke (nativecall_dyncall.c:584)
==14416== by 0x40DC506: MVM_interp_run (interp.c:3955)
==14416== by 0x41C87D2: MVM_vm_run_file (moar.c:304)
==14416== by 0x8048EA5: main (main.c:191)
==14416== Address 0x92e69dc is 0 bytes after a block of size 4 alloc'd
==14416== at 0x402A17C: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==14416== by 0x4107897: MVM_malloc (alloc.h:2)
==14416== by 0x410A46A: MVM_nativecall_invoke (nativecall_dyncall.c:491)
==14416== by 0x40DC506: MVM_interp_run (interp.c:3955)
==14416== by 0x41C87D2: MVM_vm_run_file (moar.c:304)
==14416== by 0x8048EA5: main (main.c:191)
==14416==
ok 8 - Perl's rw variable was passed and returned by C (longlong)
ok 9 - Perl's rw variable was set by C (float)
ok 10 - Perl's rw variable was passed and returned by C (float)
==14416== Invalid write of size 8
==14416== at 0x410A7C1: MVM_nativecall_invoke (nativecall_dyncall.c:497)
==14416== by 0x40DC506: MVM_interp_run (interp.c:3955)
==14416== by 0x41C87D2: MVM_vm_run_file (moar.c:304)
==14416== by 0x8048EA5: main (main.c:191)
==14416== Address 0x884d358 is 0 bytes inside a block of size 4 alloc'd
==14416== at 0x402A17C: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==14416== by 0x4107897: MVM_malloc (alloc.h:2)
==14416== by 0x410A79E: MVM_nativecall_invoke (nativecall_dyncall.c:497)
==14416== by 0x40DC506: MVM_interp_run (interp.c:3955)
==14416== by 0x41C87D2: MVM_vm_run_file (moar.c:304)
==14416== by 0x8048EA5: main (main.c:191)
==14416==
==14416== Invalid write of size 8
==14416== at 0xC89F8D8: SetDouble (15-rw-args.c:49)
==14416== by 0x41CB8BF: ??? (in /home/dogbert/repos/rakudo/install/lib/libmoar.so)
==14416== by 0x41CB2BC: dc_callvm_call_x86_cdecl (in /home/dogbert/repos/rakudo/install/lib/libmoar.so)
==14416== by 0x41CAE91: dcCallVoid (in /home/dogbert/repos/rakudo/install/lib/libmoar.so)
==14416== by 0x410B455: MVM_nativecall_invoke (nativecall_dyncall.c:584)
==14416== by 0x40DC506: MVM_interp_run (interp.c:3955)
==14416== by 0x41C87D2: MVM_vm_run_file (moar.c:304)
==14416== by 0x8048EA5: main (main.c:191)
==14416== Address 0x884d358 is 0 bytes inside a block of size 4 alloc'd
==14416== at 0x402A17C: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==14416== by 0x4107897: MVM_malloc (alloc.h:2)
==14416== by 0x410A79E: MVM_nativecall_invoke (nativecall_dyncall.c:497)
==14416== by 0x40DC506: MVM_interp_run (interp.c:3955)
==14416== by 0x41C87D2: MVM_vm_run_file (moar.c:304)
==14416== by 0x8048EA5: main (main.c:191)
==14416==
==14416== Invalid read of size 8
==14416== at 0x410BAA0: MVM_nativecall_invoke (nativecall_dyncall.c:686)
==14416== by 0x40DC506: MVM_interp_run (interp.c:3955)
==14416== by 0x41C87D2: MVM_vm_run_file (moar.c:304)
==14416== by 0x8048EA5: main (main.c:191)
==14416== Address 0x884d358 is 0 bytes inside a block of size 4 alloc'd
==14416== at 0x402A17C: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==14416== by 0x4107897: MVM_malloc (alloc.h:2)
==14416== by 0x410A79E: MVM_nativecall_invoke (nativecall_dyncall.c:497)
==14416== by 0x40DC506: MVM_interp_run (interp.c:3955)
==14416== by 0x41C87D2: MVM_vm_run_file (moar.c:304)
==14416== by 0x8048EA5: main (main.c:191)
==14416==
ok 11 - Perl's rw variable was set by C (double)
==14416== Invalid read of size 8
==14416== at 0xC89F8E2: PassDouble (15-rw-args.c:53)
==14416== by 0x41CB8BF: ??? (in /home/dogbert/repos/rakudo/install/lib/libmoar.so)
==14416== by 0x41CB2BC: dc_callvm_call_x86_cdecl (in /home/dogbert/repos/rakudo/install/lib/libmoar.so)
==14416== by 0x41CAF89: dcCallDouble (in /home/dogbert/repos/rakudo/install/lib/libmoar.so)
==14416== by 0x410B5C9: MVM_nativecall_invoke (nativecall_dyncall.c:584)
==14416== by 0x40DC506: MVM_interp_run (interp.c:3955)
==14416== by 0x41C87D2: MVM_vm_run_file (moar.c:304)
==14416== by 0x8048EA5: main (main.c:191)
==14416== Address 0x91eabc8 is 0 bytes inside a block of size 4 alloc'd
==14416== at 0x402A17C: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==14416== by 0x4107897: MVM_malloc (alloc.h:2)
==14416== by 0x410A79E: MVM_nativecall_invoke (nativecall_dyncall.c:497)
==14416== by 0x40DC506: MVM_interp_run (interp.c:3955)
==14416== by 0x41C87D2: MVM_vm_run_file (moar.c:304)
==14416== by 0x8048EA5: main (main.c:191)
==14416==
ok 12 - Perl's rw variable was passed and returned by C (double)
ok 13 - Perl's rw variable was set by C (unsigned char)
ok 14 - Perl's rw variable was passed and returned by C (unsigned char)
ok 15 - Perl's rw variable was set by C (unsigned short)
ok 16 - Perl's rw variable was passed and returned by C (unsigned short)
ok 17 - Perl's rw variable was set by C (unsigned long)
ok 18 - Perl's rw variable was passed and returned by C (unsigned long)
==14416== Invalid write of size 4
==14416== at 0x410B27C: MVM_nativecall_invoke (nativecall_dyncall.c:571)
==14416== by 0x40DC506: MVM_interp_run (interp.c:3955)
==14416== by 0x41C87D2: MVM_vm_run_file (moar.c:304)
==14416== by 0x8048EA5: main (main.c:191)
==14416== Address 0xa53df2c is 0 bytes after a block of size 4 alloc'd
==14416== at 0x402A17C: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==14416== by 0x4107897: MVM_malloc (alloc.h:2)
==14416== by 0x410B254: MVM_nativecall_invoke (nativecall_dyncall.c:571)
==14416== by 0x40DC506: MVM_interp_run (interp.c:3955)
==14416== by 0x41C87D2: MVM_vm_run_file (moar.c:304)
==14416== by 0x8048EA5: main (main.c:191)
==14416==
==14416== Invalid write of size 4
==14416== at 0xC89F938: SetULongLong (15-rw-args.c:81)
==14416== by 0x41CB8BF: ??? (in /home/dogbert/repos/rakudo/install/lib/libmoar.so)
==14416== by 0x41CB2BC: dc_callvm_call_x86_cdecl (in /home/dogbert/repos/rakudo/install/lib/libmoar.so)
==14416== by 0x41CAE91: dcCallVoid (in /home/dogbert/repos/rakudo/install/lib/libmoar.so)
==14416== by 0x410B455: MVM_nativecall_invoke (nativecall_dyncall.c:584)
==14416== by 0x40DC506: MVM_interp_run (interp.c:3955)
==14416== by 0x41C87D2: MVM_vm_run_file (moar.c:304)
==14416== by 0x8048EA5: main (main.c:191)
==14416== Address 0xa53df2c is 0 bytes after a block of size 4 alloc'd
==14416== at 0x402A17C: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==14416== by 0x4107897: MVM_malloc (alloc.h:2)
==14416== by 0x410B254: MVM_nativecall_invoke (nativecall_dyncall.c:571)
==14416== by 0x40DC506: MVM_interp_run (interp.c:3955)
==14416== by 0x41C87D2: MVM_vm_run_file (moar.c:304)
==14416== by 0x8048EA5: main (main.c:191)
==14416==
==14416== Invalid read of size 4
==14416== at 0x410BBC6: MVM_nativecall_invoke (nativecall_dyncall.c:701)
==14416== by 0x40DC506: MVM_interp_run (interp.c:3955)
==14416== by 0x41C87D2: MVM_vm_run_file (moar.c:304)
==14416== by 0x8048EA5: main (main.c:191)
==14416== Address 0xa53df2c is 0 bytes after a block of size 4 alloc'd
==14416== at 0x402A17C: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==14416== by 0x4107897: MVM_malloc (alloc.h:2)
==14416== by 0x410B254: MVM_nativecall_invoke (nativecall_dyncall.c:571)
==14416== by 0x40DC506: MVM_interp_run (interp.c:3955)
==14416== by 0x41C87D2: MVM_vm_run_file (moar.c:304)
==14416== by 0x8048EA5: main (main.c:191)
==14416==
ok 19 - Perl's rw variable was set by C (unsigned long long)
==14416== Invalid read of size 4
==14416== at 0xC89F947: PassULongLong (15-rw-args.c:85)
==14416== by 0x41CB8BF: ??? (in /home/dogbert/repos/rakudo/install/lib/libmoar.so)
==14416== by 0x41CB2BC: dc_callvm_call_x86_cdecl (in /home/dogbert/repos/rakudo/install/lib/libmoar.so)
==14416== by 0x41CAF4B: dcCallLongLong (in /home/dogbert/repos/rakudo/install/lib/libmoar.so)
==14416== by 0x410B865: MVM_nativecall_invoke (nativecall_dyncall.c:584)
==14416== by 0x40DC506: MVM_interp_run (interp.c:3955)
==14416== by 0x41C87D2: MVM_vm_run_file (moar.c:304)
==14416== by 0x8048EA5: main (main.c:191)
==14416== Address 0x9386344 is 0 bytes after a block of size 4 alloc'd
==14416== at 0x402A17C: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==14416== by 0x4107897: MVM_malloc (alloc.h:2)
==14416== by 0x410B254: MVM_nativecall_invoke (nativecall_dyncall.c:571)
==14416== by 0x40DC506: MVM_interp_run (interp.c:3955)
==14416== by 0x41C87D2: MVM_vm_run_file (moar.c:304)
==14416== by 0x8048EA5: main (main.c:191)
==14416==
ok 20 - Perl's rw variable was passed and returned by C (unsigned long long)
ok 21 - Can pass an instantiated pointer with rw-trait to C
ok 22 - Perl's rw variable was set by C (pointer)
==14416==
==14416== HEAP SUMMARY:
==14416== in use at exit: 153,190 bytes in 4,632 blocks
==14416== total heap usage: 575,349 allocs, 570,717 frees, 156,628,679 bytes allocated
==14416==
==14416== LEAK SUMMARY:
==14416== definitely lost: 5,670 bytes in 202 blocks
==14416== indirectly lost: 14,112 bytes in 668 blocks
==14416== possibly lost: 120,032 bytes in 3,751 blocks
==14416== still reachable: 13,376 bytes in 11 blocks
==14416== suppressed: 0 bytes in 0 blocks
==14416== Rerun with --leak-check=full to see details of leaked memory
==14416==
==14416== For counts of detected and suppressed errors, rerun with: -v
==14416== ERROR SUMMARY: 18 errors from 12 contexts (suppressed: 0 from 0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment