win32/2166: Unchecked file close causes SEGV

roblip@gmail.com roblip@gmail.com
Sat Sep 2 23:28:00 GMT 2006


>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:



More information about the Gdb-prs mailing list