Hi,
(I'm CCing bug #231162 because the issues are probably related.)
(Note that currently (gdb version 6.3-5) both #186037 and #231162 are obscured by #296483.)
The patch I created for #186037 is not adequate for it solves only a small part of the problem. Looking again at printf_command at gdb/printcmd.c:1729, it seems to me that gdb is overall too sloppy about format string checking (this may be the case elsewhere in the source, too; I haven't checked), passing format strings to printf_filtered() which possibly trigger undefined behaviour in the subsequent call to vasprintf (libc info says "unpredictable things will happen").
Admitted, a gdb user should know how format strings are constructed, but what may be a simple typo shouldn't crash an entire debugging session.
Maybe it is possible to no longer consider a failing vasprintf a gdb internal error and simply print a warning message. If this is not possible, printf_command() (and possibly other functions) might have to be expanded to check user supplied format strings thoroughly.
In any case I'm going to remove the "patch" tag from #186037 and elevate its severity to "normal".
Maybe someone feeling confident with "merging" bugs could merge #186037 and #231162 if appropriate?
Thanks & best regards, Alexander
-- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]