Bug 13308 - (cpychecker) Memory leak in gdb/python/py-breakpoint.c: gdbpy_breakpoints
Summary: (cpychecker) Memory leak in gdb/python/py-breakpoint.c: gdbpy_breakpoints
Status: RESOLVED FIXED
Alias: None
Product: gdb
Classification: Unclassified
Component: python (show other bugs)
Version: unknown
: P2 normal
Target Milestone: 7.4
Assignee: Phil Muldoon
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-17 20:04 UTC by Dave Malcolm
Modified: 2011-10-20 13:40 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments
HTML report showing the execution path that leaks memory (2.67 KB, text/html)
2011-10-17 20:04 UTC, Dave Malcolm
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dave Malcolm 2011-10-17 20:04:13 UTC
Created attachment 6010 [details]
HTML report showing the execution path that leaks memory

I'm experimenting with building GDB using a GCC plugin that adds a pass to check correct reference-count handling in CPython code (cpychecker); see https://fedorahosted.org/gcc-python-plugin/

I'm attaching an error report concerning:
  gdb/python/py-breakpoint.c: gdbpy_breakpoints

gdb.breakpoints() appears to leak the list of breakpoints each time it is called.
Comment 1 Sourceware Commits 2011-10-20 13:34:22 UTC
CVSROOT:	/cvs/src
Module name:	src
Changes by:	pmuldoon@sourceware.org	2011-10-20 13:34:17

Modified files:
	gdb            : ChangeLog 
	gdb/python     : py-breakpoint.c py-inferior.c 

Log message:
	2011-10-20  Phil Muldoon  <pmuldoon@redhat.com>
	
	PR python/13308
	PR python/13309
	
	* python/py-breakpoint.c (gdbpy_breakpoints): Fix List reference
	leak.
	* python/py-inferior.c (gdbpy_inferiors): Fix List reference
	leak.  Delete unused variables.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&r1=1.13445&r2=1.13446
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/python/py-breakpoint.c.diff?cvsroot=src&r1=1.26&r2=1.27
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/python/py-inferior.c.diff?cvsroot=src&r1=1.15&r2=1.16
Comment 2 Phil Muldoon 2011-10-20 13:40:06 UTC
Fixed and committed.