6 Aug 2009 12:15
[libdc] possible corruption of memory...
Hello,
I am having a problem in my application where when dc1394_camera_free()
is called, glibc becomes unstable and I get "double free" errors and
such weird behavior in the rest of the code. If I _never_ call
dc1394_camera_free() and let it leak memory, then everything works
fine.. To debug this, I tried to use valgrind, but libdc1394 seems to be
in very bad shape unfortunately.. I get plenty of warnings about
uninitialised values. For example, just these four lines
dc1394_t *d = dc1394_new();
dc1394camera_list_t *list;
dc1394_camera_enumerate (d, &list);
dc1394_camera_free_list(list);
dc1394_free(d);
generate the following in valgrind (I'm just pasting the summary. The
whole default output is around 1500 lines):
==22182== ERROR SUMMARY: 347 errors from 47 contexts (suppressed: 4 from 1)
==22182== malloc/free: in use at exit: 0 bytes in 0 blocks.
==22182== malloc/free: 67 allocs, 67 frees, 33,056 bytes allocated.
==22182== For counts of detected errors, rerun with: -v
==22182== All heap blocks were freed -- no leaks are possible.
Ouch... it's hard to see if and where any memory corruption might be
taking place.. :( I think the code could use some cleaning in that area.
Samuel
(Continue reading)
RSS Feed