Re: [libdc] possible corruption of memory...
Capture and control API for IIDC compliant cameras
Brought to you by:
ddouxchamps,
gordp
From: Rudolf L. <r.l...@x-...> - 2009-08-06 11:39:33
|
If you use the ElectrcFence library you can trigger a segmentation fault whenever some call messes up the heap - this would make it much easier for you to track down the problem. Basically relink your program with libefence (should be available as package for most distros), turn on core dumps, wait for your program to trigger the SEGV, then proceed with your debugger. If it's fully reproducable behavior, you should be able to track down the problem quickly. Cheers, Rudi Am 06.08.2009 um 12:15 schrieb Samuel Audet: > 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 > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 > 30-Day > trial. Simplify your report design, integration and deployment - and > focus on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > Mailing list for libdc1394-devel > lib...@li... > https://lists.sourceforge.net/lists/listinfo/libdc1394-devel -- DI. Dr. Rudolf Leitgeb Chief Technological Officer x-pin.com GmbH Millennium City Handelskai 94-96, Stiege 4/2.OG A-1200 Vienna/Austria/Europe FN 255.127m, UID: ATU61232222 [mobile] +43-664-583-2419 [telefax] +43-1-236-100-99 [e-mail] r.l...@x-... |