On Jan 19, 2011, at 9:52 AM CST, john skaller wrote:

> On 20/01/2011, at 2:39 AM, Dave Goodell wrote:
> 
>> On Jan 18, 2011, at 10:56 PM CST, john skaller wrote:

> I could rewrite the GC so that the stack scan is in a separate subroutine,
> and then just exclude that using Valgrinds nice suppression mechanism.

Yes, although this doesn't get rid of the uninitialized values, which could 
potentially propagate elsewhere in your code.  It just suppresses error 
_reporting_.

>> You could try using the various MEMPOOL client requests so that Valgrind 
>> might also be able to report errors in terms of a particular object's 
>> allocation stack trace.  But I'm not sure I understand your situation 100%, 
>> so there's no guarantee that it will help.
> 
> Not using a pool: standard malloc/free.

Got it.  Then using the MEMPOOL macros won't help you any.

>>>> The key bit is that Valgrind is marking the whole red zone as "undefined" 
>>>> at function entrance/exit, so only areas that are actually written during 
>>>> that function are potentially going to be marked as "defined".  
>>> 
>>> Yeah, I see, so actually the "red zone" is only safe to use within a 
>>> function as "scratch" area.
>> 
>> Sure, but it makes sense that a conservative collector like yours must scan 
>> the whole red zone. You're just doing something unconventional from 
>> Valgrind's point of view, so you need to tell it that you Know What You Are 
>> Doing.
> 
> Well that's interesting. It isn't scanning the whole red zone. Maybe it 
> should!!
> See above, how I get the low address bound. Still, if the redzone is only 
> "active" inside a
> function and never across a function call, there's no need to scan it (since, 
> say,
> the get_stack_pointer routine is a function call it should invalidate the 
> red-zone,
> if I understand the comments you posted in your last email).

Right.  I was thinking this was an external thread or signal handler examining 
another stack, in which case you would need to scan the whole red zone.  But if 
it all happens as a result of an explicit new/allocate call then scanning the 
red zone shouldn't be necessary.

-Dave


------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to