Skip to content

Instantly share code, notes, and snippets.

@tk3
Created January 3, 2013 04:04
Show Gist options
  • Save tk3/4440702 to your computer and use it in GitHub Desktop.
Save tk3/4440702 to your computer and use it in GitHub Desktop.
$ valgrind --dsymutil=yes ../../../bin/mruby example/example.rb
==82019== Memcheck, a memory error detector
==82019== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.
==82019== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
==82019== Command: ../../../bin/mruby example/example.rb
==82019==
==82019== WARNING: Support on MacOS 10.8 is experimental and mostly broken.
==82019== WARNING: Expect incorrect results, assertions and crashes.
==82019== WARNING: In particular, Memcheck on 32-bit programs will fail to
==82019== WARNING: detect any errors associated with heap-allocated data.
==82019==
--82019-- run: /usr/bin/dsymutil "../../../bin/mruby"
==82019== Conditional jump or move depends on uninitialised value(s)
==82019== at 0x1D0B9: sqlite3RunParser (in /usr/lib/libsqlite3.dylib)
==82019== by 0x1C8B7: sqlite3Prepare (in /usr/lib/libsqlite3.dylib)
==82019== by 0x1C232: sqlite3LockAndPrepare (in /usr/lib/libsqlite3.dylib)
==82019== by 0x9673E: sqlite3_prepare_v2 (in /usr/lib/libsqlite3.dylib)
==82019== by 0x100050253: mrb_sqlite3_database_execute_batch (mrb_sqlite3.c:273)
==82019== by 0x10002F54A: mrb_run (vm.c:850)
==82019== by 0x100046446: load_exec (parse.y:4888)
==82019== by 0x10004F83C: mrb_load_file_cxt (parse.y:4896)
==82019== by 0x100000E4E: main (mruby.c:284)
==82019==
==82019== Conditional jump or move depends on uninitialised value(s)
==82019== at 0x10005035D: mrb_sqlite3_database_execute_batch (mrb_sqlite3.c:271)
==82019== by 0x10002F54A: mrb_run (vm.c:850)
==82019== by 0x100046446: load_exec (parse.y:4888)
==82019== by 0x10004F83C: mrb_load_file_cxt (parse.y:4896)
==82019== by 0x100000E4E: main (mruby.c:284)
==82019==
==82019== Conditional jump or move depends on uninitialised value(s)
==82019== at 0x10005035D: mrb_sqlite3_database_execute_batch (mrb_sqlite3.c:271)
==82019== by 0x10002F54A: mrb_run (vm.c:850)
==82019== by 0x10002EFF3: mrb_run (vm.c:258)
==82019== by 0x100046446: load_exec (parse.y:4888)
==82019== by 0x10004F83C: mrb_load_file_cxt (parse.y:4896)
==82019== by 0x100000E4E: main (mruby.c:284)
==82019==
==82019== Use of uninitialised value of size 8
==82019== at 0x1ED89: sqlite3GetToken (in /usr/lib/libsqlite3.dylib)
==82019== by 0x1D19F: sqlite3RunParser (in /usr/lib/libsqlite3.dylib)
==82019== by 0x1C8B7: sqlite3Prepare (in /usr/lib/libsqlite3.dylib)
==82019== by 0x1C232: sqlite3LockAndPrepare (in /usr/lib/libsqlite3.dylib)
==82019== by 0x9673E: sqlite3_prepare_v2 (in /usr/lib/libsqlite3.dylib)
==82019== by 0x100050253: mrb_sqlite3_database_execute_batch (mrb_sqlite3.c:273)
==82019== by 0x10002F54A: mrb_run (vm.c:850)
==82019== by 0x100046446: load_exec (parse.y:4888)
==82019== by 0x10004F83C: mrb_load_file_cxt (parse.y:4896)
==82019== by 0x100000E4E: main (mruby.c:284)
==82019==
==82019== Conditional jump or move depends on uninitialised value(s)
==82019== at 0x1D1C9: sqlite3RunParser (in /usr/lib/libsqlite3.dylib)
==82019== by 0x1C8B7: sqlite3Prepare (in /usr/lib/libsqlite3.dylib)
==82019== by 0x1C232: sqlite3LockAndPrepare (in /usr/lib/libsqlite3.dylib)
==82019== by 0x9673E: sqlite3_prepare_v2 (in /usr/lib/libsqlite3.dylib)
==82019== by 0x100050253: mrb_sqlite3_database_execute_batch (mrb_sqlite3.c:273)
==82019== by 0x10002F54A: mrb_run (vm.c:850)
==82019== by 0x100046446: load_exec (parse.y:4888)
==82019== by 0x10004F83C: mrb_load_file_cxt (parse.y:4896)
==82019== by 0x100000E4E: main (mruby.c:284)
==82019==
[1, "foo"]
[2, "bar"]
[3, "bazoooo!"]
==82019== Jump to the invalid address stated on the next line
==82019== at 0x14700000000: ???
==82019== by 0x4800000018: ???
==82019== by 0xFFFFFFFF: ???
==82019== by 0xFFFFFFFF: ???
==82019== by 0xCE: ???
==82019== by 0x3: ???
==82019== by 0xE: ???
==82019== by 0x1000A78EF: ???
==82019== by 0x10602C0EF: ???
==82019== by 0x1000354C4: mrb_yield_argv (vm.c:433)
==82019== by 0x1000AC757: ???
==82019== by 0x8: ???
==82019== Address 0x14700000000 is not stack'd, malloc'd or (recently) free'd
==82019==
==82019==
==82019== Process terminating with default action of signal 11 (SIGSEGV)
==82019== Access not within mapped region at address 0x14700000000
==82019== at 0x14700000000: ???
==82019== by 0x4800000018: ???
==82019== by 0xFFFFFFFF: ???
==82019== by 0xFFFFFFFF: ???
==82019== by 0xCE: ???
==82019== by 0x3: ???
==82019== by 0xE: ???
==82019== by 0x1000A78EF: ???
==82019== by 0x10602C0EF: ???
==82019== by 0x1000354C4: mrb_yield_argv (vm.c:433)
==82019== by 0x1000AC757: ???
==82019== by 0x8: ???
==82019== If you believe this happened as a result of a stack
==82019== overflow in your program's main thread (unlikely but
==82019== possible), you can try to increase the size of the
==82019== main thread stack using the --main-stacksize= flag.
==82019== The main thread stack size used in this run was 33153024.
==82019==
==82019== HEAP SUMMARY:
==82019== in use at exit: 288,386 bytes in 1,957 blocks
==82019== total heap usage: 3,201 allocs, 1,244 frees, 1,212,005 bytes allocated
==82019==
==82019== LEAK SUMMARY:
==82019== definitely lost: 12,760 bytes in 17 blocks
==82019== indirectly lost: 1,168 bytes in 5 blocks
==82019== possibly lost: 4,821 bytes in 56 blocks
==82019== still reachable: 269,637 bytes in 1,879 blocks
==82019== suppressed: 0 bytes in 0 blocks
==82019== Rerun with --leak-check=full to see details of leaked memory
==82019==
==82019== For counts of detected and suppressed errors, rerun with: -v
==82019== Use --track-origins=yes to see where uninitialised values come from
==82019== ERROR SUMMARY: 321 errors from 6 contexts (suppressed: 0 from 0)
Segmentation fault: 11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment