public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Brian Vandenberg <phantall@gmail.com>
To: gdb-patches@sourceware.org
Subject: [PATCH][PING][PR gdb/19374] null-ptr dereference on solaris when running get_osdata( "processes" )
Date: Tue, 07 Aug 2018 19:29:00 -0000	[thread overview]
Message-ID: <CAEJ-0i8AgKLaFKUnp0CzFpAzkwSg1_G=qNxCtM69BeNajWCL6Q@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1030 bytes --]

This patch is to address bug 19374 on solaris.

When running gdb under eclipse/CDT on Solaris, eclipse runs gdb with:

gdb --interpreter mi2 --nx

During execution it ends up sending the following string to gdb:

16-list-thread-groups --available

... at which point gdb crashes.

This patch partially reverts the change in the following:

http://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commitdiff;h=e75fdfcad1c868eae5396a95be9dd18010406306#patch4

... by re-adding the check for ops->beneath != NULL and returning
TARGET_XFER_E_IO.

I cannot easily run the test suite against these changes right now.
If this gets rejected based on that, I'll see about getting something
setup at home to run the tests when I have time.

----

note: this patch was tested against 8.1.1.  I don't know [yet] whether
this is still a problem in 8.2 because of the procfs C++ conversion.
The same logic still exists but "beneath" appears to be a function
object.

-brian

ps, my assignment/release forms were completed/received 10/30/2017

[-- Attachment #2: gdb-19374-patch, revised.txt --]
[-- Type: text/plain, Size: 742 bytes --]

gdb/Changelog:
2018-08-07  Brian Vandenberg <phantall@gmail.com>

	PR gdb/19374
	* gdb/procfs.c (procfs_xfer_partial): Added check for ops->beneath != NULL

diff --git a/gdb/procfs.c b/gdb/procfs.c
--- a/gdb/procfs.c
+++ b/gdb/procfs.c
@@ --2599,9 +2599,12 @@ procfs_xfer_partial (struct target_ops *ops, enum target_object object,
 #endif

     default:
-      return ops->beneath->to_xfer_partial (ops->beneath, object, annex,
+      if( ops->beneath )
+        return ops->beneath->to_xfer_partial (ops->beneath, object, annex,
                                            readbuf, writebuf, offset, len,
                                            xfered_len);
+      else
+        return TARGET_XFER_E_IO;
     }
 }

             reply	other threads:[~2018-08-07 19:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-07 19:29 Brian Vandenberg [this message]
2018-08-07 21:37 ` Simon Marchi
2018-08-08 15:06 ` Tom Tromey
  -- strict thread matches above, loose matches on Subject: below --
2016-01-05 17:30 Brian Vandenberg

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='CAEJ-0i8AgKLaFKUnp0CzFpAzkwSg1_G=qNxCtM69BeNajWCL6Q@mail.gmail.com' \
    --to=phantall@gmail.com \
    --cc=gdb-patches@sourceware.org \
    /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).