public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug python/10666] New: reloading Python convenience function segfaults with invalid free
@ 2009-09-19 10:04 jason dot orendorff at gmail dot com
  2009-09-19 10:27 ` [Bug python/10666] " jason dot orendorff at gmail dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: jason dot orendorff at gmail dot com @ 2009-09-19 10:04 UTC (permalink / raw)
  To: gdb-prs

# x.py
import gdb
def f():
    class Fn(gdb.Function):
        def invoke(self):
            return 3.14159
    Fn("pi")
f()

$ gdb
(gdb) python import x
(gdb) python reload(x)
Segmentation fault

valgrind says:
==19973== Invalid free() / delete / delete[]
==19973==    at 0x4025DFA: free (vg_replace_malloc.c:323)
==19973==    by 0x80E86F3: delete_cmd (cli-decode.c:671)
==19973==    by 0x80E87CA: add_cmd (cli-decode.c:157)
==19973==    by 0x8133737: add_internal_function (value.c:1419)
==19973==    by 0x8106A6D: fnpy_init (python-function.c:121)
==19973==    by 0x4139F54: (within /usr/lib/libpython2.6.so.1.0)
==19973==    by 0x40DA98B: PyObject_Call (in /usr/lib/libpython2.6.so.1.0)
==19973==    by 0x4180617: PyEval_EvalFrameEx (in /usr/lib/libpython2.6.so.1.0)
==19973==    by 0x4183B4E: PyEval_EvalFrameEx (in /usr/lib/libpython2.6.so.1.0)
==19973==    by 0x418490F: PyEval_EvalCodeEx (in /usr/lib/libpython2.6.so.1.0)
==19973==    by 0x4184A72: PyEval_EvalCode (in /usr/lib/libpython2.6.so.1.0)
==19973==    by 0x4196D5C: PyImport_ExecCodeModuleEx (in
/usr/lib/libpython2.6.so.1.0)
==19973==  Address 0x82ea90c is not stack'd, malloc'd or (recently) free'd

-- 
           Summary: reloading Python convenience function segfaults with
                    invalid free
           Product: gdb
           Version: archer
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: python
        AssignedTo: unassigned at sourceware dot org
        ReportedBy: jason dot orendorff at gmail dot com
                CC: gdb-prs at sourceware dot org


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

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

* [Bug python/10666] reloading Python convenience function segfaults with invalid free
  2009-09-19 10:04 [Bug python/10666] New: reloading Python convenience function segfaults with invalid free jason dot orendorff at gmail dot com
@ 2009-09-19 10:27 ` jason dot orendorff at gmail dot com
  2009-09-21 16:19 ` cvs-commit at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: jason dot orendorff at gmail dot com @ 2009-09-19 10:27 UTC (permalink / raw)
  To: gdb-prs


------- Additional Comments From jason dot orendorff at gmail dot com  2009-09-19 10:27 -------
Created an attachment (id=4217)
 --> (http://sourceware.org/bugzilla/attachment.cgi?id=4217&action=view)
fix

This fixes it.

Serves me right for not having a docstring. :-P


-- 


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

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

* [Bug python/10666] reloading Python convenience function segfaults with invalid free
  2009-09-19 10:04 [Bug python/10666] New: reloading Python convenience function segfaults with invalid free jason dot orendorff at gmail dot com
                   ` (2 preceding siblings ...)
  2009-09-21 16:19 ` cvs-commit at gcc dot gnu dot org
@ 2009-09-21 16:19 ` tromey at redhat dot com
  3 siblings, 0 replies; 5+ messages in thread
From: tromey at redhat dot com @ 2009-09-21 16:19 UTC (permalink / raw)
  To: gdb-prs


------- Additional Comments From tromey at redhat dot com  2009-09-21 16:19 -------
I've checked in the fix.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|6.8                         |6.9


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

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

* [Bug python/10666] reloading Python convenience function segfaults with invalid free
  2009-09-19 10:04 [Bug python/10666] New: reloading Python convenience function segfaults with invalid free jason dot orendorff at gmail dot com
  2009-09-19 10:27 ` [Bug python/10666] " jason dot orendorff at gmail dot com
@ 2009-09-21 16:19 ` cvs-commit at gcc dot gnu dot org
  2009-09-21 16:19 ` cvs-commit at gcc dot gnu dot org
  2009-09-21 16:19 ` tromey at redhat dot com
  3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2009-09-21 16:19 UTC (permalink / raw)
  To: gdb-prs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2009-09-21 16:19 -------
Subject: Bug 10666

CVSROOT:	/cvs/src
Module name:	src
Branch: 	gdb_7_0-branch
Changes by:	tromey@sourceware.org	2009-09-21 16:19:17

Modified files:
	gdb            : ChangeLog 
	gdb/python     : py-function.c 

Log message:
	2009-09-21  Jason Orendorff  <jason.orendorff@gmail.com>
	
	PR python/10666:
	* python/py-function.c (fnpy_init): Use xstrdup.

Patches:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&only_with_tag=gdb_7_0-branch&r1=1.10874.2.14&r2=1.10874.2.15
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gdb/python/py-function.c.diff?cvsroot=src&only_with_tag=gdb_7_0-branch&r1=1.1&r2=1.1.2.1



-- 


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

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

* [Bug python/10666] reloading Python convenience function segfaults with invalid free
  2009-09-19 10:04 [Bug python/10666] New: reloading Python convenience function segfaults with invalid free jason dot orendorff at gmail dot com
  2009-09-19 10:27 ` [Bug python/10666] " jason dot orendorff at gmail dot com
  2009-09-21 16:19 ` cvs-commit at gcc dot gnu dot org
@ 2009-09-21 16:19 ` cvs-commit at gcc dot gnu dot org
  2009-09-21 16:19 ` tromey at redhat dot com
  3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2009-09-21 16:19 UTC (permalink / raw)
  To: gdb-prs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2009-09-21 16:19 -------
Subject: Bug 10666

CVSROOT:	/cvs/src
Module name:	src
Changes by:	tromey@sourceware.org	2009-09-21 16:18:42

Modified files:
	gdb            : ChangeLog 
	gdb/python     : py-function.c 

Log message:
	2009-09-21  Jason Orendorff  <jason.orendorff@gmail.com>
	
	PR python/10666:
	* python/py-function.c (fnpy_init): Use xstrdup.

Patches:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&r1=1.10892&r2=1.10893
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gdb/python/py-function.c.diff?cvsroot=src&r1=1.1&r2=1.2



-- 


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

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

end of thread, other threads:[~2009-09-21 16:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-19 10:04 [Bug python/10666] New: reloading Python convenience function segfaults with invalid free jason dot orendorff at gmail dot com
2009-09-19 10:27 ` [Bug python/10666] " jason dot orendorff at gmail dot com
2009-09-21 16:19 ` cvs-commit at gcc dot gnu dot org
2009-09-21 16:19 ` cvs-commit at gcc dot gnu dot org
2009-09-21 16:19 ` tromey 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).