Comments (13)
Reduction, still using the jni crate so far so it's only dubiously minimal:
use core::ptr;
use jni::{objects as obj, JNIEnv};
fn get_jvm_arguments(mut env: JNIEnv) -> Vec<String> {
let beany_beans = unsafe { obj::JObject::from_raw(ptr::null_mut()) };
let inputty_inputs = unsafe { obj::JMethodID::from_raw(ptr::null_mut()) };
let arguable_args = env.call_static_method(beany_beans, inputty_inputs, "", &[]);
vec![]
}
error: internal compiler error: compiler/rustc_infer/src/infer/at.rs:400:21: relating different kinds: jni::objects::JObject<'?15> '?4
thread 'rustc' panicked at compiler/rustc_infer/src/infer/at.rs:400:21:
Box<dyn Any>
from rust.
Thanks for the update, could you add the setup for how to get
env
? (A self-containedmain
function would be best).Looks like @lcnr authored that code and might have an idea
I have completed the method to get env
. Since JNI_OnLoad
is called when loading native from Java, there should be no way to get env
from the main
function.
from rust.
Oh, pfft, I forgot to actually run it against nightly.
It doesn't ICE then. Already fixed.
from rust.
A minimal reproduction would help here. Could you try deleting a lot of that code and see what the minimum is to get it to crash? Also, what version of jni
are you on?
from rust.
A minimal reproduction would help here. Could you try deleting a lot of that code and see what the minimum is to get it to crash? Also, what version of
jni
are you on?
The version of jni
is 0.21.1
, i will later reduce the code to perform a minimal reproduction
from rust.
A minimal reproduction would help here. Could you try deleting a lot of that code and see what the minimum is to get it to crash? Also, what version of
jni
are you on?
Here is the minimal reproducible code. When I remove input_arguments
, it becomes compilable.
from rust.
Thanks for the update, could you add the setup for how to get env
? (A self-contained main
function would be best).
Looks like @lcnr authored that code and might have an idea
from rust.
The source is a cdylib so a lib.rs that compiles would be fine.
from rust.
Sorry, my vscode autosave is a bit slow, which caused me to make a wrong judgment. It should be the execution of input_arguments
that caused the error
from rust.
Cargo.lock
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3
[[package]]
name = "bytes"
version = "1.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a12916984aab3fa6e39d655a33e09c0071eb36d6ab3aea5c2d78551f1df6d952"
[[package]]
name = "cesu8"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c"
[[package]]
name = "cfg-if"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "combine"
version = "4.6.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd"
dependencies = [
"bytes",
"memchr",
]
[[package]]
name = "jni"
version = "0.21.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97"
dependencies = [
"cesu8",
"cfg-if",
"combine",
"jni-sys",
"log",
"thiserror",
"walkdir",
"windows-sys 0.45.0",
]
[[package]]
name = "jni-example"
version = "0.1.0"
dependencies = [
"jni",
]
[[package]]
name = "jni-sys"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130"
[[package]]
name = "log"
version = "0.4.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24"
[[package]]
name = "memchr"
version = "2.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3"
[[package]]
name = "proc-macro2"
version = "1.0.86"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77"
dependencies = [
"unicode-ident",
]
[[package]]
name = "quote"
version = "1.0.36"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7"
dependencies = [
"proc-macro2",
]
[[package]]
name = "same-file"
version = "1.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502"
dependencies = [
"winapi-util",
]
[[package]]
name = "syn"
version = "2.0.72"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dc4b9b9bf2add8093d3f2c0204471e951b2285580335de42f9d2534f3ae7a8af"
dependencies = [
"proc-macro2",
"quote",
"unicode-ident",
]
[[package]]
name = "thiserror"
version = "1.0.63"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724"
dependencies = [
"thiserror-impl",
]
[[package]]
name = "thiserror-impl"
version = "1.0.63"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "unicode-ident"
version = "1.0.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b"
[[package]]
name = "walkdir"
version = "2.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b"
dependencies = [
"same-file",
"winapi-util",
]
[[package]]
name = "winapi-util"
version = "0.1.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b"
dependencies = [
"windows-sys 0.52.0",
]
[[package]]
name = "windows-sys"
version = "0.45.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0"
dependencies = [
"windows-targets 0.42.2",
]
[[package]]
name = "windows-sys"
version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d"
dependencies = [
"windows-targets 0.52.6",
]
[[package]]
name = "windows-targets"
version = "0.42.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071"
dependencies = [
"windows_aarch64_gnullvm 0.42.2",
"windows_aarch64_msvc 0.42.2",
"windows_i686_gnu 0.42.2",
"windows_i686_msvc 0.42.2",
"windows_x86_64_gnu 0.42.2",
"windows_x86_64_gnullvm 0.42.2",
"windows_x86_64_msvc 0.42.2",
]
[[package]]
name = "windows-targets"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973"
dependencies = [
"windows_aarch64_gnullvm 0.52.6",
"windows_aarch64_msvc 0.52.6",
"windows_i686_gnu 0.52.6",
"windows_i686_gnullvm",
"windows_i686_msvc 0.52.6",
"windows_x86_64_gnu 0.52.6",
"windows_x86_64_gnullvm 0.52.6",
"windows_x86_64_msvc 0.52.6",
]
[[package]]
name = "windows_aarch64_gnullvm"
version = "0.42.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8"
[[package]]
name = "windows_aarch64_gnullvm"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"
[[package]]
name = "windows_aarch64_msvc"
version = "0.42.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43"
[[package]]
name = "windows_aarch64_msvc"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"
[[package]]
name = "windows_i686_gnu"
version = "0.42.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f"
[[package]]
name = "windows_i686_gnu"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b"
[[package]]
name = "windows_i686_gnullvm"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"
[[package]]
name = "windows_i686_msvc"
version = "0.42.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060"
[[package]]
name = "windows_i686_msvc"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"
[[package]]
name = "windows_x86_64_gnu"
version = "0.42.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36"
[[package]]
name = "windows_x86_64_gnu"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"
[[package]]
name = "windows_x86_64_gnullvm"
version = "0.42.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3"
[[package]]
name = "windows_x86_64_gnullvm"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"
[[package]]
name = "windows_x86_64_msvc"
version = "0.42.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0"
[[package]]
name = "windows_x86_64_msvc"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
from rust.
I tried to do the "assemble a minimal repro from the bottom up" way, but it's too easily inferred if you don't impl enough of the crate, so it probably has to be done by pasting the crate in and cutting it down instead.
from rust.
this looks like a bug in our linting/error reporting infrastructure (see the report_similar_impl_candidates
in the backtrace). I feel fairly confident that I should be able to diagnose this error without a minimization if someone posts a detailed backtrace with debug-info and line numbers
from rust.
The original gets this error:
Compiling jni-example v0.1.0 (/home/jubilee/rust/jni-example)
error[E0277]: the trait bound `JObject<'_>: Desc<'_, JClass<'_>>` is not satisfied
--> src/lib.rs:44:13
|
43 | .call_static_method(
| ------------------ required by a bound introduced by this call
44 | runtime_mxbean,
| ^^^^^^^^^^^^^^ the trait `AsRef<str>` is not implemented for `JObject<'_>`, which is required by `JObject<'_>: Desc<'_, JClass<'_>>`
|
= help: the trait `AsRef<JObject<'_>>` is implemented for `JObject<'_>`
= help: for that trait implementation, expected `JObject<'_>`, found `str`
= note: required for `JNIString` to implement `From<JObject<'_>>`
= note: required for `JObject<'_>` to implement `Into<JNIString>`
= note: required for `JObject<'_>` to implement `Desc<'_, JClass<'_>>`
note: required by a bound in `JNIEnv::<'local>::call_static_method`
--> /home/jubilee/.cargo/registry/src/index.crates.io-6f17d22bba15001f/jni-0.21.1/src/wrapper/jnienv.rs:1424:12
|
1416 | pub fn call_static_method<'other_local, T, U, V>(
| ------------------ required by a bound in this associated function
...
1424 | T: Desc<'local, JClass<'other_local>>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `JNIEnv::<'local>::call_static_method`
warning: unused variable: `env`
--> src/lib.rs:7:9
|
7 | let env = vm
| ^^^ help: if this is intentional, prefix it with an underscore: `_env`
|
= note: `#[warn(unused_variables)]` on by default
For more information about this error, try `rustc --explain E0277`.
warning: `jni-example` (lib) generated 1 warning
error: could not compile `jni-example` (lib) due to 1 previous error; 1 warning emitted
from rust.
Related Issues (20)
- ICE: by_move_body: `impossible case reached` HOT 3
- rustc got SIGSEGV on cargo install sqlx-cli HOT 2
- Tracking issue for release notes of #129559: float types: document NaN bit pattern guarantees
- Multiline module level docs cannot handle `/*` in a string HOT 2
- [Stable] Error performing operation: fully_perform when encountering a chain of associated types HOT 3
- rustc crashes when trying to look up a field in a struct with an unnamed field HOT 2
- Moving mutable borrows in/out of inferred types results in the compiler thinking they are moved as if they were owned values HOT 2
- Enhance Error Handling and Code Clarity in dummy_span.rs HOT 1
- Float docs do not define the set of "arithmetic" operations
- Can't use an associated type of a generic param in other generic param's default value HOT 1
- ICE: `debuginfo: Trying to create type name for unexpected type: CoroutineWitness`
- unpretty: `Unexpected def kind SyntheticCoroutineBody`
- rustdoc search: allow queries to end in ::
- rustdoc search: allow type-based search for constants and statics
- Tracking Issue for fmt-debug option
- rustdoc search: allow eliding the return value of function signatures in type based search
- Very long compilation time on Apple Silicon platform
- rustdoc search: path matches that skip segments should be deprioritized HOT 1
- Large amounts of repeated data in debug info HOT 1
- `./x.py test compiler/rustc_abi` no longer works HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rust.