>  1. As far as I can make out, start_arena_memory & end_arena_memory are
>  never initialized before being used in alloc_objects (in dod.c).
>  Consequently, there's no guarantee that they ever do get initialized
>  properly, and hence any or all of pmc_min, pmc_max, buffer_min &
>  buffer_max in trace_system_stack (also in dod.c) may contain garbage.

Ahh, good catch, thanks. Although it won't cause any problems, it still
is a bug. This code was just an optimization which made the
trace_system_stack code MUCH faster, as compared to checking in every
buffer pool for *each* potential pointer on the stack.

Since alloc_objects includes sanity checks to change *_arena_memory, it's
guaranteed to contain all potential buffers, although it could be wildly
over-zealous with it's definition of the min and max.

>  2. In get_min_buffer_address (in header.c): shouldn't all of the
>  references to end_arena_memory actually be to start_arena_memory ?

Ah yes, now that one could cause problems. :) The only reason that I
believe it didn't cause problems in the GC benchmark suite is that all
buffers on the system stack were "recently" allocated, and likely to be
later in the system memory and thus *after* the end of the first
allocated buffer pool (which is what the code would currently return).

The redundancy in the code for the min/max stuff on pmc/header pools does
bother me (and look, it's prone to error ;), but I'm not really sure of
any cleaner ways to do it. If you have any suggestions, please feel
free to mention them.

Anyways, I've committed fixes for both of these issues.

Thanks again.
Mike Lambert



Reply via email to