[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] valgrind

From: Alan Post
Subject: Re: [Chicken-users] valgrind
Date: Thu, 29 Sep 2011 13:47:56 -0601

On Thu, Sep 29, 2011 at 09:38:44PM +0200, Jörg F. Wittenberger wrote:
> I'm still asking myself why I can't run chicken program under valgrind.
> Since there's a lot going on at this time I'm about to forget.
> Hence here an update for those who care and the archive.
> I've traced the call coming from irregex.c down to valgrind complaining
> as soon as *all-chars* value is accessed.
> (I did not yet come around to prepare a test case where I'd only
> cons up a random list (or a list of char's - wild guess) and see if
> I can sync valgrind's output enough to verify that it will complain
> on code which is supposed to work at all counts.)
> (The back of my head now might be about to forget that a less expensive
> implementations of charset and their merges might be obvious; even in
> R5RS Scheme.  Right now they are a pretty nice test case to see how
> much a few instructions shaved from the cons operation would speed up the
> program initialization over all.)
> Furthermore I'd know that chicken might to weird things to the stack.
> Maybe valgrind was just a bad choice.  Wild guess again.
> But as far as I understand valgrind so far (which is close to nothing
> at all), it would instrument then executable code only.
> Given that I see access to uninitialized memory resulting from stack
> allocation - I wonder: maybe valgrind is right?
> Now, at this time it my memory consumption issue does not appear.
> Real work is pressing.  I'll not find the time to dig deeper into
> these things any time soon.
> Except if I'm wrong about the "does not appear".
> /Jerry

Since it seems as good a day as any for wild-ass speculation, what
about this scenario:

We allocate an object, set the tag pointer, but don't fill out all
of the memory yet.  We're yet to need it.

Oops!  The gc gets called, and that object has to move.  So we
memcpy it to it's new home and tuck it into bed.

Wouldn't valgrind complain that we just memcpy'd uninitialized
memory, even though in this case it is a completely safe operation?

.i ma'a lo bradi cu penmi gi'e du

reply via email to

[Prev in Thread] Current Thread [Next in Thread]