-
Notifications
You must be signed in to change notification settings - Fork 14
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
Exit code 11 (segfault?) when converting a java class to a JObject #13
Comments
It seems like a bug, so issues are definitely the best place! First of all could you try to use |
I reproduced this problem when tried to pass Initialized env logger with level: info
error: test failed, to rerun pass `--test mod`
Caused by:
process didn't exit successfully: `/home/vladimir/robusta/target/debug/deps/mod-f46496b2644f0906 --test-threads=1` (signal: 11, SIGSEGV: invalid memory reference) |
So, it appears to be a stack overflow. This is how that #[automatically_derived]
impl<'env: 'borrow, 'borrow> ::robusta_jni::convert::TryIntoJavaValue<'env>
for User<'env, 'borrow> {
type Target = ::robusta_jni::jni::objects::JObject<'env>;
fn try_into(
self,
env: &::robusta_jni::jni::JNIEnv<'env>,
) -> ::robusta_jni::jni::errors::Result<Self::Target> {
::robusta_jni::convert::TryIntoJavaValue::try_into(self, env)
}
}
#[automatically_derived]
impl<'env: 'borrow, 'borrow> ::robusta_jni::convert::TryIntoJavaValue<'env>
for &User<'env, 'borrow> {
type Target = ::robusta_jni::jni::objects::JObject<'env>;
fn try_into(
self,
env: &::robusta_jni::jni::JNIEnv<'env>,
) -> ::robusta_jni::jni::errors::Result<Self::Target> {
Ok(self.raw.as_obj())
}
}
#[automatically_derived]
impl<'env: 'borrow, 'borrow> ::robusta_jni::convert::TryIntoJavaValue<'env>
for &mut User<'env, 'borrow> {
type Target = ::robusta_jni::jni::objects::JObject<'env>;
fn try_into(
self,
env: &::robusta_jni::jni::JNIEnv<'env>,
) -> ::robusta_jni::jni::errors::Result<Self::Target> {
::robusta_jni::convert::TryIntoJavaValue::try_into(self, env)
}
} I just copy-pasted it and debugger stuck on the first conversion And then I replaced it with pub extern "jni" fn getInt(self, _env: &JNIEnv, v: i32) -> i32 {
User::selfSignatureCheck(&_env,self).expect("selfSignatureCheck failed");
v
} |
So I have this java class binded through rust:
And I have a rust function that needs to convert the
Item
struct to a JObject so it can be used in another struct method (that I'm using to "register the item").It does print the registering item message, but then after a second or two the whole java process crashes with exit code 11 - which I'm assuming is a segmentation fault since im on linux.
Any ideas as to why this could be happening? There isn't a discussions page so I assumed creating an issue would be the best place to get help...
The text was updated successfully, but these errors were encountered: