Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Doug Evans <dje@google.com>
To: Paul Pluzhnikov <ppluzhnikov@google.com>
Cc: gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [patch] Fix crash in svr4_clear_so
Date: Tue, 21 May 2013 23:14:00 -0000	[thread overview]
Message-ID: <CADPb22SOMtVOtn6Q3y68BxgHxD0Z1b=c0FGq+3oYaXPvFky_-Q@mail.gmail.com> (raw)
In-Reply-To: <ye6qa9no55vu.fsf@elbrus2.mtv.corp.google.com>

On Tue, May 21, 2013 at 3:23 PM, Paul Pluzhnikov <ppluzhnikov@google.com> wrote:
> Greetings,
>
> Using current trunk, I've got a GDB core dump when I tried to analyze
> mis-matched binary and core:
>
> gdb a.out core
> GNU gdb (GDB) 7.6.50.20130521-cvs
> ...
> warning: core file may not match specified executable file.
> [New LWP 29265]
> ...
> [New LWP 27085]
> [New LWP 27052]
> warning: Error reading shared library list entry at 0x3b48104f8b480000
> Segmentation fault
>
> The actual crash is happening here:
>
> Program received signal SIGSEGV, Segmentation fault.
> 0x0000000000481376 in svr4_clear_so (so=0xc833490) at ../../src/gdb/solib-svr4.c:974
> 974       so->lm_info->l_addr_p = 0;
>
> #0  0x0000000000481376 in svr4_clear_so (so=0xc833490) at ../../src/gdb/solib-svr4.c:974
> #1  0x0000000000708bc4 in clear_so (so=0xc833490) at ../../src/gdb/solib.c:537
> #2  0x0000000000708bef in free_so (so=0xc833490) at ../../src/gdb/solib.c:556
> #3  0x00000000006ee328 in do_free_so (arg=0xc833490) at ../../src/gdb/utils.c:492
> #4  0x0000000000573474 in do_my_cleanups (pmy_chain=0xc5c1f0 <cleanup_chain>, old_chain=0x35232410) at ../../src/gdb/cleanups.c:155
> #5  0x00000000005734e1 in do_cleanups (old_chain=0x35232410) at ../../src/gdb/cleanups.c:177
> #6  0x00000000004817e0 in svr4_read_so_list (lm=4271682180386127872, link_ptr_ptr=0x7fff7fc37c58, ignore_first=1) at ../../src/gdb/solib-svr4.c:1195
> #7  0x0000000000481b01 in svr4_current_sos () at ../../src/gdb/solib-svr4.c:1311
> #8  0x0000000000708eea in update_solib_list (from_tty=0, target=0xc724c0 <core_ops>) at ../../src/gdb/solib.c:674
> ...
>
> Attached patch fixes the GDB crash.
>
> Ok for trunk?
>
> Thanks,
> --
>
> 2013-05-21  Paul Pluzhnikov  <ppluzhnikov@google.com>
>
>         * solib-svr4.c (svr4_free_so): Protect against NULL dereference.

Hi.
Ok by me.


  reply	other threads:[~2013-05-21 23:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-21 22:23 Paul Pluzhnikov
2013-05-21 23:14 ` Doug Evans [this message]
2013-05-22 10:32 ` Gary Benson

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='CADPb22SOMtVOtn6Q3y68BxgHxD0Z1b=c0FGq+3oYaXPvFky_-Q@mail.gmail.com' \
    --to=dje@google.com \
    --cc=gdb-patches@sourceware.org \
    --cc=ppluzhnikov@google.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