public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Mikael Szreder via Gdb-patches <gdb-patches@sourceware.org>
Cc: Mikael Szreder <miksz574@student.liu.se>
Subject: Re: [PATCH] gdb/solib-svr4.c: Fix segfault caused by NULL pointer
Date: Fri, 04 Mar 2022 07:35:15 -0700	[thread overview]
Message-ID: <875yotvl98.fsf@tromey.com> (raw)
In-Reply-To: <DU0P191MB20333F5BF639A7C4AFBAE4A8A5059@DU0P191MB2033.EURP191.PROD.OUTLOOK.COM> (Mikael Szreder via Gdb-patches's message of "Fri, 4 Mar 2022 10:54:45 +0000")

>>>>> "Mikael" == Mikael Szreder via Gdb-patches <gdb-patches@sourceware.org> writes:

Mikael> Inside the function 'enable_break' there is a call to 'find_program_interpreter'.
Mikael> This function returns an empty vector when an ELF file does not contain
Mikael> an interpreter because the function 'read_program_header' header
Mikael> returns an empty vector on failure.

read_program_header also returns a gdb::optional, so it seems to me that
something else must be going on here.  Like, maybe the data that is read
from the target has 0 length?

I think the patch is basically ok, with one nit:

+  if (interp_name_holder && interp_name_holder->size() != 0)

... gdb style is a space before the "(".

However, I'd like to understand the underlying issue correctly first, so
at least the commit message can be updated -- or perhaps a test case added.

thanks,
Tom

  parent reply	other threads:[~2022-03-04 14:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-04 10:54 Mikael Szreder
2022-03-04 12:35 ` Bruno Larsen
2022-03-04 14:35 ` Tom Tromey [this message]
2022-03-04 16:13 ` Pedro Alves

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=875yotvl98.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    --cc=miksz574@student.liu.se \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).