Skip to content

Instantly share code, notes, and snippets.

@jer
Created September 29, 2014 05:52
Show Gist options
  • Save jer/6fe6373482a8588eb6c2 to your computer and use it in GitHub Desktop.
Save jer/6fe6373482a8588eb6c2 to your computer and use it in GitHub Desktop.
Valgrind after the fix
> cat test.rb
require 'chess'
game = Chess::Game.new
puts game.to_s
> valgrind --partial-loads-ok=yes --undef-value-errors=no ruby test.rb
==60898== Memcheck, a memory error detector
==60898== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==60898== Using Valgrind-3.10.0 and LibVEX; rerun with -h for copyright info
==60898== Command: ruby test.rb
==60898==
--60898-- /Users/jer/.rvm/rubies/ruby-2.1.0/bin/ruby:
--60898-- dSYM directory is missing; consider using --dsymutil=yes
UNKNOWN __pthread_sigmask is unsupported. This warning will not be repeated.
==60898== Warning: ignored attempt to set SIGUSR2 handler in sigaction();
==60898== the SIGUSR2 signal is used internally by Valgrind
--60898-- /Users/jer/.rvm/gems/ruby-2.1.0/gems/chess-0.0.4/ext/chess.bundle:
--60898-- dSYM directory is missing; consider using --dsymutil=yes
8 r n b q k b n r
7 p p p p p p p p
6 . . . . . . . .
5 . . . . . . . .
4 . . . . . . . .
3 . . . . . . . .
2 P P P P P P P P
1 R N B Q K B N R
a b c d e f g h
==60898==
==60898== HEAP SUMMARY:
==60898== in use at exit: 2,542,578 bytes in 29,076 blocks
==60898== total heap usage: 67,754 allocs, 38,678 frees, 15,090,726 bytes allocated
==60898==
==60898== LEAK SUMMARY:
==60898== definitely lost: 239,980 bytes in 1,556 blocks
==60898== indirectly lost: 641,892 bytes in 11,924 blocks
==60898== possibly lost: 951,081 bytes in 4,519 blocks
==60898== still reachable: 673,733 bytes in 10,700 blocks
==60898== suppressed: 35,892 bytes in 377 blocks
==60898== Rerun with --leak-check=full to see details of leaked memory
==60898==
==60898== For counts of detected and suppressed errors, rerun with: -v
==60898== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment