On Jan 20, 2011, at 6:43 PM CST, john skaller wrote: > > OK, so I do this now: ... > if(debug) > fprintf(stderr, "Check if *%p=%p is a pointer\n",i,*(void**)i); > scan_object(*(void**)i, reclimit); ... > The VALGRIND macro there doesn't seem to be working, I must be > doing something wrong. I'm trying to just mark the whole stack as defined. > > Here's output: ...
The way that I read this output is that your range variable and the data in that range is probably defined because Valgrind isn't flagging i or the value at address i when you perform the "Check if" fprintf above. Rather, it's flagging an fprintf inside of scan_object on line 451, whose output you did not include. Maybe it's the reclimit variable? > ==7159== Uninitialised value was created by a stack allocation > ==7159== at 0x10000E492: > flx::gc::collector::flx_collector_t::mark(std::vector<flx::pthread::memory_range_t, > std::allocator<flx::pthread::memory_range_t> >*) (flx_collector.cpp:337) It's odd that the stack allocation is attributed to line 337, which AFAICT is the line where scan_object is called. Is there some sort of odd automatic C++ temporary allocation happening here that I can't see because some other code isn't shown here or (more likely) my C++ is too rusty somehow? Perhaps under optimization an uninitialized and otherwise-unused reclimit variable only gets created at the time that the arguments to scan_object are pushed onto the stack? -Dave ------------------------------------------------------------------------------ Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)! Finally, a world-class log management solution at an even better price-free! Download using promo code Free_Logger_4_Dev2Dev. Offer expires February 28th, so secure your free ArcSight Logger TODAY! http://p.sf.net/sfu/arcsight-sfd2d _______________________________________________ Valgrind-users mailing list Valgrind-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-users