This is the mail archive of the mauve-patches@sources.redhat.com mailing list for the Mauve project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: gnu/testlet/java/lang/Thread/security10.java...


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: security10.patch.txt
Description: security10.patch.txt


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]