* gnu/testlet/java/lang/Thread/security10.java...
@ 2005-01-18 18:25 David Daney
2005-01-18 18:31 ` gnu/testlet/java/lang/Thread/security10.java Michael Koch
0 siblings, 1 reply; 10+ messages in thread
From: David Daney @ 2005-01-18 18:25 UTC (permalink / raw)
To: Michael Koch; +Cc: mauve-patches
2005-01-13 Michael Koch <konqueror@gmx.de>
* gnu/testlet/java/lang/Thread/security10.java:
New testcases.
Causes:
Exception in thread "main" java.lang.SecurityException
at
gnu.testlet.java.lang.Thread.security10$MySecurityManager.checkAccess
(security10.java:34)
at java.lang.Thread.checkAccess(Thread.java:1124)
at java.lang.Thread.setPriority(Thread.java:871)
at java.lang.Thread.init(Thread.java:293)
at java.lang.Thread.<init>(Thread.java:438)
at java.lang.ref.Finalizer$1.run(Finalizer.java:112)
at java.security.AccessController.doPrivileged(Native Method)
at
java.lang.ref.Finalizer.forkSecondaryFinalizer(Finalizer.java:121)
at java.lang.ref.Finalizer.runFinalization(Finalizer.java:126)
at java.lang.Runtime.runFinalization0(Native Method)
at java.lang.Runtime.runFinalization(Runtime.java:656)
at java.lang.System.runFinalization(System.java:759)
at
gnu.testlet.SimpleTestHarness.runtest(SimpleTestHarness.java:232)
at gnu.testlet.SimpleTestHarness.main(SimpleTestHarness.java:421)
When run with Sun's jre.
You install a security manager and then leave it there to interfere with
any tests that follow. That seems wrong.
David Daney.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: gnu/testlet/java/lang/Thread/security10.java...
2005-01-18 18:25 gnu/testlet/java/lang/Thread/security10.java David Daney
@ 2005-01-18 18:31 ` Michael Koch
2005-01-18 18:40 ` gnu/testlet/java/lang/Thread/security10.java David Daney
0 siblings, 1 reply; 10+ messages in thread
From: Michael Koch @ 2005-01-18 18:31 UTC (permalink / raw)
To: David Daney; +Cc: mauve-patches
Am Dienstag, 18. Januar 2005 19:24 schrieb David Daney:
> Causes:
> Exception in thread "main" java.lang.SecurityException
> at
> gnu.testlet.java.lang.Thread.security10$MySecurityManager.checkAcce
>ss (security10.java:34)
> at java.lang.Thread.checkAccess(Thread.java:1124)
> at java.lang.Thread.setPriority(Thread.java:871)
> at java.lang.Thread.init(Thread.java:293)
> at java.lang.Thread.<init>(Thread.java:438)
> at java.lang.ref.Finalizer$1.run(Finalizer.java:112)
> at java.security.AccessController.doPrivileged(Native
> Method) at
> java.lang.ref.Finalizer.forkSecondaryFinalizer(Finalizer.java:121)
> at
> java.lang.ref.Finalizer.runFinalization(Finalizer.java:126) at
> java.lang.Runtime.runFinalization0(Native Method) at
> java.lang.Runtime.runFinalization(Runtime.java:656) at
> java.lang.System.runFinalization(System.java:759) at
> gnu.testlet.SimpleTestHarness.runtest(SimpleTestHarness.java:232)
> at
> gnu.testlet.SimpleTestHarness.main(SimpleTestHarness.java:421)
>
> When run with Sun's jre.
which version of the JRE ? I used 1.4.2 and it passes the tests.
Michael
--
Homepage: http://www.worldforge.org/
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: gnu/testlet/java/lang/Thread/security10.java...
2005-01-18 18:31 ` gnu/testlet/java/lang/Thread/security10.java Michael Koch
@ 2005-01-18 18:40 ` David Daney
2005-01-18 19:04 ` gnu/testlet/java/lang/Thread/security10.java David Daney
2005-01-18 19:04 ` gnu/testlet/java/lang/Thread/security10.java Michael Koch
0 siblings, 2 replies; 10+ messages in thread
From: David Daney @ 2005-01-18 18:40 UTC (permalink / raw)
To: Michael Koch; +Cc: mauve-patches
Michael Koch wrote:
> Am Dienstag, 18. Januar 2005 19:24 schrieb David Daney:
>
>
>>Causes:
>>Exception in thread "main" java.lang.SecurityException
>> at
>>gnu.testlet.java.lang.Thread.security10$MySecurityManager.checkAcce
>>ss (security10.java:34)
>> at java.lang.Thread.checkAccess(Thread.java:1124)
>> at java.lang.Thread.setPriority(Thread.java:871)
>> at java.lang.Thread.init(Thread.java:293)
>> at java.lang.Thread.<init>(Thread.java:438)
>> at java.lang.ref.Finalizer$1.run(Finalizer.java:112)
>> at java.security.AccessController.doPrivileged(Native
>>Method) at
>>java.lang.ref.Finalizer.forkSecondaryFinalizer(Finalizer.java:121)
>> at
>>java.lang.ref.Finalizer.runFinalization(Finalizer.java:126) at
>>java.lang.Runtime.runFinalization0(Native Method) at
>>java.lang.Runtime.runFinalization(Runtime.java:656) at
>>java.lang.System.runFinalization(System.java:759) at
>>gnu.testlet.SimpleTestHarness.runtest(SimpleTestHarness.java:232)
>> at
>>gnu.testlet.SimpleTestHarness.main(SimpleTestHarness.java:421)
>>
>>When run with Sun's jre.
>
>
> which version of the JRE ? I used 1.4.2 and it passes the tests.
>
This is running on FC3 on i686
[daney@dl2 mauve]$ java -version
java version "1.4.2_06"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_06-b03)
Java HotSpot(TM) Client VM (build 1.4.2_06-b03, mixed mode)
I have no default security policy installed that I am aware of. It
could be an issue with security policies.
David Daney.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: gnu/testlet/java/lang/Thread/security10.java...
2005-01-18 18:40 ` gnu/testlet/java/lang/Thread/security10.java David Daney
@ 2005-01-18 19:04 ` David Daney
2005-01-18 19:07 ` gnu/testlet/java/lang/Thread/security10.java Michael Koch
2005-01-18 19:04 ` gnu/testlet/java/lang/Thread/security10.java Michael Koch
1 sibling, 1 reply; 10+ messages in thread
From: David Daney @ 2005-01-18 19:04 UTC (permalink / raw)
To: Michael Koch; +Cc: mauve-patches
David Daney wrote:
> Michael Koch wrote:
>
>> Am Dienstag, 18. Januar 2005 19:24 schrieb David Daney:
>>
>>
>>> Causes:
>>> Exception in thread "main" java.lang.SecurityException
>>> at
>>> gnu.testlet.java.lang.Thread.security10$MySecurityManager.checkAcce
>>> ss (security10.java:34)
>>> at java.lang.Thread.checkAccess(Thread.java:1124)
>>> at java.lang.Thread.setPriority(Thread.java:871)
>>> at java.lang.Thread.init(Thread.java:293)
>>> at java.lang.Thread.<init>(Thread.java:438)
>>> at java.lang.ref.Finalizer$1.run(Finalizer.java:112)
>>> at java.security.AccessController.doPrivileged(Native
>>> Method) at
>>> java.lang.ref.Finalizer.forkSecondaryFinalizer(Finalizer.java:121)
>>> at
>>> java.lang.ref.Finalizer.runFinalization(Finalizer.java:126) at
>>> java.lang.Runtime.runFinalization0(Native Method) at
>>> java.lang.Runtime.runFinalization(Runtime.java:656) at
>>> java.lang.System.runFinalization(System.java:759) at
>>> gnu.testlet.SimpleTestHarness.runtest(SimpleTestHarness.java:232)
>>> at
>>> gnu.testlet.SimpleTestHarness.main(SimpleTestHarness.java:421)
>>>
>>> When run with Sun's jre.
>>
>>
>>
>> which version of the JRE ? I used 1.4.2 and it passes the tests.
>>
>
> This is running on FC3 on i686
>
> [daney@dl2 mauve]$ java -version
> java version "1.4.2_06"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_06-b03)
> Java HotSpot(TM) Client VM (build 1.4.2_06-b03, mixed mode)
>
> I have no default security policy installed that I am aware of. It
> could be an issue with security policies.
>
After further thought, it is not a security policy problem. Your
security manager always throws SecurityException on any Thread method.
Sun's jre is trying to create a new Thread when System.runFinalization()
is called, and will always fail with your SecurityManager installed.
Perhaps you should save a reference to the original SecurityManager and
restore it when the test is finished. That would leave the test harness
in the same state after the Thread.security10 test as before.
David Daney.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: gnu/testlet/java/lang/Thread/security10.java...
2005-01-18 18:40 ` gnu/testlet/java/lang/Thread/security10.java David Daney
2005-01-18 19:04 ` gnu/testlet/java/lang/Thread/security10.java David Daney
@ 2005-01-18 19:04 ` Michael Koch
1 sibling, 0 replies; 10+ messages in thread
From: Michael Koch @ 2005-01-18 19:04 UTC (permalink / raw)
To: David Daney; +Cc: mauve-patches
Am Dienstag, 18. Januar 2005 19:40 schrieb David Daney:
> Michael Koch wrote:
> > Am Dienstag, 18. Januar 2005 19:24 schrieb David Daney:
> >>Causes:
> >>Exception in thread "main" java.lang.SecurityException
> >> at
> >>gnu.testlet.java.lang.Thread.security10$MySecurityManager.checkAc
> >>ce ss (security10.java:34)
> >> at java.lang.Thread.checkAccess(Thread.java:1124)
> >> at java.lang.Thread.setPriority(Thread.java:871)
> >> at java.lang.Thread.init(Thread.java:293)
> >> at java.lang.Thread.<init>(Thread.java:438)
> >> at java.lang.ref.Finalizer$1.run(Finalizer.java:112)
> >> at java.security.AccessController.doPrivileged(Native
> >>Method) at
> >>java.lang.ref.Finalizer.forkSecondaryFinalizer(Finalizer.java:121
> >>) at
> >>java.lang.ref.Finalizer.runFinalization(Finalizer.java:126) at
> >>java.lang.Runtime.runFinalization0(Native Method) at
> >>java.lang.Runtime.runFinalization(Runtime.java:656) at
> >>java.lang.System.runFinalization(System.java:759) at
> >>gnu.testlet.SimpleTestHarness.runtest(SimpleTestHarness.java:232)
> >> at
> >>gnu.testlet.SimpleTestHarness.main(SimpleTestHarness.java:421)
> >>
> >>When run with Sun's jre.
> >
> > which version of the JRE ? I used 1.4.2 and it passes the tests.
>
> This is running on FC3 on i686
>
> [daney@dl2 mauve]$ java -version
> java version "1.4.2_06"
> Java(TM) 2 Runtime Environment, Standard Edition (build
> 1.4.2_06-b03) Java HotSpot(TM) Client VM (build 1.4.2_06-b03, mixed
> mode)
>
> I have no default security policy installed that I am aware of. It
> could be an issue with security policies.
Can someone with acces to JDK 1.5 please try it ?
Michael
--
Homepage: http://www.worldforge.org/
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: gnu/testlet/java/lang/Thread/security10.java...
2005-01-18 19:04 ` gnu/testlet/java/lang/Thread/security10.java David Daney
@ 2005-01-18 19:07 ` Michael Koch
2005-01-18 19:18 ` gnu/testlet/java/lang/Thread/security10.java David Daney
0 siblings, 1 reply; 10+ messages in thread
From: Michael Koch @ 2005-01-18 19:07 UTC (permalink / raw)
To: mauve-patches; +Cc: David Daney
Am Dienstag, 18. Januar 2005 20:04 schrieb David Daney:
> David Daney wrote:
> > Michael Koch wrote:
> >> Am Dienstag, 18. Januar 2005 19:24 schrieb David Daney:
> >>> Causes:
> >>> Exception in thread "main" java.lang.SecurityException
> >>> at
> >>> gnu.testlet.java.lang.Thread.security10$MySecurityManager.check
> >>>Acce ss (security10.java:34)
> >>> at java.lang.Thread.checkAccess(Thread.java:1124)
> >>> at java.lang.Thread.setPriority(Thread.java:871)
> >>> at java.lang.Thread.init(Thread.java:293)
> >>> at java.lang.Thread.<init>(Thread.java:438)
> >>> at java.lang.ref.Finalizer$1.run(Finalizer.java:112)
> >>> at java.security.AccessController.doPrivileged(Native
> >>> Method) at
> >>> java.lang.ref.Finalizer.forkSecondaryFinalizer(Finalizer.java:1
> >>>21) at
> >>> java.lang.ref.Finalizer.runFinalization(Finalizer.java:126) at
> >>> java.lang.Runtime.runFinalization0(Native Method) at
> >>> java.lang.Runtime.runFinalization(Runtime.java:656) at
> >>> java.lang.System.runFinalization(System.java:759) at
> >>> gnu.testlet.SimpleTestHarness.runtest(SimpleTestHarness.java:23
> >>>2) at
> >>> gnu.testlet.SimpleTestHarness.main(SimpleTestHarness.java:421)
> >>>
> >>> When run with Sun's jre.
> >>
> >> which version of the JRE ? I used 1.4.2 and it passes the tests.
> >
> > This is running on FC3 on i686
> >
> > [daney@dl2 mauve]$ java -version
> > java version "1.4.2_06"
> > Java(TM) 2 Runtime Environment, Standard Edition (build
> > 1.4.2_06-b03) Java HotSpot(TM) Client VM (build 1.4.2_06-b03,
> > mixed mode)
> >
> > I have no default security policy installed that I am aware of.
> > It could be an issue with security policies.
>
> After further thought, it is not a security policy problem. Your
> security manager always throws SecurityException on any Thread
> method. Sun's jre is trying to create a new Thread when
> System.runFinalization() is called, and will always fail with your
> SecurityManager installed.
>
> Perhaps you should save a reference to the original SecurityManager
> and restore it when the test is finished. That would leave the
> test harness in the same state after the Thread.security10 test as
> before.
Hmmm, setting "null" should be enough as no SecurityManager may be set
initiallly.
Daney: Can you try if this works for you ?
Michael
--
Homepage: http://www.worldforge.org/
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: gnu/testlet/java/lang/Thread/security10.java...
2005-01-18 19:07 ` gnu/testlet/java/lang/Thread/security10.java Michael Koch
@ 2005-01-18 19:18 ` David Daney
0 siblings, 0 replies; 10+ messages in thread
From: David Daney @ 2005-01-18 19:18 UTC (permalink / raw)
To: Michael Koch; +Cc: mauve-patches
Michael Koch wrote:
> Am Dienstag, 18. Januar 2005 20:04 schrieb David Daney:
>
>>David Daney wrote:
>>
>>
>>After further thought, it is not a security policy problem. Your
>>security manager always throws SecurityException on any Thread
>>method. Sun's jre is trying to create a new Thread when
>>System.runFinalization() is called, and will always fail with your
>>SecurityManager installed.
>>
>>Perhaps you should save a reference to the original SecurityManager
>>and restore it when the test is finished. That would leave the
>>test harness in the same state after the Thread.security10 test as
>>before.
>
>
> Hmmm, setting "null" should be enough as no SecurityManager may be set
> initiallly.
>
> Daney: Can you try if this works for you ?
>
I could be several days before I can try it.
David Daney.
^ permalink raw reply [flat|nested] 10+ messages in thread
* RE: gnu/testlet/java/lang/Thread/security10.java...
@ 2005-02-02 18:42 Jeroen Frijters
0 siblings, 0 replies; 10+ messages in thread
From: Jeroen Frijters @ 2005-02-02 18:42 UTC (permalink / raw)
To: David Daney; +Cc: Michael Koch, mauve-patches
David Daney wrote:
> Still not quite right. I just committed this:
Indeed. Thanks. The default Classpath security policy is too lenient, so
I didn't notice this.
Regards,
Jeroen
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: gnu/testlet/java/lang/Thread/security10.java...
2005-01-31 11:26 gnu/testlet/java/lang/Thread/security10.java Jeroen Frijters
@ 2005-02-02 18:24 ` David Daney
0 siblings, 0 replies; 10+ messages in thread
From: David Daney @ 2005-02-02 18:24 UTC (permalink / raw)
To: Jeroen Frijters; +Cc: Michael Koch, mauve-patches
Jeroen Frijters wrote:
>
> I ran into this problem as well and I'm committing the attached patch to
> solve this.
>
> Regards,
> Jeroen
>
> 2005-01-31 Jeroen Frijters <jeroen@frijters.net>
>
> * gnu/testlet/java/lang/Thread/security10.java:
> Added code to save and restore security manager.
>
>
Still not quite right. I just committed this:
2005-02-02 David Daney <ddaney@avtrex.com>
* gnu/testlet/java/lang/Thread/security10.java:
Allow setSecurityManager.
Index: security10.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/java/lang/Thread/security10.java,v
retrieving revision 1.2
diff -c -p -r1.2 security10.java
*** security10.java 31 Jan 2005 11:26:16 -0000 1.2
--- security10.java 2 Feb 2005 18:17:43 -0000
***************
*** 1,6 ****
// Tags: JDK1.0
! // Copyright (C) 2004 Free Software Foundation, Inc.
// Written by Michael Koch (konqueror@gmx.de)
// This file is part of Mauve.
--- 1,6 ----
// Tags: JDK1.0
! // Copyright (C) 2004, 2005 Free Software Foundation, Inc.
// Written by Michael Koch (konqueror@gmx.de)
// This file is part of Mauve.
*************** package gnu.testlet.java.lang.Thread;
*** 24,29 ****
--- 24,30 ----
import gnu.testlet.Testlet;
import gnu.testlet.TestHarness;
+ import java.security.Permission;
public class security10 implements Testlet
{
*************** public class security10 implements Testl
*** 33,38 ****
--- 34,47 ----
{
throw new SecurityException();
}
+
+ public void checkPermission(Permission perm)
+ {
+ RuntimePermission p = new RuntimePermission("setSecurityManager");
+ if (p.implies(perm))
+ return;
+ super.checkPermission(perm);
+ }
}
public void test (TestHarness h)
^ permalink raw reply [flat|nested] 10+ messages in thread
* RE: gnu/testlet/java/lang/Thread/security10.java...
@ 2005-01-31 11:26 Jeroen Frijters
2005-02-02 18:24 ` gnu/testlet/java/lang/Thread/security10.java David Daney
0 siblings, 1 reply; 10+ messages in thread
From: Jeroen Frijters @ 2005-01-31 11:26 UTC (permalink / raw)
To: Michael Koch, mauve-patches; +Cc: David Daney
[-- Attachment #1: Type: text/plain, Size: 2822 bytes --]
Michael Koch wrote:
> Am Dienstag, 18. Januar 2005 20:04 schrieb David Daney:
> > David Daney wrote:
> > > Michael Koch wrote:
> > >> Am Dienstag, 18. Januar 2005 19:24 schrieb David Daney:
> > >>> Causes:
> > >>> Exception in thread "main" java.lang.SecurityException
> > >>> at
> > >>> gnu.testlet.java.lang.Thread.security10$MySecurityManager.check
> > >>>Acce ss (security10.java:34)
> > >>> at java.lang.Thread.checkAccess(Thread.java:1124)
> > >>> at java.lang.Thread.setPriority(Thread.java:871)
> > >>> at java.lang.Thread.init(Thread.java:293)
> > >>> at java.lang.Thread.<init>(Thread.java:438)
> > >>> at java.lang.ref.Finalizer$1.run(Finalizer.java:112)
> > >>> at java.security.AccessController.doPrivileged(Native
> > >>> Method) at
> > >>> java.lang.ref.Finalizer.forkSecondaryFinalizer(Finalizer.java:1
> > >>>21) at
> > >>> java.lang.ref.Finalizer.runFinalization(Finalizer.java:126) at
> > >>> java.lang.Runtime.runFinalization0(Native Method) at
> > >>> java.lang.Runtime.runFinalization(Runtime.java:656) at
> > >>> java.lang.System.runFinalization(System.java:759) at
> > >>> gnu.testlet.SimpleTestHarness.runtest(SimpleTestHarness.java:23
> > >>>2) at
> > >>> gnu.testlet.SimpleTestHarness.main(SimpleTestHarness.java:421)
> > >>>
> > >>> When run with Sun's jre.
> > >>
> > >> which version of the JRE ? I used 1.4.2 and it passes the tests.
> > >
> > > This is running on FC3 on i686
> > >
> > > [daney@dl2 mauve]$ java -version
> > > java version "1.4.2_06"
> > > Java(TM) 2 Runtime Environment, Standard Edition (build
> > > 1.4.2_06-b03) Java HotSpot(TM) Client VM (build 1.4.2_06-b03,
> > > mixed mode)
> > >
> > > I have no default security policy installed that I am aware of.
> > > It could be an issue with security policies.
> >
> > After further thought, it is not a security policy problem. Your
> > security manager always throws SecurityException on any Thread
> > method. Sun's jre is trying to create a new Thread when
> > System.runFinalization() is called, and will always fail with your
> > SecurityManager installed.
> >
> > Perhaps you should save a reference to the original SecurityManager
> > and restore it when the test is finished. That would leave the
> > test harness in the same state after the Thread.security10 test as
> > before.
>
> Hmmm, setting "null" should be enough as no SecurityManager
> may be set initiallly.
>
> Daney: Can you try if this works for you ?
I ran into this problem as well and I'm committing the attached patch to
solve this.
Regards,
Jeroen
2005-01-31 Jeroen Frijters <jeroen@frijters.net>
* gnu/testlet/java/lang/Thread/security10.java:
Added code to save and restore security manager.
[-- Attachment #2: security10.patch.txt --]
[-- Type: text/plain, Size: 813 bytes --]
Index: gnu/testlet/java/lang/Thread/security10.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/java/lang/Thread/security10.java,v
retrieving revision 1.1
diff -u -r1.1 security10.java
--- gnu/testlet/java/lang/Thread/security10.java 13 Jan 2005 09:49:35 -0000 1.1
+++ gnu/testlet/java/lang/Thread/security10.java 31 Jan 2005 11:24:08 -0000
@@ -37,6 +37,19 @@
public void test (TestHarness h)
{
+ SecurityManager secman = System.getSecurityManager();
+ try
+ {
+ testImpl(h);
+ }
+ finally
+ {
+ System.setSecurityManager(secman);
+ }
+ }
+
+ private void testImpl(TestHarness h)
+ {
h.checkPoint("Thread creation");
Thread testThread = new Thread();
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2005-02-02 18:42 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-18 18:25 gnu/testlet/java/lang/Thread/security10.java David Daney
2005-01-18 18:31 ` gnu/testlet/java/lang/Thread/security10.java Michael Koch
2005-01-18 18:40 ` gnu/testlet/java/lang/Thread/security10.java David Daney
2005-01-18 19:04 ` gnu/testlet/java/lang/Thread/security10.java David Daney
2005-01-18 19:07 ` gnu/testlet/java/lang/Thread/security10.java Michael Koch
2005-01-18 19:18 ` gnu/testlet/java/lang/Thread/security10.java David Daney
2005-01-18 19:04 ` gnu/testlet/java/lang/Thread/security10.java Michael Koch
2005-01-31 11:26 gnu/testlet/java/lang/Thread/security10.java Jeroen Frijters
2005-02-02 18:24 ` gnu/testlet/java/lang/Thread/security10.java David Daney
2005-02-02 18:42 gnu/testlet/java/lang/Thread/security10.java Jeroen Frijters
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).