|
From: Brendan D. <bre...@pe...> - 2006-05-22 20:50:05
|
I'm using Valgrind 3.1 to try to debug a video hook for ffmpeg. Valgrind complains (very confusingly) about uninitialized values being used --- this is pretty much impossible (at least to the best of my knowledge): each class instance is initialized either from defaults (global const variables), via a copy (I've checked the copy constructor several times to be absolutely certain that all the fields are being copied over. It's possible that I've missed something, but I seriously doubt it), or via a configuration object (where the values are either read in from file or use the same defaults that the default constructor uses). There are two variables that are used on the line that generates the error: confidence and m_TauConfidence. confidence is passed by reference and ultimately lives on the stack, m_TauConfidence is a member variable. Prior to the test, confidence is computed using pixel intensities ultimately supplied by FFmpeg (FFmpeg decodes the current frame, passes it to my hook, then passes the results on to the encoder). m_TauConfidence is written precisely once (and that's when the instance is constructed). Needless to say, I'm confused as to how these values are considered uninitialized, unless the data coming from the input frame is uninitialized. Regardless, it would be really helpful to know which of these values is actually uninitialized. Second issue that I'm fighting with: I seem to be suffering from stack corruption when running this hook. Is there anyway to use Valgrind to try to figure this out? Ideally, I'd like to make sure that every time I jump into a function call or return from a function call, the relevant addresses are valid and at least plausible. I have no idea what support there is for tracking valid return addresses during function calls might be in place. I suspect that this is probably going to be language dependent, which means probably outside the scope of Valgrind. Any thoughts? Thanks much, Brendan. -- Brendan Drew Research Scientist PercepTek, Inc. 12395 North Mead Way Littleton, CO 80125 Tel: 720-344-1037 x 126 Fax: 720-344-2360 |