public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libgcj/11779] New: Field reflection incorrectly throws IllegalAccessException
@ 2003-08-03 6:03 bryce at mckinlay dot net dot nz
2003-08-03 13:56 ` [Bug libgcj/11779] " pinskia at physics dot uc dot edu
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: bryce at mckinlay dot net dot nz @ 2003-08-03 6:03 UTC (permalink / raw)
To: gcc-bugs
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11779
Summary: Field reflection incorrectly throws
IllegalAccessException
Product: gcc
Version: 3.4
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: libgcj
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: bryce at mckinlay dot net dot nz
CC: gcc-bugs at gcc dot gnu dot org
There appears to be a problem with security checks recently added to reflection code. The
following test case incorrectly throws IllegalAccessException.
import java.lang.reflect.*;
public class RefTest
{
int value;
public static void main(String[] args)
throws NoSuchFieldException, IllegalAccessException
{
RefTest testObj = new RefTest();
Field field = RefTest.class.getDeclaredField("value");
field.setInt(testObj, 777);
}
}
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug libgcj/11779] Field reflection incorrectly throws IllegalAccessException
2003-08-03 6:03 [Bug libgcj/11779] New: Field reflection incorrectly throws IllegalAccessException bryce at mckinlay dot net dot nz
@ 2003-08-03 13:56 ` pinskia at physics dot uc dot edu
2003-08-05 19:24 ` tromey at gcc dot gnu dot org
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: pinskia at physics dot uc dot edu @ 2003-08-03 13:56 UTC (permalink / raw)
To: gcc-bugs
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11779
pinskia at physics dot uc dot edu changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Last reconfirmed|0000-00-00 00:00:00 |2003-08-03 13:56:02
date| |
------- Additional Comments From pinskia at physics dot uc dot edu 2003-08-03 13:56 -------
I can confirm this on the mainline (20030802) on powerpc-apple-darwin6.6 but I really
get an EXC_BAD_ACCESS:
0x00008d88 in _Jv_CheckAccess(java::lang::Class*, java::lang::Class*, int) (self_klass=
0x0, other_klass=0x1f50b0, flags=0) at /Volumes/UFS_Partition/pinskia/src/fsf/gcc-clean/
src/libjava/prims.cc:1150
1150 return ((self_klass == other_klass)
(gdb) bt
#0 0x00008d88 in _Jv_CheckAccess(java::lang::Class*, java::lang::Class*, int)
(self_klass=0x0, other_klass=0x1f50b0, flags=0) at /Volumes/UFS_Partition/pinskia/src/
fsf/gcc-clean/src/libjava/prims.cc:1150
#1 0x0003fd38 in getAddr(java::lang::reflect::Field*, java::lang::Class*,
java::lang::Object*) (field=0x0, caller=0x0, obj=0xadfef0) at java/lang/reflect/Field.h:16
#2 0x0003fd38 in getAddr(java::lang::reflect::Field*, java::lang::Class*,
java::lang::Object*) (field=0x0, caller=0x0, obj=0xadfef0) at java/lang/reflect/Field.h:16
#3 0x0004075c in setAddr(java::lang::reflect::Field*, java::lang::Class*,
java::lang::Object*) (field=0x0, caller=0x0, obj=0x0) at /Volumes/UFS_Partition/pinskia/
src/fsf/gcc-clean/src/libjava/java/lang/reflect/natField.cc:257
#4 0x000410b0 in java::lang::reflect::Field::setInt(java::lang::Class*, java::lang::Object*,
int) (this=0xad1438, caller=0x1f50b0, obj=0x0, i=777) at /Volumes/UFS_Partition/pinskia/
src/fsf/gcc-clean/src/libjava/java/lang/reflect/natField.cc:401
#5 0x000028e8 in RefTest.main(java.lang.String[]) (args=0x1f50b0) at RefTest.java:14
#6 0x000566c0 in gnu::gcj::runtime::FirstThread::call_main() (this=0xa7e9a0) at /
Volumes/UFS_Partition/pinskia/src/fsf/gcc-clean/src/libjava/gnu/gcj/runtime/
natFirstThread.cc:46
#7 0x00020d90 in _Jv_ThreadRun(java::lang::Thread*) (thread=0xa7e9a0) at /
Volumes/UFS_Partition/pinskia/src/fsf/gcc-clean/src/libjava/java/lang/natThread.cc:285
#8 0x000087d0 in _Jv_RunMain(java::lang::Class*, char const*, int, char const**, bool)
(klass=0x1f50b0, name=0x0, argc=11004320, argv=0x2546b8, is_jar=false) at /
Volumes/UFS_Partition/pinskia/src/fsf/gcc-clean/src/libjava/prims.cc:986
#9 0x000024d0 in _start (argc=2442936, argv=0xa7e9a0, envp=0x2546b8) at /
SourceCache/Csu/Csu-45/crt.c:267
#10 0x00002350 in start ()
Current language: auto; currently c++
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug libgcj/11779] Field reflection incorrectly throws IllegalAccessException
2003-08-03 6:03 [Bug libgcj/11779] New: Field reflection incorrectly throws IllegalAccessException bryce at mckinlay dot net dot nz
2003-08-03 13:56 ` [Bug libgcj/11779] " pinskia at physics dot uc dot edu
@ 2003-08-05 19:24 ` tromey at gcc dot gnu dot org
2003-08-05 20:07 ` cvs-commit at gcc dot gnu dot org
2003-08-05 20:08 ` tromey at gcc dot gnu dot org
3 siblings, 0 replies; 5+ messages in thread
From: tromey at gcc dot gnu dot org @ 2003-08-05 19:24 UTC (permalink / raw)
To: gcc-bugs
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11779
tromey at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |tromey at gcc dot gnu dot
|dot org |org
Status|NEW |ASSIGNED
------- Additional Comments From tromey at gcc dot gnu dot org 2003-08-05 19:24 -------
I'm handling this.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug libgcj/11779] Field reflection incorrectly throws IllegalAccessException
2003-08-03 6:03 [Bug libgcj/11779] New: Field reflection incorrectly throws IllegalAccessException bryce at mckinlay dot net dot nz
2003-08-03 13:56 ` [Bug libgcj/11779] " pinskia at physics dot uc dot edu
2003-08-05 19:24 ` tromey at gcc dot gnu dot org
@ 2003-08-05 20:07 ` cvs-commit at gcc dot gnu dot org
2003-08-05 20:08 ` tromey at gcc dot gnu dot org
3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2003-08-05 20:07 UTC (permalink / raw)
To: gcc-bugs
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11779
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2003-08-05 20:07 -------
Subject: Bug 11779
CVSROOT: /cvs/gcc
Module name: gcc
Changes by: tromey@gcc.gnu.org 2003-08-05 20:06:58
Modified files:
libjava : ChangeLog
libjava/java/lang/reflect: natField.cc
Log message:
Fix for PR libgcj/11779:
* java/lang/reflect/natField.cc (getAddr): Skip frames in Field
class.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/ChangeLog.diff?cvsroot=gcc&r1=1.2087&r2=1.2088
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/java/lang/reflect/natField.cc.diff?cvsroot=gcc&r1=1.13&r2=1.14
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug libgcj/11779] Field reflection incorrectly throws IllegalAccessException
2003-08-03 6:03 [Bug libgcj/11779] New: Field reflection incorrectly throws IllegalAccessException bryce at mckinlay dot net dot nz
` (2 preceding siblings ...)
2003-08-05 20:07 ` cvs-commit at gcc dot gnu dot org
@ 2003-08-05 20:08 ` tromey at gcc dot gnu dot org
3 siblings, 0 replies; 5+ messages in thread
From: tromey at gcc dot gnu dot org @ 2003-08-05 20:08 UTC (permalink / raw)
To: gcc-bugs
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11779
tromey at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
------- Additional Comments From tromey at gcc dot gnu dot org 2003-08-05 20:08 -------
I've checked in the fix for this.
The test case is now in Mauve.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2003-08-05 20:08 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-03 6:03 [Bug libgcj/11779] New: Field reflection incorrectly throws IllegalAccessException bryce at mckinlay dot net dot nz
2003-08-03 13:56 ` [Bug libgcj/11779] " pinskia at physics dot uc dot edu
2003-08-05 19:24 ` tromey at gcc dot gnu dot org
2003-08-05 20:07 ` cvs-commit at gcc dot gnu dot org
2003-08-05 20:08 ` tromey at gcc dot gnu dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).