Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Gary Benson <gbenson@redhat.com>
To: Pedro Alves <palves@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [OB PATCH] Fix NULL pointer dereference
Date: Mon, 13 Feb 2017 12:10:00 -0000	[thread overview]
Message-ID: <20170213120957.GA25595@blade.nx> (raw)
In-Reply-To: <bc852220-4857-e91d-21bf-a143aa784803@redhat.com>

Pedro Alves wrote:
> So we reach this call of the 'expansion_notify' function pointer:
> 
>       if (recursively_search_psymtabs (ps, objfile, kind, symbol_matcher, data))
> 	{
> 	  struct compunit_symtab *symtab =
> 	    psymtab_to_symtab (objfile, ps);
> 
> 	  if (expansion_notify != NULL)
> 	    expansion_notify (symtab, data);
> 	}
>     }
> 
> So why can recursively_search_psymtabs find a matching partial
> symbol and thus return true, and then psymtab_to_symtab returns
> NULL, indicating the symtab is empty?  That sounds like a bug?

So the first time psymtab_to_symtab returns NULL, ps->filename is
"src/basic/string-util.h"; the only string-util.h on my system is
/usr/src/debug/systemd-231/src/basic/string-util.h from
systemd-debuginfo-231-10.fc25.x86_64 so I'm assuming it's that.

But, recursively_search_psymtabs is returning 1 not for that psymtab
but for one of its dependencies (the first, as it happens).  That has
no filename, and its user->filename is "<artificial>".  So
recursively_search_psymtabs is saying string-util.h matches because
it matches because of some (shared?) symbol table it references, but
psymtab_to_symtab is being called on the string-util.h psymtab which
doesn't match (or exist?!)

I have no idea what I'm looking at here :(

Thanks,
Gary

-- 
http://gbenson.net/


      reply	other threads:[~2017-02-13 12:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-09 15:39 Gary Benson
2017-02-09 18:33 ` Pedro Alves
2017-02-10 11:19   ` Gary Benson
2017-02-10 12:58     ` Pedro Alves
2017-02-13 12:10       ` Gary Benson [this message]

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=20170213120957.GA25595@blade.nx \
    --to=gbenson@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.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