From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28923 invoked by alias); 2 Nov 2005 16:35:02 -0000 Mailing-List: contact java-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: java-prs-owner@gcc.gnu.org Received: (qmail 28813 invoked by uid 48); 2 Nov 2005 16:34:57 -0000 Date: Wed, 02 Nov 2005 16:35:00 -0000 Subject: [Bug libgcj/24638] New: inconsistent use of Jv_FindClass causing too weak error condition X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: java-prs@gcc.gnu.org From: "thebohemian at gmx dot net" X-SW-Source: 2005-q4/txt/msg00265.txt.bz2 List-Id: Jv_FindClass throws a ClassNotFoundException in case the requested class cannot be resolved (regardless of whether the bytecode missing or a further dependency cannot be resolved). This causes problems because in case of serious bytecode errors (eg. the class of a field is missing) where a NoClassDefFoundError should reach the user code. I found code in several places in gcj where the caller of Jv_FindClass expected NULL to be returned. This affects Jv_FindClassFromSignature too because it depends on the former function. Obviously such code will not be executed (unless the Jv_FindClass takes a special codepath where it call Jv_FindClassInCache). - link.cc: around line 1000, look for: if (target_class == NULL) throw new java::lang::NoClassDefFoundError (_Jv_NewStringUTF (sym.class_name->chars())); - verify.cc: around 387, look for data.klass = _Jv_FindClassFromSignature (data.name->chars(), loader); if (data.klass == NULL) throw new java::lang::NoClassDefFoundError(data.name->toString()); I want to hear what the experts have to say about that. My suggestion would be to introduce a special variant of Jv_FindClass which does not throw a ClassNotFoundException (by swallowing it) and then carefully adjusting the code location where the old variant was used. -- Summary: inconsistent use of Jv_FindClass causing too weak error condition Product: gcc Version: 4.0.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libgcj AssignedTo: thebohemian at gmx dot net ReportedBy: thebohemian at gmx dot net http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24638