This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
win32/2166: Unchecked file close causes SEGV
- From: roblip at gmail dot com
- To: gdb-gnats at sources dot redhat dot com
- Date: 2 Sep 2006 23:27:32 -0000
- Subject: win32/2166: Unchecked file close causes SEGV
- Reply-to: roblip at gmail dot com
>Number: 2166
>Category: win32
>Synopsis: Unchecked file close causes SEGV
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sat Sep 02 23:28:01 UTC 2006
>Closed-Date:
>Last-Modified:
>Originator: roblip@gmail.com
>Release: gdb-6.5.50.20060902
>Organization:
>Environment:
Windows 2003 X64, cygwin 1.5.21
>Description:
When attempting to load symbols from a nonexistent file, gdb crashes in bfd_close() called from win32-nat.c:
solib_symbols_add (struct so_list *so, CORE_ADDR load_addr)
{
........
abfd = bfd_openr (name, "pei-i386");
........
bfd_close (abfd);
........
}
>How-To-Repeat:
gdb.exe gdb.exe
> run
Error: dll starting at 0x77d41000 not found.
SEGV
>Fix:
Add check before bfd_close(abfd), ie:
if (abfd)
bfd_close(abfd)
>Release-Note:
>Audit-Trail:
>Unformatted: