Skip to content

Instantly share code, notes, and snippets.

@kuno
Created December 19, 2012 02:11
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/4333801 to your computer and use it in GitHub Desktop.
Save kuno/4333801 to your computer and use it in GitHub Desktop.
GeoIP 0.4.7pre memory leak report, by running 'valgrind --leak-check=full -v test/memory_leak.js' on ubuntu 12.04 64bit
==2829== Memcheck, a memory error detector
==2829== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al.
==2829== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info
==2829== Command: node test/memory_leak.js
==2829==
--2829-- Valgrind options:
--2829-- --suppressions=/usr/lib/valgrind/debian-libc6-dbg.supp
--2829-- --leak-check=full
--2829-- -v
--2829-- Contents of /proc/version:
--2829-- 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
--2829-- Arch and hwcaps: AMD64, amd64-sse3
--2829-- Page sizes: currently 4096, max supported 4096
--2829-- Valgrind library directory: /usr/lib/valgrind
--2829-- Reading syms from /usr/bin/nodejs (0x400000)
--2829-- Considering /usr/bin/nodejs ..
--2829-- .. CRC mismatch (computed dd505ca7 wanted ba4fc22a)
--2829-- object doesn't have a symbol table
--2829-- Reading syms from /lib/x86_64-linux-gnu/ld-2.15.so (0x4000000)
--2829-- Considering /lib/x86_64-linux-gnu/ld-2.15.so ..
--2829-- .. CRC mismatch (computed eabdc7b7 wanted 3ee54b4e)
--2829-- Considering /usr/lib/debug/lib/x86_64-linux-gnu/ld-2.15.so ..
--2829-- .. CRC is valid
--2829-- Reading syms from /usr/lib/valgrind/memcheck-amd64-linux (0x38000000)
--2829-- Considering /usr/lib/valgrind/memcheck-amd64-linux ..
--2829-- .. CRC mismatch (computed b9a585cc wanted 749d1a67)
--2829-- object doesn't have a symbol table
--2829-- object doesn't have a dynamic symbol table
--2829-- Reading suppressions file: /usr/lib/valgrind/debian-libc6-dbg.supp
--2829-- Reading suppressions file: /usr/lib/valgrind/default.supp
==2829== embedded gdbserver: reading from /tmp/vgdb-pipe-from-vgdb-to-2829-by-vagrant-on-???
==2829== embedded gdbserver: writing to /tmp/vgdb-pipe-to-vgdb-from-2829-by-vagrant-on-???
==2829== embedded gdbserver: shared mem /tmp/vgdb-pipe-shared-mem-vgdb-2829-by-vagrant-on-???
==2829==
==2829== TO CONTROL THIS PROCESS USING vgdb (which you probably
==2829== don't want to do, unless you know exactly what you're doing,
==2829== or are doing some strange experiment):
==2829== /usr/lib/valgrind/../../bin/vgdb --pid=2829 ...command...
==2829==
==2829== TO DEBUG THIS PROCESS USING GDB: start GDB like this
==2829== /path/to/gdb node
==2829== and then give GDB the following command
==2829== target remote | /usr/lib/valgrind/../../bin/vgdb --pid=2829
==2829== --pid is optional if only one valgrind process is running
==2829==
--2829-- REDIR: 0x40189e0 (strlen) redirected to 0x380625c7 (???)
--2829-- Reading syms from /usr/lib/valgrind/vgpreload_core-amd64-linux.so (0x4a25000)
--2829-- Considering /usr/lib/valgrind/vgpreload_core-amd64-linux.so ..
--2829-- .. CRC mismatch (computed c82927cb wanted 1861273b)
--2829-- object doesn't have a symbol table
--2829-- Reading syms from /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so (0x4c27000)
--2829-- Considering /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so ..
--2829-- .. CRC mismatch (computed 72e29ec9 wanted f3ad49da)
--2829-- object doesn't have a symbol table
--2829-- REDIR: 0x4018850 (index) redirected to 0x4c2bc60 (index)
--2829-- REDIR: 0x40188d0 (strcmp) redirected to 0x4c2cc20 (strcmp)
--2829-- Reading syms from /lib/x86_64-linux-gnu/libdl-2.15.so (0x4e32000)
--2829-- Considering /lib/x86_64-linux-gnu/libdl-2.15.so ..
--2829-- .. CRC mismatch (computed 1e39c2e0 wanted 5d14a047)
--2829-- Considering /usr/lib/debug/lib/x86_64-linux-gnu/libdl-2.15.so ..
--2829-- .. CRC is valid
--2829-- Reading syms from /lib/x86_64-linux-gnu/librt-2.15.so (0x5036000)
--2829-- Considering /lib/x86_64-linux-gnu/librt-2.15.so ..
--2829-- .. CRC mismatch (computed aca1815f wanted f26cc34e)
--2829-- Considering /usr/lib/debug/lib/x86_64-linux-gnu/librt-2.15.so ..
--2829-- .. CRC is valid
--2829-- Reading syms from /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.16 (0x523e000)
--2829-- Considering /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.16 ..
--2829-- .. CRC mismatch (computed ef748751 wanted e44c0328)
--2829-- object doesn't have a symbol table
--2829-- Reading syms from /lib/x86_64-linux-gnu/libm-2.15.so (0x553e000)
--2829-- Considering /lib/x86_64-linux-gnu/libm-2.15.so ..
--2829-- .. CRC mismatch (computed e81d4037 wanted fad28d48)
--2829-- Considering /usr/lib/debug/lib/x86_64-linux-gnu/libm-2.15.so ..
--2829-- .. CRC is valid
--2829-- Reading syms from /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x583a000)
--2829-- Considering /lib/x86_64-linux-gnu/libgcc_s.so.1 ..
--2829-- .. CRC mismatch (computed c8e4b229 wanted 098e39f6)
--2829-- object doesn't have a symbol table
--2829-- Reading syms from /lib/x86_64-linux-gnu/libpthread-2.15.so (0x5a50000)
--2829-- Considering /lib/x86_64-linux-gnu/libpthread-2.15.so ..
--2829-- .. CRC mismatch (computed 8e430e5b wanted e619a829)
--2829-- Considering /usr/lib/debug/lib/x86_64-linux-gnu/libpthread-2.15.so ..
--2829-- .. CRC is valid
--2829-- Reading syms from /lib/x86_64-linux-gnu/libc-2.15.so (0x5c6d000)
--2829-- Considering /lib/x86_64-linux-gnu/libc-2.15.so ..
--2829-- .. CRC mismatch (computed 3af7ebbf wanted 50fc58fa)
--2829-- Considering /usr/lib/debug/lib/x86_64-linux-gnu/libc-2.15.so ..
--2829-- .. CRC is valid
--2829-- REDIR: 0x5cf9e30 (strcasecmp) redirected to 0x4a25610 (_vgnU_ifunc_wrapper)
--2829-- REDIR: 0x5cf61d0 (strnlen) redirected to 0x4a25610 (_vgnU_ifunc_wrapper)
--2829-- REDIR: 0x5cfc100 (strncasecmp) redirected to 0x4a25610 (_vgnU_ifunc_wrapper)
--2829-- REDIR: 0x5cf7bc0 (__GI_strrchr) redirected to 0x4c2ba80 (__GI_strrchr)
--2829-- REDIR: 0x5cf60f0 (__GI_strlen) redirected to 0x4c2bfc0 (__GI_strlen)
--2829-- REDIR: 0x52f3dd0 (operator new(unsigned long)) redirected to 0x4c2b160 (operator new(unsigned long))
--2829-- REDIR: 0x5cf8c10 (memset) redirected to 0x4a25610 (_vgnU_ifunc_wrapper)
--2829-- REDIR: 0x5d03610 (__memset_x86_64) redirected to 0x4c2e080 (memset)
--2829-- REDIR: 0x5cf45b0 (strcmp) redirected to 0x4a25610 (_vgnU_ifunc_wrapper)
--2829-- REDIR: 0x5cf45f0 (__GI_strcmp) redirected to 0x4c2cbc0 (__GI_strcmp)
--2829-- REDIR: 0x5cf60a0 (strlen) redirected to 0x4a25610 (_vgnU_ifunc_wrapper)
--2829-- REDIR: 0x5ceff40 (malloc) redirected to 0x4c2b660 (malloc)
--2829-- REDIR: 0x5cfe7e0 (memcpy@@GLIBC_2.14) redirected to 0x4a25610 (_vgnU_ifunc_wrapper)
--2829-- REDIR: 0x5cfe830 (__GI_memcpy) redirected to 0x4c2cf30 (memcpy@@GLIBC_2.14)
--2829-- REDIR: 0x5d0d3b0 (strstr) redirected to 0x4a25610 (_vgnU_ifunc_wrapper)
--2829-- REDIR: 0x5d0d040 (__GI_strstr) redirected to 0x4c2e7a0 (strstr)
--2829-- REDIR: 0xffffffffff600000 (???) redirected to 0x380625b3 (???)
--2829-- REDIR: 0x5cf0680 (realloc) redirected to 0x4c2b730 (realloc)
--2829-- REDIR: 0x52f2150 (operator delete(void*)) redirected to 0x4c2a450 (operator delete(void*))
--2829-- REDIR: 0x5cf0580 (free) redirected to 0x4c2a7c0 (free)
--2829-- REDIR: 0x52f3f00 (operator new[](unsigned long)) redirected to 0x4c2abc0 (operator new[](unsigned long))
==2829== Warning: set address range perms: large range [0x6fc43261000, 0x6fc63261000) (noaccess)
--2829-- REDIR: 0x5cf8bc0 (memcpy@GLIBC_2.2.5) redirected to 0x4a25610 (_vgnU_ifunc_wrapper)
--2829-- REDIR: 0x5cf8a30 (__GI_memmove) redirected to 0x4c2cd20 (memcpy@GLIBC_2.2.5)
--2829-- REDIR: 0x52f2190 (operator delete[](void*)) redirected to 0x4c2a030 (operator delete[](void*))
--2829-- REDIR: 0x5cf7b40 (strncpy) redirected to 0x4a25610 (_vgnU_ifunc_wrapper)
--2829-- REDIR: 0x5d034b0 (__GI_strncpy) redirected to 0x4c2c2c0 (__GI_strncpy)
--2829-- REDIR: 0x5cf12a0 (calloc) redirected to 0x4c29cf0 (calloc)
--2829-- REDIR: 0x5cffd00 (strchrnul) redirected to 0x4c2e3b0 (strchrnul)
--2829-- memcheck GC: 1024 nodes, 1024 survivors (100.0%)
--2829-- memcheck GC: increase table size to 2048
--2829-- REDIR: 0x5cf44f0 (index) redirected to 0x4a25610 (_vgnU_ifunc_wrapper)
--2829-- REDIR: 0x5cf4530 (__GI_strchr) redirected to 0x4c2bb60 (__GI_strchr)
--2829-- memcheck GC: 2048 nodes, 2048 survivors (100.0%)
--2829-- memcheck GC: increase table size to 4096
--2829-- REDIR: 0x5cf82a0 (memchr) redirected to 0x4c2cce0 (memchr)
--2829-- REDIR: 0x5cf62f0 (__GI_strncmp) redirected to 0x4c2c480 (__GI_strncmp)
--2829-- memcheck GC: 4096 nodes, 3479 survivors ( 84.9%)
--2829-- memcheck GC: increase table size to 8192
--2829-- Reading syms from /vagrant_data/GeoIP/build/Release/geoip.node (0x702c000)
--2829-- Reading syms from /usr/lib/libGeoIP.so.1.4.8 (0x723c000)
--2829-- Considering /usr/lib/libGeoIP.so.1.4.8 ..
--2829-- .. CRC mismatch (computed 28b2ab55 wanted 3d6da740)
--2829-- object doesn't have a symbol table
--2829-- REDIR: 0x5cf7b80 (rindex) redirected to 0x4a25610 (_vgnU_ifunc_wrapper)
--2829-- REDIR: 0x5cf85f0 (bcmp) redirected to 0x4a25610 (_vgnU_ifunc_wrapper)
--2829-- REDIR: 0x5cf8630 (__GI_memcmp) redirected to 0x4c2dca0 (bcmp)
/vagrant_data/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' }
{ 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' }
==2829== Warning: set address range perms: large range [0x6fc43261000, 0x6fc63261000) (noaccess)
==2829==
==2829== HEAP SUMMARY:
==2829== in use at exit: 16,628 bytes in 72 blocks
==2829== total heap usage: 2,556 allocs, 2,484 frees, 13,000,942 bytes allocated
==2829==
==2829== Searching for pointers to 72 not-freed blocks
==2829== Checked 611,224 bytes
==2829==
==2829== 24 bytes in 1 blocks are definitely lost in loss record 12 of 36
==2829== at 0x4C2B1C7: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==2829== by 0x58F22D: node::ImmutableAsciiSource::CreateFromLiteral(char const*, unsigned long) (in /usr/bin/nodejs)
==2829== by 0x57C5DB: node::Load(v8::Handle<v8::Object>) (in /usr/bin/nodejs)
==2829== by 0x57D9E9: node::Start(int, char**) (in /usr/bin/nodejs)
==2829== by 0x5C8E76C: (below main) (libc-start.c:226)
==2829==
==2829== 24 bytes in 1 blocks are definitely lost in loss record 13 of 36
==2829== at 0x4C2B1C7: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==2829== by 0x58F22D: node::ImmutableAsciiSource::CreateFromLiteral(char const*, unsigned long) (in /usr/bin/nodejs)
==2829== by 0x58C382: node::MainSource() (in /usr/bin/nodejs)
==2829== by 0x57C5E3: node::Load(v8::Handle<v8::Object>) (in /usr/bin/nodejs)
==2829== by 0x57D9E9: node::Start(int, char**) (in /usr/bin/nodejs)
==2829== by 0x5C8E76C: (below main) (libc-start.c:226)
==2829==
==2829== 111 (88 direct, 23 indirect) bytes in 1 blocks are definitely lost in loss record 23 of 36
==2829== at 0x4C2B6CD: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==2829== by 0x7244960: ??? (in /usr/lib/libGeoIP.so.1.4.8)
==2829== by 0x7033599: geoip::City::EIO_City(uv_work_s*) (in /vagrant_data/GeoIP/build/Release/geoip.node)
==2829== by 0x5C442B: ??? (in /usr/bin/nodejs)
==2829== by 0x5A57E99: start_thread (pthread_create.c:308)
==2829== by 0x5D60CBC: clone (clone.S:112)
==2829==
==2829== 201 (40 direct, 161 indirect) bytes in 1 blocks are definitely lost in loss record 26 of 36
==2829== at 0x4C2B1C7: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==2829== by 0x70335CC: geoip::City::New(v8::Arguments const&) (in /vagrant_data/GeoIP/build/Release/geoip.node)
==2829== by 0x6CB766: ??? (in /usr/bin/nodejs)
==2829== by 0x6FC43306361: ???
==2829== by 0x6FC4330C792: ???
==2829== by 0x6FC4338E301: ???
==2829== by 0x6FC43310C1D: ???
==2829== by 0x6FC4336907C: ???
==2829== by 0x6FC433691A1: ???
==2829== by 0x6FC43367D3E: ???
==2829== by 0x6FC433676AD: ???
==2829== by 0x6FC4336960D: ???
==2829==
==2829== 288 bytes in 1 blocks are possibly lost in loss record 28 of 36
==2829== at 0x4C29DB4: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==2829== by 0x4012074: _dl_allocate_tls (dl-tls.c:297)
==2829== by 0x5A58ABC: pthread_create@@GLIBC_2.2.5 (allocatestack.c:571)
==2829== by 0x574643: ??? (in /usr/bin/nodejs)
==2829== by 0x5C44EB: ??? (in /usr/bin/nodejs)
==2829== by 0x5C6337: eio_custom (in /usr/bin/nodejs)
==2829== by 0x5CE96A: uv_queue_work (in /usr/bin/nodejs)
==2829== by 0x703399F: geoip::City::lookup(v8::Arguments const&) (in /vagrant_data/GeoIP/build/Release/geoip.node)
==2829== by 0x6CE7AA: ??? (in /usr/bin/nodejs)
==2829== by 0x6FC43306361: ???
==2829== by 0x6FC4338E37F: ???
==2829== by 0x6FC43310C1D: ???
==2829==
==2829== 864 bytes in 36 blocks are definitely lost in loss record 31 of 36
==2829== at 0x4C2B1C7: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==2829== by 0x58F22D: node::ImmutableAsciiSource::CreateFromLiteral(char const*, unsigned long) (in /usr/bin/nodejs)
==2829== by 0x58C3D4: node::DefineJavaScript(v8::Handle<v8::Object>) (in /usr/bin/nodejs)
==2829== by 0x579ED7: ??? (in /usr/bin/nodejs)
==2829== by 0x6CE7AA: ??? (in /usr/bin/nodejs)
==2829== by 0x6FC43306361: ???
==2829== by 0x6FC43333AC9: ???
==2829== by 0x6FC4330C8A6: ???
==2829== by 0x6FC43306115: ???
==2829== by 0x6EF742: ??? (in /usr/bin/nodejs)
==2829== 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)
==2829== by 0x6B1EFA: v8::Function::Call(v8::Handle<v8::Object>, int, v8::Handle<v8::Value>*) (in /usr/bin/nodejs)
==2829==
==2829== 2,329 bytes in 1 blocks are definitely lost in loss record 34 of 36
==2829== at 0x4C2B6CD: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==2829== by 0x5D522B: uv_setup_args (in /usr/bin/nodejs)
==2829== by 0x57D8A8: node::Start(int, char**) (in /usr/bin/nodejs)
==2829== by 0x5C8E76C: (below main) (libc-start.c:226)
==2829==
==2829== 8,248 (56 direct, 8,192 indirect) bytes in 1 blocks are definitely lost in loss record 36 of 36
==2829== at 0x4C2B1C7: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==2829== by 0x57EFE5: node::Buffer::New(v8::Arguments const&) (in /usr/bin/nodejs)
==2829== by 0x6CB766: ??? (in /usr/bin/nodejs)
==2829== by 0x6FC43306361: ???
==2829== by 0x6FC4330C792: ???
==2829== by 0x6FC4333E16C: ???
==2829== by 0x6FC4333DB7F: ???
==2829== by 0x6FC4330C0ED: ???
==2829== by 0x6FC4330C583: ???
==2829== by 0x6FC43373D06: ???
==2829== by 0x6FC43369158: ???
==2829== by 0x6FC43367D3E: ???
==2829==
==2829== LEAK SUMMARY:
==2829== definitely lost: 3,425 bytes in 42 blocks
==2829== indirectly lost: 8,376 bytes in 7 blocks
==2829== possibly lost: 288 bytes in 1 blocks
==2829== still reachable: 4,539 bytes in 22 blocks
==2829== suppressed: 0 bytes in 0 blocks
==2829== Reachable blocks (those to which a pointer was found) are not shown.
==2829== To see them, rerun with: --leak-check=full --show-reachable=yes
==2829==
==2829== ERROR SUMMARY: 8 errors from 8 contexts (suppressed: 2 from 2)
--2829--
--2829-- used_suppression: 2 dl-hack3-cond-1
==2829==
==2829== ERROR SUMMARY: 8 errors from 8 contexts (suppressed: 2 from 2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment