public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug python/15461] New: crash: gdb-7.6 gdbarch in archpy_disassemble() overwritten with NULL causes crash due to assert(gdbarch != NULL)
@ 2013-05-12  2:05 donb at capitolhillconsultants dot com
  2013-08-25  6:27 ` [Bug python/15461] " mail at dbalan dot in
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: donb at capitolhillconsultants dot com @ 2013-05-12  2:05 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=15461

             Bug #: 15461
           Summary: crash: gdb-7.6 gdbarch in archpy_disassemble()
                    overwritten with NULL causes crash due to
                    assert(gdbarch != NULL)
           Product: gdb
           Version: 7.6
            Status: NEW
          Severity: normal
          Priority: P2
         Component: python
        AssignedTo: unassigned@sourceware.org
        ReportedBy: donb@capitolhillconsultants.com
    Classification: Unclassified


gdb-7.6 release compiled from source --with-python. Installed to local. Tested
on /bin/bash to evaluate the python gdb.Architecture.disassemble() function.
Each Architecture() object fails when self is evaluated in the native code. The
core file generated by gdb, for some odd reason, is of size zero. Here is gdb
(installed on Linux Mint 14 via apt) debugging gdb-7.6:

(gdb) run
Starting program: /usr/local/bin/gdb -q /bin/bash
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Reading symbols from /bin/bash...(no debugging symbols found)...done.
(gdb) break main
Breakpoint 1 at 0x41bd70
(gdb) run
Starting program: /bin/bash

Breakpoint 1, 0x000000000041bd70 in main ()
(gdb) python
>a = gdb.Architecture()
>a.disassemble(0x000000000041bd70, 0x000000000041be00, 32)
>
Breakpoint 1, archpy_disassemble (self=0x7ffff7f61198, args=0x7ffff7ee4280,
kw=0x0) at ./python/py-arch.c:98
98      {
2: self = (PyObject *) 0x7ffff7f61198
1: gdbarch = (struct gdbarch *) 0x7ffff6e23b67 <PyCode_Optimize+2567>
(gdb) break gdb_print_insn
Breakpoint 4 at 0x5350e0: file disasm.c, line 448.
(gdb) c
Continuing.

Breakpoint 2, archpy_disassemble (self=0x7ffff7f61198, args=0x7ffff7ee4280,
kw=0x0) at ./python/py-arch.c:105
105       struct gdbarch *gdbarch = arch_object_to_gdbarch (self);
2: self = (PyObject *) 0x7ffff7f61198
1: gdbarch = (struct gdbarch *) 0xb28d80 <arch_object_type>
(gdb) c
Continuing.

Breakpoint 3, 0x00000000004de560 in archpy_disassemble (self=<optimized out>,
args=<optimized out>, kw=<optimized out>)
    at ./python/py-arch.c:107
107       if (!PyArg_ParseTupleAndKeywords (args, kw, GDB_PY_LLU_ARG "|OO",
keywords,
2: self = <optimized out>
1: gdbarch = (struct gdbarch *) 0x0
(gdb) c
Continuing.
gdbarch.c:1423: internal-error: gdbarch_bfd_arch_info: Assertion `gdbarch !=
NULL' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n)

donb@testmint gdb-7.6 $ ls -l core
-rwxrwx--- 1 root vboxsf 0 May 11 19:59 core
donb@testmint gdb-7.6 $ date
Sat May 11 19:59:41 MDT 2013
donb@testmint gdb-7.6 $

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug python/15461] crash: gdb-7.6 gdbarch in archpy_disassemble() overwritten with NULL causes crash due to assert(gdbarch != NULL)
  2013-05-12  2:05 [Bug python/15461] New: crash: gdb-7.6 gdbarch in archpy_disassemble() overwritten with NULL causes crash due to assert(gdbarch != NULL) donb at capitolhillconsultants dot com
@ 2013-08-25  6:27 ` mail at dbalan dot in
  2013-08-28 10:40 ` pmuldoon at redhat dot com
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: mail at dbalan dot in @ 2013-08-25  6:27 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=15461

dhananjay <mail at dbalan dot in> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mail at dbalan dot in

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug python/15461] crash: gdb-7.6 gdbarch in archpy_disassemble() overwritten with NULL causes crash due to assert(gdbarch != NULL)
  2013-05-12  2:05 [Bug python/15461] New: crash: gdb-7.6 gdbarch in archpy_disassemble() overwritten with NULL causes crash due to assert(gdbarch != NULL) donb at capitolhillconsultants dot com
  2013-08-25  6:27 ` [Bug python/15461] " mail at dbalan dot in
@ 2013-08-28 10:40 ` pmuldoon at redhat dot com
  2013-08-28 10:41 ` pmuldoon at redhat dot com
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pmuldoon at redhat dot com @ 2013-08-28 10:40 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=15461

Phil Muldoon <pmuldoon at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pmuldoon at redhat dot com
           Assignee|unassigned at sourceware dot org   |pmuldoon at redhat dot com

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug python/15461] crash: gdb-7.6 gdbarch in archpy_disassemble() overwritten with NULL causes crash due to assert(gdbarch != NULL)
  2013-05-12  2:05 [Bug python/15461] New: crash: gdb-7.6 gdbarch in archpy_disassemble() overwritten with NULL causes crash due to assert(gdbarch != NULL) donb at capitolhillconsultants dot com
  2013-08-25  6:27 ` [Bug python/15461] " mail at dbalan dot in
  2013-08-28 10:40 ` pmuldoon at redhat dot com
@ 2013-08-28 10:41 ` pmuldoon at redhat dot com
  2013-08-28 10:45 ` pmuldoon at redhat dot com
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pmuldoon at redhat dot com @ 2013-08-28 10:41 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=15461

--- Comment #1 from Phil Muldoon <pmuldoon at redhat dot com> ---
*** Bug 15888 has been marked as a duplicate of this bug. ***

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug python/15461] crash: gdb-7.6 gdbarch in archpy_disassemble() overwritten with NULL causes crash due to assert(gdbarch != NULL)
  2013-05-12  2:05 [Bug python/15461] New: crash: gdb-7.6 gdbarch in archpy_disassemble() overwritten with NULL causes crash due to assert(gdbarch != NULL) donb at capitolhillconsultants dot com
                   ` (2 preceding siblings ...)
  2013-08-28 10:41 ` pmuldoon at redhat dot com
@ 2013-08-28 10:45 ` pmuldoon at redhat dot com
  2013-08-30 10:12 ` cvs-commit at gcc dot gnu.org
  2013-08-30 10:15 ` pmuldoon at redhat dot com
  5 siblings, 0 replies; 7+ messages in thread
From: pmuldoon at redhat dot com @ 2013-08-28 10:45 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=15461

Phil Muldoon <pmuldoon at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED

--- Comment #2 from Phil Muldoon <pmuldoon at redhat dot com> ---
gdb.Architecture should never be instantiated directly.  Regardless, we should
gate the calls to the functions to check that there is a valid architecture.  I
have a patch pending for this.  I will update the PR when it is submitted,
reviewed and accepted.

Just as a note, to get an architecture object, one should obtain it from a
frame.  
For example:

frame = gdb.selected_frame()
arch = frame.architecture()

As each frame can have a different architecture.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug python/15461] crash: gdb-7.6 gdbarch in archpy_disassemble() overwritten with NULL causes crash due to assert(gdbarch != NULL)
  2013-05-12  2:05 [Bug python/15461] New: crash: gdb-7.6 gdbarch in archpy_disassemble() overwritten with NULL causes crash due to assert(gdbarch != NULL) donb at capitolhillconsultants dot com
                   ` (3 preceding siblings ...)
  2013-08-28 10:45 ` pmuldoon at redhat dot com
@ 2013-08-30 10:12 ` cvs-commit at gcc dot gnu.org
  2013-08-30 10:15 ` pmuldoon at redhat dot com
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2013-08-30 10:12 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=15461

--- Comment #3 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
CVSROOT:    /cvs/src
Module name:    src
Changes by:    pmuldoon@sourceware.org    2013-08-30 10:12:19

Modified files:
    gdb            : ChangeLog 
    gdb/python     : py-arch.c 
    gdb/testsuite  : ChangeLog 
    gdb/testsuite/gdb.python: py-arch.exp 

Log message:
    2013-08-30  Phil Muldoon  <pmuldoon@redhat.com>

    PR python/15461

    * python/py-arch.c (ARCHPY_REQUIRE_VALID): New macro.
    (archpy_name): Check for valid architecture.
    (archpy_disassemble): Ditto.

    2013-08-30  Phil Muldoon  <pmuldoon@redhat.com>

    * gdb.python/py-arch.exp: Tests for invalid architecture.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&r1=1.15951&r2=1.15952
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/python/py-arch.c.diff?cvsroot=src&r1=1.7&r2=1.8
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/ChangeLog.diff?cvsroot=src&r1=1.3793&r2=1.3794
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.python/py-arch.exp.diff?cvsroot=src&r1=1.3&r2=1.4

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug python/15461] crash: gdb-7.6 gdbarch in archpy_disassemble() overwritten with NULL causes crash due to assert(gdbarch != NULL)
  2013-05-12  2:05 [Bug python/15461] New: crash: gdb-7.6 gdbarch in archpy_disassemble() overwritten with NULL causes crash due to assert(gdbarch != NULL) donb at capitolhillconsultants dot com
                   ` (4 preceding siblings ...)
  2013-08-30 10:12 ` cvs-commit at gcc dot gnu.org
@ 2013-08-30 10:15 ` pmuldoon at redhat dot com
  5 siblings, 0 replies; 7+ messages in thread
From: pmuldoon at redhat dot com @ 2013-08-30 10:15 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=15461

Phil Muldoon <pmuldoon at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|---                         |7.7

--- Comment #4 from Phil Muldoon <pmuldoon at redhat dot com> ---
This patch has now been committed, and will be included in the next GDB release

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-08-30 10:15 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-12  2:05 [Bug python/15461] New: crash: gdb-7.6 gdbarch in archpy_disassemble() overwritten with NULL causes crash due to assert(gdbarch != NULL) donb at capitolhillconsultants dot com
2013-08-25  6:27 ` [Bug python/15461] " mail at dbalan dot in
2013-08-28 10:40 ` pmuldoon at redhat dot com
2013-08-28 10:41 ` pmuldoon at redhat dot com
2013-08-28 10:45 ` pmuldoon at redhat dot com
2013-08-30 10:12 ` cvs-commit at gcc dot gnu.org
2013-08-30 10:15 ` pmuldoon at redhat dot com

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).