This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: FYI: put a QUIT in DWARF expression evaluator
- From: Tom Tromey <tromey at redhat dot com>
- To: fche at redhat dot com (Frank Ch. Eigler)
- Cc: gdb-patches at sourceware dot org
- Date: Tue, 19 Jul 2011 13:10:48 -0600
- Subject: Re: FYI: put a QUIT in DWARF expression evaluator
- References: <m37h7soj4v.fsf@fleche.redhat.com> <y0mmxgosets.fsf@fche.csb>
Sorry about the delay on this.
Tom> Today I wondered what would happen if I modified pr10770.c to fail,
Tom> causing an infinite loop while evaluating a DWARF expression. The
Tom> answer is that gdb hangs and I had to kill it from the shell.
Tom> [...]
Tom> FWIW, as far as I know, no such DWARF has ever been found in the wild.
Frank> But perhaps other non-interactive services that rely on gdb to do
Frank> backtraces (pstack?) could be tricked into looping indefinitely. To
Frank> what extent is gdb vulnerable to specially crafted target memory state
Frank> causing indefinitely-long processing?
I wouldn't trust it, that's for sure. I don't know of specific bugs,
but dwarf2read is simply too large and complicated for me to believe
that it is free of problems.
I would not be averse to putting a large-enough artificial limit on the
expression evaluator. It is hard to imagine a legitimate DWARF
expression needing more than 1000 operations or something like that.
Tom