Re: [commit] Re: [dwarf2_mark_helper patch] Re: [PATCH] Make interrupting tab-completion safe.

Jan Kratochvil
2011-07-12T21:37:40Z

On Tue, 12 Jul 2011 23:18:16 +0200, Tom Tromey wrote:
> QUITs in symtab reading imply resource leaks; however there are already
> known resource leaks in this code (Jan has details).

Besides small leaks here and there (such as allocating CU objects from
objfile_obstack - objfile_obstack has objfile lifetime, comp_unit_obstack has
CU lifetime; CU can get loaded+freed multiple times for one objfile).

There is also a more general problem that symtab can be read once and symtab
can never be freed. This means that with tbreak or batch control of GDB etc.
in fact `-readnow' gets into effect which costs on libwekitgtk 5GB of memory
and it would be larger on real world apps. It is a subpart of PR 12828 filed
by me.

> My belief is that we should move away from obstack allocation here and to
> something more fine-grained like an alloc pool.

There should be at least symtab_obstack. But obstack is not great in general
as it is incompatible with valgrind.

Thanks,
Jan