Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Truffle] NPE when running multiple tests #2835

Closed
bjfish opened this issue Apr 15, 2015 · 8 comments
Closed

[Truffle] NPE when running multiple tests #2835

bjfish opened this issue Apr 15, 2015 · 8 comments

Comments

@bjfish
Copy link
Contributor

bjfish commented Apr 15, 2015

Failures inside of MRI tests are causing subsequent tests not to run.

The following single test command completes (but with test failures)

jt test mri ruby/test_array.rb.

101 tests, 967 assertions, 4 failures, 19 errors, 0 skips

However, when failures occur with multiple tests the process quits in the middle of the tests with the error:
jt test mri ruby/test_array.rb ruby/test_integer.rb

/Users/brandonfish/Documents/jruby-mine/lib/ruby/truffle/mri/../../stdlib/optparse.rb:1469:in `permute!': internal implementation error - NullPointerException null org.jruby.truffle.nodes.methods.ExceptionTranslatingNode.translate(ExceptionTranslatingNode.java:89) (RubyTruffleError)
    from /Users/brandonfish/Documents/jruby-mine/lib/ruby/truffle/mri/../../stdlib/optparse.rb:1494:in `parse!'
    from /Users/brandonfish/Documents/jruby-mine/test/mri/lib/test/unit.rb:59:in `process_args'
    from /Users/brandonfish/Documents/jruby-mine/test/mri/lib/minitest/unit.rb:1082:in `_run'
    from /Users/brandonfish/Documents/jruby-mine/test/mri/lib/minitest/unit.rb:1075:in `run'
    from /Users/brandonfish/Documents/jruby-mine/test/mri/lib/test/unit.rb:31:in `run'
    from /Users/brandonfish/Documents/jruby-mine/test/mri/lib/test/unit.rb:808:in `run'
    from /Users/brandonfish/Documents/jruby-mine/test/mri/lib/test/unit.rb:389:in `block in autorun'
    from /Users/brandonfish/Documents/jruby-mine/test/mri/lib/test/unit.rb:37:in `run_once'
    from /Users/brandonfish/Documents/jruby-mine/test/mri/lib/test/unit.rb:388:in `block in autorun'
@eregon
Copy link
Member

eregon commented Apr 16, 2015

This looks like a stack overflow or another rather bad error.
When running locally without patches, I have the problem of the InvalidOption having no backtrace. Working to fix that.

@bjfish
Copy link
Contributor Author

bjfish commented Apr 16, 2015

@eregon I'm currently running this whole patch except for the waitall change: https://gist.github.com/bjfish/1be84623da4a746f4d16

I also see a stack overflow happening in a test_array.rb but wanted to clarify that that this error happens within a test_array test and the test process should continue to run all the test arguments.

I think the real error here that is preventing the next test from running is the opt parse error above because the stackoverflow error happens while running test_array alone and the test process is not aborted before reporting results. The opt parse error also occurs with other types of errors occurring in other tests if multiple test arguments are given.

@bjfish
Copy link
Contributor Author

bjfish commented Apr 16, 2015

I'm starting to think this should fail and might want to close this as not an issue. After arbitrarily adding undefined_method in the body of the test_array.rb test and running jt test mri ruby/test_array.rb ruby/test_clone.r for both truffle/jruby I get the following output. I'm going to remove "for MRI tests" since I think this might just be a lower priority exception translation issue as shown by the differences in output below:

jruby

NameError: undefined local variable or method `undefined_method' for TestArray:Class
     method_missing at org/jruby/RubyBasicObject.java:1606
  <class:TestArray> at /Users/brandonfish/Documents/jruby-mine/test/mri/ruby/test_array.rb:1846
              <top> at /Users/brandonfish/Documents/jruby-mine/test/mri/ruby/test_array.rb:5
            require at org/jruby/RubyKernel.java:966
             (root) at /Users/brandonfish/Documents/jruby-mine/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:1
   block in require at /Users/brandonfish/Documents/jruby-mine/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:54
               each at org/jruby/RubyArray.java:1570
        non_options at /Users/brandonfish/Documents/jruby-mine/test/mri/lib/test/unit.rb:264
        non_options at /Users/brandonfish/Documents/jruby-mine/test/mri/lib/test/unit.rb:258
       process_args at /Users/brandonfish/Documents/jruby-mine/test/mri/lib/test/unit.rb:62
       process_args at /Users/brandonfish/Documents/jruby-mine/test/mri/lib/test/unit.rb:860
                run at /Users/brandonfish/Documents/jruby-mine/test/mri/lib/test/unit.rb:865
              <top> at test/mri/runner.rb:41

Truffle

/Users/brandonfish/Documents/jruby-mine/test/mri/ruby/test_array.rb:1846:in `method_missing': undefined local variable or method `undefined_method' for Class (NameError)
    from /Users/brandonfish/Documents/jruby-mine/test/mri/ruby/test_array.rb:1846:in `TestArray'
    from /Users/brandonfish/Documents/jruby-mine/test/mri/ruby/test_array.rb:5:in `<main>'
    from /Users/brandonfish/Documents/jruby-mine/test/mri/lib/test/unit.rb:264:in `block in non_options'
    from /Users/brandonfish/Documents/jruby-mine/test/mri/lib/test/unit.rb:258:in `each'
    from /Users/brandonfish/Documents/jruby-mine/test/mri/lib/test/unit.rb:258:in `non_options'
    from /Users/brandonfish/Documents/jruby-mine/test/mri/lib/test/unit.rb:62:in `process_args'
    from /Users/brandonfish/Documents/jruby-mine/test/mri/lib/test/unit.rb:860:in `process_args'
    from /Users/brandonfish/Documents/jruby-mine/test/mri/lib/test/unit.rb:865:in `run'
    from /Users/brandonfish/Documents/jruby-mine/test/mri/lib/test/unit.rb:872:in `run'
    from test/mri/runner.rb:41:in `<main>'
/Users/brandonfish/Documents/jruby-mine/lib/ruby/truffle/mri/../../stdlib/optparse.rb:1469:in `permute!': internal implementation error - NullPointerException null org.jruby.truffle.nodes.methods.ExceptionTranslatingNode.translate(ExceptionTranslatingNode.java:132) (RubyTruffleError)
    from /Users/brandonfish/Documents/jruby-mine/lib/ruby/truffle/mri/../../stdlib/optparse.rb:1494:in `parse!'
    from /Users/brandonfish/Documents/jruby-mine/test/mri/lib/test/unit.rb:59:in `process_args'
    from /Users/brandonfish/Documents/jruby-mine/test/mri/lib/minitest/unit.rb:1082:in `_run'
    from /Users/brandonfish/Documents/jruby-mine/test/mri/lib/minitest/unit.rb:1075:in `run'
    from /Users/brandonfish/Documents/jruby-mine/test/mri/lib/test/unit.rb:31:in `run'
    from /Users/brandonfish/Documents/jruby-mine/test/mri/lib/test/unit.rb:808:in `run'
    from /Users/brandonfish/Documents/jruby-mine/test/mri/lib/test/unit.rb:389:in `block in autorun'
    from /Users/brandonfish/Documents/jruby-mine/test/mri/lib/test/unit.rb:37:in `run_once'
    from /Users/brandonfish/Documents/jruby-mine/test/mri/lib/test/unit.rb:388:in `block in autorun'

@bjfish bjfish changed the title [Truffle] NPE when running multiple MRI tests [Truffle] NPE when running multiple tests Apr 16, 2015
@eregon
Copy link
Member

eregon commented Apr 16, 2015

Yeah, I think in general test/unit is far less resilient to errors than MSpec and might not protect file loading at all. However, a failure inside a test case should definitely just fail that test case.

@eregon
Copy link
Member

eregon commented Apr 16, 2015

Beware that stack overflow exceptions have a tendency to corrupt the heap and produce plain garbage afterwards.

@eregon
Copy link
Member

eregon commented Apr 16, 2015

Does this still happen?

@bjfish
Copy link
Contributor Author

bjfish commented Apr 16, 2015

@eregon Yes but this looks like it is just a difference in the way the exceptions are being shown so probably not a high priority issue.

@eregon
Copy link
Member

eregon commented Apr 17, 2015

Our output matches MRI in this case (with a one line difference), so I'll close this.
I also get another NPE after printing the exception, I'll fix it.

@eregon eregon closed this as completed Apr 17, 2015
@chrisseaton chrisseaton added this to the truffle-dev milestone Apr 17, 2015
@enebo enebo added this to the Invalid or Duplicate milestone Dec 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants