From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Jim Blandy <jimb@red-bean.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: RFA: Building GDB under GLIBC 2.8
Date: Sun, 14 Dec 2008 18:26:00 -0000 [thread overview]
Message-ID: <20081214182514.GA28215@host0.dyn.jankratochvil.net> (raw)
In-Reply-To: <8f2776cb0812121804n1008f921h3898bb7bda1581c9@mail.gmail.com>
Hi Jim,
FYI that part for "ui-file.c" crashes GDB on the testsuite as when the GDB is
existing it has already closed its output. Testsuite results are not changed
(as GDB output is already ignored that time) but many core files start to be
generated.
Attaching a possible replacement for that ui-file.c part: When GDB cannot
write to its output IMO some message about it is no longer of much use.
Regards,
Jan
Program terminated with signal 11, Segmentation fault.
[New process 9576]
#0 0x00000000006024ff in exceptions_state_mc (action=CATCH_THROWING) at exceptions.c:125
125 switch (current_catcher->state)
(gdb) p current_catcher
$1 = (struct catcher *) 0x0
(gdb) bt
#0 0x00000000006024ff in exceptions_state_mc (action=CATCH_THROWING) at exceptions.c:125
#1 0x0000000000602808 in throw_exception (exception=
{reason = RETURN_ERROR, error = GENERIC_ERROR, message = 0x3776910 "stdio_file_fputs: Input/output error"}) at exceptions.c:235
#2 0x0000000000602c29 in throw_it (reason=RETURN_ERROR, error=GENERIC_ERROR, fmt=0xc8224b "stdio_file_fputs: %s", ap=0x7fff750c9f80)
at exceptions.c:396
#3 0x0000000000602c51 in throw_verror (error=GENERIC_ERROR, fmt=0xc8224b "stdio_file_fputs: %s", ap=0x7fff750c9f80) at exceptions.c:402
#4 0x000000000047a466 in error (string=0xc8224b "stdio_file_fputs: %s") at utils.c:796
#5 0x000000000047f7a7 in stdio_file_fputs (linebuffer=0x376e900 '\225' <repeats 37 times>, "�\225\225�", file=0x2f31e20) at ui-file.c:496
#6 0x000000000047efbd in fputs_unfiltered (buf=0x376e900 '\225' <repeats 37 times>, "�\225\225�", file=0x2f31e20) at ui-file.c:211
#7 0x000000000047c36c in fputs_maybe_filtered (linebuffer=0x376e900 '\225' <repeats 37 times>, "�\225\225�", stream=0x2f31e20, filter=1)
at utils.c:2028
#8 0x000000000047c5be in fputs_filtered (linebuffer=0x376e900 '\225' <repeats 37 times>, "�\225\225�", stream=0x2f31e20) at utils.c:2119
#9 0x0000000000602960 in print_exception (file=0x2f31e20, e=
{reason = RETURN_ERROR, error = GENERIC_ERROR, message = 0x376e900 '\225' <repeats 37 times>, "�\225\225�"}) at exceptions.c:306
#10 0x0000000000602bc5 in print_any_exception (file=0x2f31e20, prefix=0xc7df05 "", e=
{reason = RETURN_ERROR, error = GENERIC_ERROR, message = 0x376e900 '\225' <repeats 37 times>, "�\225\225�"}) at exceptions.c:373
#11 0x0000000000602fbd in catch_errors (func=0x46fc27 <captured_main>, func_args=0x7fff750ca200, errstring=0xc7df05 "", mask=6)
at exceptions.c:518
#12 0x0000000000470cdd in gdb_main (args=0x7fff750ca200) at .././gdb/main.c:840
#13 0x000000000046fbe0 in main (argc=3, argv=0x7fff750ca2f8) at gdb.c:33
On Sat, 13 Dec 2008 03:04:47 +0100, Jim Blandy wrote:
> From: Jim Blandy <jimb@red-bean.com>
...
> * ui-file.c (stdio_file_write): Check return value from fwrite.
> (stdio_file_fputs): Check return value from fputs.
...
> diff --git a/gdb/ui-file.c b/gdb/ui-file.c
> index 9a1d892..2ed304f 100644
> --- a/gdb/ui-file.c
> +++ b/gdb/ui-file.c
> @@ -481,7 +481,8 @@ stdio_file_write (struct ui_file *file, const char *buf, long length_buf)
> if (stdio->magic != &stdio_file_magic)
> internal_error (__FILE__, __LINE__,
> _("stdio_file_write: bad magic number"));
> - fwrite (buf, length_buf, 1, stdio->file);
> + if (fwrite (buf, length_buf, 1, stdio->file) != 1)
> + error ("stdio_file_write: %s", safe_strerror (errno));
> }
>
> static void
> @@ -491,7 +492,8 @@ stdio_file_fputs (const char *linebuffer, struct ui_file *file)
> if (stdio->magic != &stdio_file_magic)
> internal_error (__FILE__, __LINE__,
> _("stdio_file_fputs: bad magic number"));
> - fputs (linebuffer, stdio->file);
> + if (fputs (linebuffer, stdio->file) == EOF)
> + error ("stdio_file_fputs: %s", safe_strerror (errno));
> }
>
> static int
next prev parent reply other threads:[~2008-12-14 18:26 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-13 2:05 Jim Blandy
2008-12-13 20:33 ` Mark Kettenis
2008-12-13 23:02 ` Andreas Schwab
2008-12-14 6:08 ` Jim Blandy
2008-12-14 19:57 ` Mark Kettenis
2008-12-14 21:54 ` Paul Pluzhnikov
2008-12-14 18:26 ` Jan Kratochvil [this message]
2008-12-14 18:26 ` RFA: Building GDB under GLIBC 2.8 [resend w/the patch] Jan Kratochvil
2008-12-15 9:02 ` RFA: Building GDB under GLIBC 2.8 Jim Blandy
2008-12-15 20:07 ` Tom Tromey
2008-12-15 20:17 ` Pedro Alves
2008-12-20 0:46 ` Jim Blandy
2008-12-29 5:50 ` Joel Brobecker
2008-12-29 23:48 ` Tom Tromey
2009-01-06 18:32 ` Jim Blandy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20081214182514.GA28215@host0.dyn.jankratochvil.net \
--to=jan.kratochvil@redhat.com \
--cc=gdb-patches@sources.redhat.com \
--cc=jimb@red-bean.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox