[commit] dwarf2read.c (load_partial_dies): Change condition to assert.

Michael Eager eager@eagerm.com
Sat Apr 7 21:46:00 GMT 2012


On 04/07/2012 01:49 PM, Doug Evans wrote:
> On Sat, Apr 7, 2012 at 1:40 PM, Michael Eager<eager@eagerm.com>  wrote:
>> On 04/07/2012 12:39 PM, Doug Evans wrote:
>>>
>>> Hi.
>>>
>>> There's no caller where cu->per_cu == NULL,
>>> and I'd rather have the assert.
>>
>> Per_cu data is flushed asynchronously in free_heap_comp_unit()
>> and free_stack_comp_unit().  Are you sure that this can't happen?
>
> Define "asynchronously".

age_cached_comp_units() is called to age the CU cache and free up
cached CUs which were not recently used.  This happens while reading
symbols for a different CU.

> My reading of all of the callers says it can't happen (modulo bugs of course).
> I could have missed something of course (in which case let's get
> something added to the testsuite to exercise the appropriate code
> path).

My concern is that unless the per_cu data was loaded by one of the
immediate callers, it may have been flushed.

I'm not sure I can create a reasonable test case for this problem.
I ran into this with a large program with many CUs printing a struct
which took several pages to print.  The per_cu data disappeared in
the middle of printing the struct.


-- 
Michael Eager	 eager@eagercon.com
1960 Park Blvd., Palo Alto, CA 94306  650-325-8077



More information about the Gdb-patches mailing list