Bug 167693 - Uninitialised free when running "info line main"
Summary: Uninitialised free when running "info line main"
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: gdb
Version: 3.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jeff Johnston
QA Contact: Jay Turner
URL:
Whiteboard:
Depends On:
Blocks: 161600 168424
TreeView+ depends on / blocked
 
Reported: 2005-09-07 09:52 UTC by Bastien Nocera
Modified: 2015-01-08 00:10 UTC (History)
4 users (show)

Fixed In Version: RHBA-2006-0141
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-03-15 17:03:18 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
gdb-info-list-main-uninit-free.patch (544 bytes, patch)
2005-09-07 09:52 UTC, Bastien Nocera
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2006:0141 0 qe-ready SHIPPED_LIVE gdb bug fix update 2006-03-14 05:00:00 UTC

Description Bastien Nocera 2005-09-07 09:52:34 UTC
1. create a small hello world C program
2. compile it with debugging
3. run the program under gdb
4. type "info line main" in gdb
5. segfault

Reproduceable with the RHEL3 U5 gdb, and the RHEL4 U2 candidate.

valgrind says there's an invalid free:
==21896== Invalid free() / delete / delete[]
==21896==    at 0x3414A75D: free (vg_replace_malloc.c:153)
==21896==    by 0x80F3229: find_line_pc_range (symtab.c:2432)
==21896==    by 0x80DE1D9: ??? (source.c:1351)
==21896==    by 0x80845C5: execute_command (top.c:733)
==21896==  Address 0x9C5FDEE8 is on thread 1's stack
Line 5 of "tmp.c" starts at address 0x8048368 <main>
  and ends at 0x8048384 <main+28>.

In gdb/symtab.c, find_line_pc_range(), pc_list is only defined if startaddr is
0, but freed unconditionally. Patch attached.

Comment 1 Bastien Nocera 2005-09-07 09:52:34 UTC
Created attachment 118546 [details]
gdb-info-list-main-uninit-free.patch

Comment 9 Jeff Johnston 2005-11-30 23:01:55 UTC
Patch applied as of gdb-6.3.0.0-1.66

Comment 23 Red Hat Bugzilla 2006-03-15 17:03:18 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2006-0141.html



Note You need to log in before you can comment on or make changes to this bug.