From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13031 invoked by alias); 12 Jul 2007 14:17:12 -0000 Received: (qmail 13012 invoked by uid 48); 12 Jul 2007 14:17:04 -0000 Date: Thu, 12 Jul 2007 14:17:00 -0000 Message-ID: <20070712141704.13011.qmail@sourceware.org> From: "pmuldoon at redhat dot com" To: frysk-bugzilla@sourceware.org In-Reply-To: <20070711170852.4777.cagney@redhat.com> References: <20070711170852.4777.cagney@redhat.com> Reply-To: sourceware-bugzilla@sourceware.org Subject: [Bug general/4777] fd smash from Elf exception X-Bugzilla-Reason: AssignedTo Mailing-List: contact frysk-bugzilla-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Post: List-Help: , Sender: frysk-bugzilla-owner@sourceware.org X-SW-Source: 2007-q3/txt/msg00098.txt.bz2 List-Id: ------- Additional Comments From pmuldoon at redhat dot com 2007-07-12 14:17 ------- The problem is in part the way the Elf object is being used in various parts of Frysk's code like this: try { elf = new Elf(proc.getExe(), ElfCommand.ELF_C_READ); dwarf = new Dwarf(elf, DwarfCommand.READ, null); } catch (lib.elf.ElfException ignore) { // FIXME: Why is this ignored? } The problem here is two-fold. The elf exception should be caught in it's own try, not in a composite try block and dealt with. And the code should fail at that point. Also fd = 0 was a poor choice of an initial value in the Elf's native code. The other part if that that Elf object is not valid, yet still allows access to the native sections. In Java, a constructor is never allowed to return null, so I suggest we gate further calls with a boolean gate. something like nativeSuccess = true. -- http://sourceware.org/bugzilla/show_bug.cgi?id=4777 ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee.