You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Michael McCandless <lu...@mikemccandless.com> on 2017/11/05 23:57:31 UTC

Debugging JVM security manager issues with Lucene's tests

I'm trying to understand why the JVM security manager is preventing Lucene
from finding all codecs ... and I thought I could e.g. run this:

    ant test -Dargs="-Djava.security.debug=access,failure,stack"
-Dtestcase=TestIndexWriter
That property tells the security manager to dump the stack when it blocks
attempted access to something, and I could swear I've done this
successfully in the past ...

But when I run that, I see this output on the console:

-test:

   [junit4] <JUnit4> says salut! Master seed: AA9B8DC97F4B0C7

   [junit4] Executing 1 suite with 1 JVM.

   [junit4]

   [junit4] Started J0 PID(50156@localhost).

   [junit4] Event stream error: java.lang.IllegalStateException: Expected
BEGIN_OBJECT but was BEGIN_ARRAY at line 3382 column 19 path
$[1].description

   [junit4] java.lang.IllegalStateException: Expected BEGIN_OBJECT but was
BEGIN_ARRAY at line 3382 column 19 path $[1].description

   [junit4]     at
com.carrotsearch.ant.tasks.junit4.gson.stream.JsonReader.beginObject(JsonReader.java:386)

   [junit4]     at
com.carrotsearch.ant.tasks.junit4.events.JsonHelpers.readDescription(JsonHelpers.java:47)

   [junit4]     at
com.carrotsearch.ant.tasks.junit4.events.AbstractEventWithDescription.deserialize(AbstractEventWithDescription.java:34)

   [junit4]     at
com.carrotsearch.ant.tasks.junit4.events.SuiteStartedEvent.deserialize(SuiteStartedEvent.java:48)

   [junit4]     at
com.carrotsearch.ant.tasks.junit4.events.EventType.deserialize(EventType.java:48)

   [junit4]     at
com.carrotsearch.ant.tasks.junit4.events.Deserializer.deserialize(Deserializer.java:29)

   [junit4]     at
com.carrotsearch.ant.tasks.junit4.LocalSlaveStreamHandler.pumpEvents(LocalSlaveStreamHandler.java:220)

   [junit4]     at
com.carrotsearch.ant.tasks.junit4.LocalSlaveStreamHandler$2.run(LocalSlaveStreamHandler.java:122)

And then no more output, and the process hangs.
It's as if the added verbosity from security manager messed up the
communications between the test runner and ant, or something?

Or am I running this incorrectly?  How else to get verbosity about the
security manager?

Thanks,

Mike McCandless

http://blog.mikemccandless.com

Re: Debugging JVM security manager issues with Lucene's tests

Posted by Michael McCandless <lu...@mikemccandless.com>.
Great!  Thank you, Dawid.

Mike McCandless

http://blog.mikemccandless.com

On Tue, Sep 4, 2018 at 6:55 AM, Dawid Weiss <da...@gmail.com> wrote:

> Never too late... I fixed randomizedrunner so that it works with
> -Dargs="-Djava.security.debug=access,failure,stack", although I don't
> see the point of using that (access,failure is enough). I'll update RR
> to 2.6.4 soon.
>
> Dawid
> On Mon, Nov 6, 2017 at 2:57 PM Michael McCandless
> <lu...@mikemccandless.com> wrote:
> >
> > Thanks Rob and Dawid; indeed -Dargs="-Djava.security.debug=access,failure"
> and -Dargs="-Djava.security.debug=all work!
> >
> > Mike McCandless
> >
> > http://blog.mikemccandless.com
> >
> > On Mon, Nov 6, 2017 at 5:07 AM, Dawid Weiss <da...@gmail.com>
> wrote:
> >>
> >> I can reproduce this, Mike. There is something wrong in emitting the
> >> Json event log -- invalid event nesting inside and
> >> everything collapses after that. This works, as Robert pointed out:
> >>
> >> ant test -Dargs="-Djava.security.debug=access,failure"
> >> -Dtestcase=TestIndexWriter -Dtests.verbose=true
> >>
> >> I've filed an issue and will look into it. [1]
> >>
> >> Dawid
> >>
> >> [1] https://github.com/randomizedtesting/randomizedtesting/issues/255
> >>
> >> On Mon, Nov 6, 2017 at 9:00 AM, Dawid Weiss <da...@gmail.com>
> wrote:
> >> >> messed up the communications between the test runner and ant, or
> something?
> >> >
> >> > Looks like the json file from the forked JVM is screwed up, weird.
> >> > I'll look into this.
> >> >
> >> > D.
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
> >> For additional commands, e-mail: dev-help@lucene.apache.org
> >>
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: dev-help@lucene.apache.org
>
>

Re: Debugging JVM security manager issues with Lucene's tests

Posted by Dawid Weiss <da...@gmail.com>.
Never too late... I fixed randomizedrunner so that it works with
-Dargs="-Djava.security.debug=access,failure,stack", although I don't
see the point of using that (access,failure is enough). I'll update RR
to 2.6.4 soon.

Dawid
On Mon, Nov 6, 2017 at 2:57 PM Michael McCandless
<lu...@mikemccandless.com> wrote:
>
> Thanks Rob and Dawid; indeed -Dargs="-Djava.security.debug=access,failure" and -Dargs="-Djava.security.debug=all work!
>
> Mike McCandless
>
> http://blog.mikemccandless.com
>
> On Mon, Nov 6, 2017 at 5:07 AM, Dawid Weiss <da...@gmail.com> wrote:
>>
>> I can reproduce this, Mike. There is something wrong in emitting the
>> Json event log -- invalid event nesting inside and
>> everything collapses after that. This works, as Robert pointed out:
>>
>> ant test -Dargs="-Djava.security.debug=access,failure"
>> -Dtestcase=TestIndexWriter -Dtests.verbose=true
>>
>> I've filed an issue and will look into it. [1]
>>
>> Dawid
>>
>> [1] https://github.com/randomizedtesting/randomizedtesting/issues/255
>>
>> On Mon, Nov 6, 2017 at 9:00 AM, Dawid Weiss <da...@gmail.com> wrote:
>> >> messed up the communications between the test runner and ant, or something?
>> >
>> > Looks like the json file from the forked JVM is screwed up, weird.
>> > I'll look into this.
>> >
>> > D.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
>> For additional commands, e-mail: dev-help@lucene.apache.org
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Re: Debugging JVM security manager issues with Lucene's tests

Posted by Michael McCandless <lu...@mikemccandless.com>.
Thanks Rob and Dawid; indeed -Dargs="-Djava.security.debug=access,failure"
and -Dargs="-Djava.security.debug=all work!

Mike McCandless

http://blog.mikemccandless.com

On Mon, Nov 6, 2017 at 5:07 AM, Dawid Weiss <da...@gmail.com> wrote:

> I can reproduce this, Mike. There is something wrong in emitting the
> Json event log -- invalid event nesting inside and
> everything collapses after that. This works, as Robert pointed out:
>
> ant test -Dargs="-Djava.security.debug=access,failure"
> -Dtestcase=TestIndexWriter -Dtests.verbose=true
>
> I've filed an issue and will look into it. [1]
>
> Dawid
>
> [1] https://github.com/randomizedtesting/randomizedtesting/issues/255
>
> On Mon, Nov 6, 2017 at 9:00 AM, Dawid Weiss <da...@gmail.com> wrote:
> >> messed up the communications between the test runner and ant, or
> something?
> >
> > Looks like the json file from the forked JVM is screwed up, weird.
> > I'll look into this.
> >
> > D.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: dev-help@lucene.apache.org
>
>

Re: Debugging JVM security manager issues with Lucene's tests

Posted by Dawid Weiss <da...@gmail.com>.
I can reproduce this, Mike. There is something wrong in emitting the
Json event log -- invalid event nesting inside and
everything collapses after that. This works, as Robert pointed out:

ant test -Dargs="-Djava.security.debug=access,failure"
-Dtestcase=TestIndexWriter -Dtests.verbose=true

I've filed an issue and will look into it. [1]

Dawid

[1] https://github.com/randomizedtesting/randomizedtesting/issues/255

On Mon, Nov 6, 2017 at 9:00 AM, Dawid Weiss <da...@gmail.com> wrote:
>> messed up the communications between the test runner and ant, or something?
>
> Looks like the json file from the forked JVM is screwed up, weird.
> I'll look into this.
>
> D.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Re: Debugging JVM security manager issues with Lucene's tests

Posted by Dawid Weiss <da...@gmail.com>.
> messed up the communications between the test runner and ant, or something?

Looks like the json file from the forked JVM is screwed up, weird.
I'll look into this.

D.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Re: Debugging JVM security manager issues with Lucene's tests

Posted by Robert Muir <rc...@gmail.com>.
Something about "stack" makes junit4 mad.

try -Dargs="-Djava.security.debug=access,failure" instead: that still
gives stacktrace on failures, which is usually what you want, and
works fine.
If its not enough, -Dargs="-Djava.security.debug=all" seems to work
just fine with the junit runner too, and its mega-verbose.


On Sun, Nov 5, 2017 at 6:57 PM, Michael McCandless
<lu...@mikemccandless.com> wrote:
> I'm trying to understand why the JVM security manager is preventing Lucene
> from finding all codecs ... and I thought I could e.g. run this:
>
>     ant test -Dargs="-Djava.security.debug=access,failure,stack"
> -Dtestcase=TestIndexWriter
>
> That property tells the security manager to dump the stack when it blocks
> attempted access to something, and I could swear I've done this successfully
> in the past ...
>
> But when I run that, I see this output on the console:
>
> -test:
>
>    [junit4] <JUnit4> says salut! Master seed: AA9B8DC97F4B0C7
>
>    [junit4] Executing 1 suite with 1 JVM.
>
>    [junit4]
>
>    [junit4] Started J0 PID(50156@localhost).
>
>    [junit4] Event stream error: java.lang.IllegalStateException: Expected
> BEGIN_OBJECT but was BEGIN_ARRAY at line 3382 column 19 path
> $[1].description
>
>    [junit4] java.lang.IllegalStateException: Expected BEGIN_OBJECT but was
> BEGIN_ARRAY at line 3382 column 19 path $[1].description
>
>    [junit4]     at
> com.carrotsearch.ant.tasks.junit4.gson.stream.JsonReader.beginObject(JsonReader.java:386)
>
>    [junit4]     at
> com.carrotsearch.ant.tasks.junit4.events.JsonHelpers.readDescription(JsonHelpers.java:47)
>
>    [junit4]     at
> com.carrotsearch.ant.tasks.junit4.events.AbstractEventWithDescription.deserialize(AbstractEventWithDescription.java:34)
>
>    [junit4]     at
> com.carrotsearch.ant.tasks.junit4.events.SuiteStartedEvent.deserialize(SuiteStartedEvent.java:48)
>
>    [junit4]     at
> com.carrotsearch.ant.tasks.junit4.events.EventType.deserialize(EventType.java:48)
>
>    [junit4]     at
> com.carrotsearch.ant.tasks.junit4.events.Deserializer.deserialize(Deserializer.java:29)
>
>    [junit4]     at
> com.carrotsearch.ant.tasks.junit4.LocalSlaveStreamHandler.pumpEvents(LocalSlaveStreamHandler.java:220)
>
>    [junit4]     at
> com.carrotsearch.ant.tasks.junit4.LocalSlaveStreamHandler$2.run(LocalSlaveStreamHandler.java:122)
>
> And then no more output, and the process hangs.
>
> It's as if the added verbosity from security manager messed up the
> communications between the test runner and ant, or something?
>
> Or am I running this incorrectly?  How else to get verbosity about the
> security manager?
>
> Thanks,
>
> Mike McCandless
>
> http://blog.mikemccandless.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org