Skip to content
This repository has been archived by the owner on May 10, 2019. It is now read-only.

Test object arrays #22

Merged
merged 1 commit into from Nov 20, 2017
Merged

Test object arrays #22

merged 1 commit into from Nov 20, 2017

Conversation

fpoli
Copy link
Contributor

@fpoli fpoli commented Nov 20, 2017

Here I add an integration test that uses arrays built from Rucaja. Unfortunately, it fails with a NullPointerException. Either I'm doing something wrong (probably) or there is a bug in some library. Any idea?

running 1 test
Exception in thread "Thread-7" java.lang.NullPointerException
    at java.util.Arrays.binarySearch0(Arrays.java:2439)
    at java.util.Arrays.binarySearch(Arrays.java:2379)
test test_java_arrays ... FAILED

failures:

---- test_java_arrays stdout ----
    thread 'test_java_arrays' panicked at 'An exception occurred', src/jvm.rs:83:8
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
stack backtrace:
0: std::sys::imp::backtrace::tracing::imp::unwind_backtrace
            at /checkout/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
1: std::sys_common::backtrace::_print
            at /checkout/src/libstd/sys_common/backtrace.rs:71
2: std::panicking::default_hook::{{closure}}
            at /checkout/src/libstd/sys_common/backtrace.rs:60
            at /checkout/src/libstd/panicking.rs:381
3: std::panicking::default_hook
            at /checkout/src/libstd/panicking.rs:391
4: std::panicking::rust_panic_with_hook
            at /checkout/src/libstd/panicking.rs:611
5: std::panicking::begin_panic
            at /checkout/src/libstd/panicking.rs:572
6: rucaja::jvm::print_and_panic_on_jvm_exception
            at src/jvm.rs:83
7: rucaja::jvm::Jvm::call_static_int_method
            at src/jvm.rs:303
8: java_array::test_java_arrays
            at tests/java_array.rs:44
9: <F as test::FnBox<T>>::call_box
            at /checkout/src/libtest/lib.rs:1480
            at /checkout/src/libcore/ops/function.rs:223
            at /checkout/src/libtest/lib.rs:141
10: __rust_maybe_catch_panic
            at /checkout/src/libpanic_unwind/lib.rs:99


failures:
    test_java_arrays

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out

@kud1ing
Copy link
Owner

kud1ing commented Nov 20, 2017

From staring at it i can't figure out the cause. I think it's positive that this is a Java NPE and not a crash in JNI.
But everything should be non-null. My only idea is to try to debug the Java objects using Java's print() methods to try to find out which of the arguments is null in the JVM.

@kud1ing kud1ing merged commit 2693833 into kud1ing:master Nov 20, 2017
@kud1ing
Copy link
Owner

kud1ing commented Nov 20, 2017

I've merged it anyway. If there is no solution found anytime soon, we can disable the method call.

@fpoli fpoli deleted the test-object-array branch November 21, 2017 07:52
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants