From: Alan W. I. <ir...@be...> - 2002-07-05 20:17:39
|
I have just looked deeper into the memory leaks for x01c -dev psc reported by valgrind with valgrind option --leak-resolution=high. 1 of them was a problem with glibc fopen, 3 of them were problems with glibc ctime, 5 of them were problems with glibc dlopen, and the remaining 14 (of 23 total under high resolution) all occur in plinitDispatchTable. plinitDispatchTable calls plstrdup at lines 1643, 1644, 1657-1660, and 1674. Non of those are freed again, and the 1643 and 1644 pointers are eventually lost (and those lines are called twice) according to valgrind. I am wondering if the lost pointers are due to using the same structure for static and dynamic drivers or whether there is a misconfiguration of driver number for my particular configuration? (I configured with --enable-dyndrivers --enable-gnome --enable-ntk). plinitDispatchTable also calls malloc at lines 1591, 1601, 1613, 1614, and 1640. None of those are freed. In any case I think some checks should go in after the mallocs to be sure the memory was allocated successfully. Geoffrey, I am addressing this question to you since plinitDispatchTable was originally your code. I would like to put the appropriate frees in plinitDispatchTable for the various plstrdup and malloc calls, but I am not sure of the right place to do this since I don't follow the code that easily. Once a device has been chosen, is there any need for these memory areas? Please advise! Alan email: ir...@be... phone: 250-727-2902 FAX: 250-721-7715 snail-mail: Dr. Alan W. Irwin Department of Physics and Astronomy, University of Victoria, P.O. Box 3055, Victoria, British Columbia, Canada, V8W 3P6 __________________________ Linux-powered astrophysics __________________________ |