Skip to content

Instantly share code, notes, and snippets.

@smartkiwi
Created September 3, 2014 01:29
Show Gist options
  • Save smartkiwi/b4b67002905a7882febf to your computer and use it in GitHub Desktop.
Save smartkiwi/b4b67002905a7882febf to your computer and use it in GitHub Desktop.
valgrind sample_gcc
valgrind ./sample_gcc
==15743== Memcheck, a memory error detector
==15743== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.
==15743== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
==15743== Command: ./sample_gcc
==15743==
this is a native c program calling vw
can't open: , error = Success
terminate called after throwing an instance of 'std::exception'
what(): std::exception
==15743== Invalid free() / delete / delete[] / realloc()
==15743== at 0x4A063F0: free (vg_replace_malloc.c:446)
==15743== by 0x302F33F59A: free_mem (in /lib64/libc-2.12.so)
==15743== by 0x302F33F131: __libc_freeres (in /lib64/libc-2.12.so)
==15743== by 0x480166D: _vgnU_freeres (vg_preloaded.c:62)
==15743== by 0x302F234084: abort (in /lib64/libc-2.12.so)
==15743== by 0x30302BEA5C: __gnu_cxx::__verbose_terminate_handler() (in /usr/lib64/libstdc++.so.6.0.13)
==15743== by 0x30302BCBE5: ??? (in /usr/lib64/libstdc++.so.6.0.13)
==15743== by 0x30302BCC12: std::terminate() (in /usr/lib64/libstdc++.so.6.0.13)
==15743== by 0x30302BCD0D: __cxa_throw (in /usr/lib64/libstdc++.so.6.0.13)
==15743== by 0x4E570D0: io_buf::open_file(char const*, bool, int) (in /vagrant/rpmbuild/BUILD/vowpal_wabbit-7.6/vowpalwabbit/.libs/libvw.so.0.0.0)
==15743== by 0x4ED13B9: parse_source_args(vw&, boost::program_options::variables_map&, bool, unsigned long) (in /vagrant/rpmbuild/BUILD/vowpal_wabbit-7.6/vowpalwabbit/.libs/libvw.so.0.0.0)
==15743== by 0x4E984CF: parse_args(int, char**) (in /vagrant/rpmbuild/BUILD/vowpal_wabbit-7.6/vowpalwabbit/.libs/libvw.so.0.0.0)
==15743== Address 0x4e1b5e0 is not stack'd, malloc'd or (recently) free'd
==15743==
==15743==
==15743== HEAP SUMMARY:
==15743== in use at exit: 4,371,451 bytes in 792 blocks
==15743== total heap usage: 1,065 allocs, 275 frees, 4,449,140 bytes allocated
==15743==
==15743== LEAK SUMMARY:
==15743== definitely lost: 0 bytes in 0 blocks
==15743== indirectly lost: 0 bytes in 0 blocks
==15743== possibly lost: 12,497 bytes in 252 blocks
==15743== still reachable: 4,358,954 bytes in 540 blocks
==15743== suppressed: 0 bytes in 0 blocks
==15743== Rerun with --leak-check=full to see details of leaked memory
==15743==
==15743== For counts of detected and suppressed errors, rerun with: -v
==15743== ERROR SUMMARY: 2 errors from 1 contexts (suppressed: 6 from 6)
Aborted (core dumped)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment