Skip to content

Instantly share code, notes, and snippets.

@kuno
Created December 19, 2012 02:12
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 kuno/4333807 to your computer and use it in GitHub Desktop.
Save kuno/4333807 to your computer and use it in GitHub Desktop.
GeoIP 0.4.6 memory leak report, by running 'valgrind --leak-check=full -v test/memory_leak.js' on ubuntu 12.04 64bit
==4302== Memcheck, a memory error detector
==4302== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al.
==4302== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info
==4302== Command: node test/memory_leak.js
==4302==
--4302-- Valgrind options:
--4302-- --suppressions=/usr/lib/valgrind/debian-libc6-dbg.supp
--4302-- --leak-check=full
--4302-- -v
--4302-- Contents of /proc/version:
--4302-- Linux version 3.2.0-23-generic (buildd@crested) (gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu4) ) #36-Ubuntu SMP Tue Apr 10 20:39:51 UTC 2012
--4302-- Arch and hwcaps: AMD64, amd64-sse3
--4302-- Page sizes: currently 4096, max supported 4096
--4302-- Valgrind library directory: /usr/lib/valgrind
--4302-- Reading syms from /usr/bin/nodejs (0x400000)
--4302-- Considering /usr/bin/nodejs ..
--4302-- .. CRC mismatch (computed dd505ca7 wanted ba4fc22a)
--4302-- object doesn't have a symbol table
--4302-- Reading syms from /lib/x86_64-linux-gnu/ld-2.15.so (0x4000000)
--4302-- Considering /lib/x86_64-linux-gnu/ld-2.15.so ..
--4302-- .. CRC mismatch (computed eabdc7b7 wanted 3ee54b4e)
--4302-- Considering /usr/lib/debug/lib/x86_64-linux-gnu/ld-2.15.so ..
--4302-- .. CRC is valid
--4302-- Reading syms from /usr/lib/valgrind/memcheck-amd64-linux (0x38000000)
--4302-- Considering /usr/lib/valgrind/memcheck-amd64-linux ..
--4302-- .. CRC mismatch (computed b9a585cc wanted 749d1a67)
--4302-- object doesn't have a symbol table
--4302-- object doesn't have a dynamic symbol table
--4302-- Reading suppressions file: /usr/lib/valgrind/debian-libc6-dbg.supp
--4302-- Reading suppressions file: /usr/lib/valgrind/default.supp
==4302== embedded gdbserver: reading from /tmp/vgdb-pipe-from-vgdb-to-4302-by-vagrant-on-???
==4302== embedded gdbserver: writing to /tmp/vgdb-pipe-to-vgdb-from-4302-by-vagrant-on-???
==4302== embedded gdbserver: shared mem /tmp/vgdb-pipe-shared-mem-vgdb-4302-by-vagrant-on-???
==4302==
==4302== TO CONTROL THIS PROCESS USING vgdb (which you probably
==4302== don't want to do, unless you know exactly what you're doing,
==4302== or are doing some strange experiment):
==4302== /usr/lib/valgrind/../../bin/vgdb --pid=4302 ...command...
==4302==
==4302== TO DEBUG THIS PROCESS USING GDB: start GDB like this
==4302== /path/to/gdb node
==4302== and then give GDB the following command
==4302== target remote | /usr/lib/valgrind/../../bin/vgdb --pid=4302
==4302== --pid is optional if only one valgrind process is running
==4302==
--4302-- REDIR: 0x40189e0 (strlen) redirected to 0x380625c7 (???)
--4302-- Reading syms from /usr/lib/valgrind/vgpreload_core-amd64-linux.so (0x4a25000)
--4302-- Considering /usr/lib/valgrind/vgpreload_core-amd64-linux.so ..
--4302-- .. CRC mismatch (computed c82927cb wanted 1861273b)
--4302-- object doesn't have a symbol table
--4302-- Reading syms from /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so (0x4c27000)
--4302-- Considering /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so ..
--4302-- .. CRC mismatch (computed 72e29ec9 wanted f3ad49da)
--4302-- object doesn't have a symbol table
--4302-- REDIR: 0x4018850 (index) redirected to 0x4c2bc60 (index)
--4302-- REDIR: 0x40188d0 (strcmp) redirected to 0x4c2cc20 (strcmp)
--4302-- Reading syms from /lib/x86_64-linux-gnu/libdl-2.15.so (0x4e32000)
--4302-- Considering /lib/x86_64-linux-gnu/libdl-2.15.so ..
--4302-- .. CRC mismatch (computed 1e39c2e0 wanted 5d14a047)
--4302-- Considering /usr/lib/debug/lib/x86_64-linux-gnu/libdl-2.15.so ..
--4302-- .. CRC is valid
--4302-- Reading syms from /lib/x86_64-linux-gnu/librt-2.15.so (0x5036000)
--4302-- Considering /lib/x86_64-linux-gnu/librt-2.15.so ..
--4302-- .. CRC mismatch (computed aca1815f wanted f26cc34e)
--4302-- Considering /usr/lib/debug/lib/x86_64-linux-gnu/librt-2.15.so ..
--4302-- .. CRC is valid
--4302-- Reading syms from /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.16 (0x523e000)
--4302-- Considering /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.16 ..
--4302-- .. CRC mismatch (computed ef748751 wanted e44c0328)
--4302-- object doesn't have a symbol table
--4302-- Reading syms from /lib/x86_64-linux-gnu/libm-2.15.so (0x553e000)
--4302-- Considering /lib/x86_64-linux-gnu/libm-2.15.so ..
--4302-- .. CRC mismatch (computed e81d4037 wanted fad28d48)
--4302-- Considering /usr/lib/debug/lib/x86_64-linux-gnu/libm-2.15.so ..
--4302-- .. CRC is valid
--4302-- Reading syms from /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x583a000)
--4302-- Considering /lib/x86_64-linux-gnu/libgcc_s.so.1 ..
--4302-- .. CRC mismatch (computed c8e4b229 wanted 098e39f6)
--4302-- object doesn't have a symbol table
--4302-- Reading syms from /lib/x86_64-linux-gnu/libpthread-2.15.so (0x5a50000)
--4302-- Considering /lib/x86_64-linux-gnu/libpthread-2.15.so ..
--4302-- .. CRC mismatch (computed 8e430e5b wanted e619a829)
--4302-- Considering /usr/lib/debug/lib/x86_64-linux-gnu/libpthread-2.15.so ..
--4302-- .. CRC is valid
--4302-- Reading syms from /lib/x86_64-linux-gnu/libc-2.15.so (0x5c6d000)
--4302-- Considering /lib/x86_64-linux-gnu/libc-2.15.so ..
--4302-- .. CRC mismatch (computed 3af7ebbf wanted 50fc58fa)
--4302-- Considering /usr/lib/debug/lib/x86_64-linux-gnu/libc-2.15.so ..
--4302-- .. CRC is valid
--4302-- REDIR: 0x5cf9e30 (strcasecmp) redirected to 0x4a25610 (_vgnU_ifunc_wrapper)
--4302-- REDIR: 0x5cf61d0 (strnlen) redirected to 0x4a25610 (_vgnU_ifunc_wrapper)
--4302-- REDIR: 0x5cfc100 (strncasecmp) redirected to 0x4a25610 (_vgnU_ifunc_wrapper)
--4302-- REDIR: 0x5cf7bc0 (__GI_strrchr) redirected to 0x4c2ba80 (__GI_strrchr)
--4302-- REDIR: 0x5cf60f0 (__GI_strlen) redirected to 0x4c2bfc0 (__GI_strlen)
--4302-- REDIR: 0x52f3dd0 (operator new(unsigned long)) redirected to 0x4c2b160 (operator new(unsigned long))
--4302-- REDIR: 0x5cf8c10 (memset) redirected to 0x4a25610 (_vgnU_ifunc_wrapper)
--4302-- REDIR: 0x5d03610 (__memset_x86_64) redirected to 0x4c2e080 (memset)
--4302-- REDIR: 0x5cf45b0 (strcmp) redirected to 0x4a25610 (_vgnU_ifunc_wrapper)
--4302-- REDIR: 0x5cf45f0 (__GI_strcmp) redirected to 0x4c2cbc0 (__GI_strcmp)
--4302-- REDIR: 0x5cf60a0 (strlen) redirected to 0x4a25610 (_vgnU_ifunc_wrapper)
--4302-- REDIR: 0x5ceff40 (malloc) redirected to 0x4c2b660 (malloc)
--4302-- REDIR: 0x5cfe7e0 (memcpy@@GLIBC_2.14) redirected to 0x4a25610 (_vgnU_ifunc_wrapper)
--4302-- REDIR: 0x5cfe830 (__GI_memcpy) redirected to 0x4c2cf30 (memcpy@@GLIBC_2.14)
--4302-- REDIR: 0x5d0d3b0 (strstr) redirected to 0x4a25610 (_vgnU_ifunc_wrapper)
--4302-- REDIR: 0x5d0d040 (__GI_strstr) redirected to 0x4c2e7a0 (strstr)
--4302-- REDIR: 0xffffffffff600000 (???) redirected to 0x380625b3 (???)
--4302-- REDIR: 0x5cf0680 (realloc) redirected to 0x4c2b730 (realloc)
--4302-- REDIR: 0x52f2150 (operator delete(void*)) redirected to 0x4c2a450 (operator delete(void*))
--4302-- REDIR: 0x5cf0580 (free) redirected to 0x4c2a7c0 (free)
--4302-- REDIR: 0x52f3f00 (operator new[](unsigned long)) redirected to 0x4c2abc0 (operator new[](unsigned long))
==4302== Warning: set address range perms: large range [0x2924fc34c000, 0x29251c34c000) (noaccess)
--4302-- REDIR: 0x5cf8bc0 (memcpy@GLIBC_2.2.5) redirected to 0x4a25610 (_vgnU_ifunc_wrapper)
--4302-- REDIR: 0x5cf8a30 (__GI_memmove) redirected to 0x4c2cd20 (memcpy@GLIBC_2.2.5)
--4302-- REDIR: 0x52f2190 (operator delete[](void*)) redirected to 0x4c2a030 (operator delete[](void*))
--4302-- REDIR: 0x5cf7b40 (strncpy) redirected to 0x4a25610 (_vgnU_ifunc_wrapper)
--4302-- REDIR: 0x5d034b0 (__GI_strncpy) redirected to 0x4c2c2c0 (__GI_strncpy)
--4302-- REDIR: 0x5cf12a0 (calloc) redirected to 0x4c29cf0 (calloc)
--4302-- REDIR: 0x5cffd00 (strchrnul) redirected to 0x4c2e3b0 (strchrnul)
--4302-- memcheck GC: 1024 nodes, 1024 survivors (100.0%)
--4302-- memcheck GC: increase table size to 2048
--4302-- REDIR: 0x5cf44f0 (index) redirected to 0x4a25610 (_vgnU_ifunc_wrapper)
--4302-- REDIR: 0x5cf4530 (__GI_strchr) redirected to 0x4c2bb60 (__GI_strchr)
--4302-- memcheck GC: 2048 nodes, 2048 survivors (100.0%)
--4302-- memcheck GC: increase table size to 4096
--4302-- REDIR: 0x5cf82a0 (memchr) redirected to 0x4c2cce0 (memchr)
--4302-- REDIR: 0x5cf62f0 (__GI_strncmp) redirected to 0x4c2c480 (__GI_strncmp)
--4302-- memcheck GC: 4096 nodes, 3479 survivors ( 84.9%)
--4302-- memcheck GC: increase table size to 8192
--4302-- REDIR: 0x5cf85f0 (bcmp) redirected to 0x4a25610 (_vgnU_ifunc_wrapper)
--4302-- REDIR: 0x5cf8630 (__GI_memcmp) redirected to 0x4c2dca0 (bcmp)
--4302-- Reading syms from /usr/lib/node_modules/geoip/build/Release/geoip.node (0x702c000)
--4302-- Reading syms from /usr/lib/libGeoIP.so.1.4.8 (0x723c000)
--4302-- Considering /usr/lib/libGeoIP.so.1.4.8 ..
--4302-- .. CRC mismatch (computed 28b2ab55 wanted 3d6da740)
--4302-- object doesn't have a symbol table
--4302-- REDIR: 0x5cf7b80 (rindex) redirected to 0x4a25610 (_vgnU_ifunc_wrapper)
/home/vagrant/GeoIP/database/GeoLiteCity.dat
{ country_code: 'US',
country_code3: 'USA',
country_name: 'United States',
region: 'CA',
city: 'Mountain View',
postal_code: '94043',
latitude: 37.4192008972168,
longitude: -122.05740356445312,
metro_code: 807,
dma_code: 807,
area_code: 650,
continent_code: 'NA',
time_zone: 'America/Los_Angeles' }
==4302== Warning: set address range perms: large range [0x2924fc34c000, 0x29251c34c000) (noaccess)
==4302==
==4302== HEAP SUMMARY:
==4302== in use at exit: 35,875 bytes in 73 blocks
==4302== total heap usage: 3,208 allocs, 3,135 frees, 13,070,870 bytes allocated
==4302==
==4302== Searching for pointers to 73 not-freed blocks
==4302== Checked 350,400 bytes
==4302==
==4302== 14 bytes in 1 blocks are definitely lost in loss record 8 of 37
==4302== at 0x4C2B6CD: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==4302== by 0x724248D: _GeoIP_iso_8859_1__utf8 (in /usr/lib/libGeoIP.so.1.4.8)
==4302== by 0x70335E1: geoip::City::lookupSync(v8::Arguments const&) (in /usr/lib/node_modules/geoip/build/Release/geoip.node)
==4302== by 0x6CE7AA: ??? (in /usr/bin/nodejs)
==4302== by 0x2924FC406361: ???
==4302== by 0x2924FC48E3BD: ???
==4302== by 0x2924FC410C1D: ???
==4302== by 0x2924FC46902A: ???
==4302== by 0x2924FC469161: ???
==4302== by 0x2924FC467D15: ???
==4302== by 0x2924FC46767B: ???
==4302== by 0x2924FC4695CA: ???
==4302==
==4302== 24 bytes in 1 blocks are definitely lost in loss record 13 of 37
==4302== at 0x4C2B1C7: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==4302== by 0x58F22D: node::ImmutableAsciiSource::CreateFromLiteral(char const*, unsigned long) (in /usr/bin/nodejs)
==4302== by 0x57C5DB: node::Load(v8::Handle<v8::Object>) (in /usr/bin/nodejs)
==4302== by 0x57D9E9: node::Start(int, char**) (in /usr/bin/nodejs)
==4302== by 0x5C8E76C: (below main) (libc-start.c:226)
==4302==
==4302== 24 bytes in 1 blocks are definitely lost in loss record 14 of 37
==4302== at 0x4C2B1C7: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==4302== by 0x58F22D: node::ImmutableAsciiSource::CreateFromLiteral(char const*, unsigned long) (in /usr/bin/nodejs)
==4302== by 0x58C382: node::MainSource() (in /usr/bin/nodejs)
==4302== by 0x57C5E3: node::Load(v8::Handle<v8::Object>) (in /usr/bin/nodejs)
==4302== by 0x57D9E9: node::Start(int, char**) (in /usr/bin/nodejs)
==4302== by 0x5C8E76C: (below main) (libc-start.c:226)
==4302==
==4302== 111 (88 direct, 23 indirect) bytes in 1 blocks are definitely lost in loss record 21 of 37
==4302== at 0x4C2B6CD: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==4302== by 0x7244960: ??? (in /usr/lib/libGeoIP.so.1.4.8)
==4302== by 0x70334E8: geoip::City::lookupSync(v8::Arguments const&) (in /usr/lib/node_modules/geoip/build/Release/geoip.node)
==4302== by 0x6CE7AA: ??? (in /usr/bin/nodejs)
==4302== by 0x2924FC406361: ???
==4302== by 0x2924FC48E3BD: ???
==4302== by 0x2924FC410C1D: ???
==4302== by 0x2924FC46902A: ???
==4302== by 0x2924FC469161: ???
==4302== by 0x2924FC467D15: ???
==4302== by 0x2924FC46767B: ???
==4302== by 0x2924FC4695CA: ???
==4302==
==4302== 201 (40 direct, 161 indirect) bytes in 1 blocks are definitely lost in loss record 24 of 37
==4302== at 0x4C2B1C7: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==4302== by 0x7032FAC: geoip::City::New(v8::Arguments const&) (in /usr/lib/node_modules/geoip/build/Release/geoip.node)
==4302== by 0x6CB766: ??? (in /usr/bin/nodejs)
==4302== by 0x2924FC406361: ???
==4302== by 0x2924FC40C792: ???
==4302== by 0x2924FC48E387: ???
==4302== by 0x2924FC410C1D: ???
==4302== by 0x2924FC46902A: ???
==4302== by 0x2924FC469161: ???
==4302== by 0x2924FC467D15: ???
==4302== by 0x2924FC46767B: ???
==4302== by 0x2924FC4695CA: ???
==4302==
==4302== 864 bytes in 36 blocks are definitely lost in loss record 28 of 37
==4302== at 0x4C2B1C7: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==4302== by 0x58F22D: node::ImmutableAsciiSource::CreateFromLiteral(char const*, unsigned long) (in /usr/bin/nodejs)
==4302== by 0x58C3D4: node::DefineJavaScript(v8::Handle<v8::Object>) (in /usr/bin/nodejs)
==4302== by 0x579ED7: ??? (in /usr/bin/nodejs)
==4302== by 0x6CE7AA: ??? (in /usr/bin/nodejs)
==4302== by 0x2924FC406361: ???
==4302== by 0x2924FC433AC9: ???
==4302== by 0x2924FC40C8A6: ???
==4302== by 0x2924FC406115: ???
==4302== by 0x6EF742: ??? (in /usr/bin/nodejs)
==4302== by 0x6F0F2A: v8::internal::Execution::Call(v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>, int, v8::internal::Handle<v8::internal::Object>*, bool*, bool) (in /usr/bin/nodejs)
==4302== by 0x6B1EFA: v8::Function::Call(v8::Handle<v8::Object>, int, v8::Handle<v8::Value>*) (in /usr/bin/nodejs)
==4302==
==4302== 2,326 bytes in 1 blocks are definitely lost in loss record 31 of 37
==4302== at 0x4C2B6CD: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==4302== by 0x5D522B: uv_setup_args (in /usr/bin/nodejs)
==4302== by 0x57D8A8: node::Start(int, char**) (in /usr/bin/nodejs)
==4302== by 0x5C8E76C: (below main) (libc-start.c:226)
==4302==
==4302== 8,248 (56 direct, 8,192 indirect) bytes in 1 blocks are definitely lost in loss record 33 of 37
==4302== at 0x4C2B1C7: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==4302== by 0x57EFE5: node::Buffer::New(v8::Arguments const&) (in /usr/bin/nodejs)
==4302== by 0x6CB766: ??? (in /usr/bin/nodejs)
==4302== by 0x2924FC406361: ???
==4302== by 0x2924FC40C792: ???
==4302== by 0x2924FC43E189: ???
==4302== by 0x2924FC43DB82: ???
==4302== by 0x2924FC40C0ED: ???
==4302== by 0x2924FC40C583: ???
==4302== by 0x2924FC473C49: ???
==4302== by 0x2924FC469118: ???
==4302== by 0x2924FC467D15: ???
==4302==
==4302== 9,802 (56 direct, 9,746 indirect) bytes in 1 blocks are definitely lost in loss record 36 of 37
==4302== at 0x4C2B1C7: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==4302== by 0x57EFE5: node::Buffer::New(v8::Arguments const&) (in /usr/bin/nodejs)
==4302== by 0x6CB766: ??? (in /usr/bin/nodejs)
==4302== by 0x2924FC406361: ???
==4302== by 0x2924FC40C792: ???
==4302== by 0x2924FC43DAAF: ???
==4302== by 0x2924FC40C0ED: ???
==4302== by 0x2924FC40C347: ???
==4302== by 0x2924FC473C49: ???
==4302== by 0x2924FC465462: ???
==4302== by 0x2924FC46565A: ???
==4302== by 0x2924FC466245: ???
==4302==
==4302== 9,802 (56 direct, 9,746 indirect) bytes in 1 blocks are definitely lost in loss record 37 of 37
==4302== at 0x4C2B1C7: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==4302== by 0x57EFE5: node::Buffer::New(v8::Arguments const&) (in /usr/bin/nodejs)
==4302== by 0x6CB766: ??? (in /usr/bin/nodejs)
==4302== by 0x2924FC406361: ???
==4302== by 0x2924FC40C792: ???
==4302== by 0x2924FC43DAAF: ???
==4302== by 0x2924FC40C0ED: ???
==4302== by 0x2924FC40C347: ???
==4302== by 0x2924FC473C49: ???
==4302== by 0x2924FC40C0ED: ???
==4302== by 0x2924FC4953E8: ???
==4302== by 0x2924FC410C1D: ???
==4302==
==4302== LEAK SUMMARY:
==4302== definitely lost: 3,548 bytes in 45 blocks
==4302== indirectly lost: 27,868 bytes in 9 blocks
==4302== possibly lost: 0 bytes in 0 blocks
==4302== still reachable: 4,459 bytes in 19 blocks
==4302== suppressed: 0 bytes in 0 blocks
==4302== Reachable blocks (those to which a pointer was found) are not shown.
==4302== To see them, rerun with: --leak-check=full --show-reachable=yes
==4302==
==4302== ERROR SUMMARY: 10 errors from 10 contexts (suppressed: 2 from 2)
--4302--
--4302-- used_suppression: 2 dl-hack3-cond-1
==4302==
==4302== ERROR SUMMARY: 10 errors from 10 contexts (suppressed: 2 from 2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment