< Previous by Date Date Index Next by Date >
  Thread Index  

[reSIProcate] valgrind memory analysis


I did a few runs through valgrind after my last commit, it found some
unrelated issues: has anybody looked at these in the past?

The first two are more cryptic, the last two identify the code in question.



==26955==
==26955== LEAK SUMMARY:
==26955==    definitely lost: 0 bytes in 0 blocks
==26955==    indirectly lost: 0 bytes in 0 blocks
==26955==      possibly lost: 188 bytes in 5 blocks
==26955==    still reachable: 888 bytes in 10 blocks
==26955==         suppressed: 0 bytes in 0 blocks
==26955== Rerun with --leak-check=full to see details of leaked memory
==26955==
==26955== Use --track-origins=yes to see where uninitialised values come
from
==26955== ERROR SUMMARY: 2053 errors from 4 contexts (suppressed: 0 from 0)
==26955==
==26955== 1 errors in context 1 of 4:
==26955== Thread 1:
==26955== Conditional jump or move depends on uninitialised value(s)
==26955==    at 0x401776B: index (strchr.S:58)
==26955==    by 0x4007902: expand_dynamic_string_token (dl-load.c:431)
==26955==    by 0x40081F4: _dl_map_object (dl-load.c:2539)
==26955==    by 0x400170D: map_doit (rtld.c:632)
==26955==    by 0x400E845: _dl_catch_error (dl-error.c:177)
==26955==    by 0x4000FDD: do_preload (rtld.c:821)
==26955==    by 0x4004711: dl_main (rtld.c:1635)
==26955==    by 0x40151AD: _dl_sysdep_start (dl-sysdep.c:241)
==26955==    by 0x4004D85: _dl_start (rtld.c:337)
==26955==    by 0x4001527: ??? (in /lib/x86_64-linux-gnu/ld-2.17.so)
==26955==    by 0x1: ???
==26955==    by 0x7FF0003E6: ???
==26955==
==26955==
==26955== 1 errors in context 2 of 4:
==26955== Conditional jump or move depends on uninitialised value(s)
==26955==    at 0x4017766: index (strchr.S:55)
==26955==    by 0x4007902: expand_dynamic_string_token (dl-load.c:431)
==26955==    by 0x40081F4: _dl_map_object (dl-load.c:2539)
==26955==    by 0x400170D: map_doit (rtld.c:632)
==26955==    by 0x400E845: _dl_catch_error (dl-error.c:177)
==26955==    by 0x4000FDD: do_preload (rtld.c:821)
==26955==    by 0x4004711: dl_main (rtld.c:1635)
==26955==    by 0x40151AD: _dl_sysdep_start (dl-sysdep.c:241)
==26955==    by 0x4004D85: _dl_start (rtld.c:337)
==26955==    by 0x4001527: ??? (in /lib/x86_64-linux-gnu/ld-2.17.so)
==26955==    by 0x1: ???
==26955==    by 0x7FF0003E6: ???
==26955==
==26955==
==26955== 321 errors in context 3 of 4:
==26955== Conditional jump or move depends on uninitialised value(s)
==26955==    at 0x56590DB: resip::Security::preload() (Security.cxx:288)


This appears to be complaining about a static object from
rutil/FileSystem.cxx:

static FileSystem::Directory::iterator staticEnd;



==26955==    by 0x5605AD7: resip::SipStack::SipStack(resip::Security*,
std::vector<resip::GenericIPAddress,
std::allocator<resip::GenericIPAddress> > const&,
resip::AsyncProcessHandler*, bool, void (*)(int, int, char const*, int),
resip::Compression*, resip::FdPollGrp*) (SipStack.cxx:107)
==26955==    by 0x4ED88AD: repro::ReproRunner::createSipStack()
(ReproRunner.cxx:486)
==26955==    by 0x4ED2FD9: repro::ReproRunner::run(int, char**)
(ReproRunner.cxx:194)
==26955==    by 0x40118D: main (repro.cxx:126)
==26955==
==26955==
==26955== 1730 errors in context 4 of 4:
==26955== Thread 4:
==26955== Syscall param select(timeout) points to uninitialised byte(s)
==26955==    at 0x6EDD793: ??? (syscall-template.S:81)
==26955==    by 0x59338E0: resip::FdPollImplEpoll::waitAndProcess(int)
(Socket.hxx:133)

I tried zeroing the tv struct before it is initialised, but that didn't
resolve this one


==26955==    by 0x5946A2D: resip::DnsThread::thread() (DnsThread.cxx:33)
==26955==    by 0x59379FE: threadIfThreadWrapper (ThreadIf.cxx:51)
==26955==    by 0x61BBE0D: start_thread (pthread_create.c:311)
==26955==    by 0x6EE493C: clone (clone.S:113)
==26955==  Address 0xb977860 is on thread 4's stack
==26955==
==26955== ERROR SUMMARY: 2053 errors from 4 contexts (suppressed: 0 from 0)