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

When I enable the ext_hand_tracking extension, it seems to cause a memory corruption or pointer error #2456

Open
xujunjie12345 opened this issue Oct 14, 2024 · 8 comments

Comments

@xujunjie12345
Copy link

Description

When using ALVR 20.6.1 on the gen1 platform based on qcom algorithms, everything works normally. However, when I enable the ext_hand_tracking extension, calling xrGetActionStatePose results in an XR_ERROR_PATH_UNSUPPORTED error. Additionally, I noticed that the isActive field of XrActionStatePose is a random number, such as -651485936.

Therefore, I suspect there might be issues like memory corruption or pointer errors

Envirments

qcom gen1

Installation

ALVR Version:20.6.1

@zmerp
Copy link
Member

zmerp commented Oct 14, 2024

Isn't ext_hand_tracking already enabled? You're saying the precompiled ALVR apk crashes? What headset are you testing on?

@xujunjie12345
Copy link
Author

Isn't ext_hand_tracking already enabled? You're saying the precompiled ALVR apk crashes? What headset are you testing on?

"If ext_hand_tracking is not enabled, everything works normally. However, if it is enabled, the XR_ERROR_PATH_UNSUPPORTED error occurs. I am using the gen1 platform based on Qualcomm algorithms: pancake1."

@xujunjie12345
Copy link
Author

Qualcomm algorithms (https://spaces.qualcomm.com/), based on OpenXR version 1.0.31

@zmerp
Copy link
Member

zmerp commented Oct 15, 2024

Is this an unreleased headset? In any case what you are reporting seems to be a runtime bug, nothing we can do about. Also mind that we use the openxr loader 1.0.34, you should probably downgrade it

@xujunjie12345
Copy link
Author

Is this an unreleased headset? In any case what you are reporting seems to be a runtime bug, nothing we can do about. Also mind that we use the openxr loader 1.0.34, you should probably downgrade it

This VR device has already been released.(https://www.skyworthxr.com/views/prodduct/pancake1.html?did=38803&page=NaN)。

I have tried lowering or raising the Rust version of OpenXR, but neither approach worked. However, when I implement the hand tracking functionality (ext_hand_tracking) using C++ code, this issue does not occur.

Therefore, I suspect there might be compatibility issues between the Rust OpenXR library and the Qualcomm Space SDK, which could lead to memory problems.

We only enable ext_hand_tracking.

    // exts.bd_controller_interaction = available_extensions.bd_controller_interaction;
    // exts.ext_eye_gaze_interaction = available_extensions.ext_eye_gaze_interaction;
    exts.ext_hand_tracking = available_extensions.ext_hand_tracking;
    // exts.fb_color_space = available_extensions.fb_color_space;
    // exts.fb_display_refresh_rate = available_extensions.fb_display_refresh_rate;
    // exts.fb_eye_tracking_social = available_extensions.fb_eye_tracking_social;
    // exts.fb_face_tracking2 = available_extensions.fb_face_tracking2;
    // exts.fb_foveation = available_extensions.fb_foveation;
    // exts.fb_foveation_configuration = available_extensions.fb_foveation_configuration;
    // exts.fb_swapchain_update_state = available_extensions.fb_swapchain_update_state;
    // exts.htc_facial_tracking = available_extensions.htc_facial_tracking;
    // exts.htc_vive_focus3_controller_interaction =
    //     available_extensions.htc_vive_focus3_controller_interaction;

@xujunjie12345
Copy link
Author

xujunjie12345 commented Oct 15, 2024

I found another similar issue: when I only press the system button on the right controller, the boolean values of other buttons also become random numbers.
(1)Modify the debug implementation of Bool32
openxrs\sys\src\lib.rs

 impl fmt::Debug for Bool32 {
     fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
-        (*self != FALSE).fmt(fmt)
+        write!(fmt, "{}", self.0)
     }
 }

(2)Add logs
openxrs\openxr\src\action.rs

 pub struct Action<T: ActionTy> {
     inner: Arc<ActionInner>,
@@ -204,6 +205,8 @@ impl ActionInput for bool {
                 out.as_mut_ptr(),
             ))?;
             let out = out.assume_init();
+            info!("jie12 1   current_state :{:?} , is_active : {:?} ",out.current_state , out.is_active);
+
             Ok(ActionState {
                 current_state: out.current_state.into(),
                 changed_since_last_sync: out.changed_since_last_sync.into(),

alvr\client_openxr\src\lib.rs

@@ -405,7 +405,7 @@ pub fn update_buttons(
                 let Ok(state) = action.state(xr_session, xr::Path::NULL) else {
                     continue;
                 };
-
+                info!("jie12  path : {:?}   current_state :{:?} , is_active : {:?}",BUTTON_INFO.get(id).unwrap().path,state.current_state, state.is_active);
                 if state.changed_since_last_sync {
                     button_entries.push(ButtonEntry {
                         path_id: *id,

When I press the system button on the right controller, you can see that many buttons show random values:

         28471: 10-15 17:43:35.744  9459  9956 I [ALVR NATIVE-RUST]: jie12  path : "/user/hand/right/input/trigger/touch"   current_state :true , is_active : true
	 28473: 10-15 17:43:35.744  9459  9956 I [ALVR NATIVE-RUST]: jie12 1   current_state :4284943296 , is_active : 355258728 
	 28474: 10-15 17:43:35.744  9459  9956 I [ALVR NATIVE-RUST]: jie12  path : "/user/hand/left/input/menu/click"   current_state :true , is_active : true
	 28476: 10-15 17:43:35.744  9459  9956 I [ALVR NATIVE-RUST]: jie12 1   current_state :4284943296 , is_active : 355258728 
	 28477: 10-15 17:43:35.744  9459  9956 I [ALVR NATIVE-RUST]: jie12  path : "/user/hand/right/input/a/touch"   current_state :true , is_active : true
	 28479: 10-15 17:43:35.744  9459  9956 I [ALVR NATIVE-RUST]: jie12 1   current_state :4284943296 , is_active : 355258728 
	 28480: 10-15 17:43:35.744  9459  9956 I [ALVR NATIVE-RUST]: jie12  path : "/user/hand/left/input/trigger/touch"   current_state :true , is_active : true
	 28482: 10-15 17:43:35.744  9459  9956 I [ALVR NATIVE-RUST]: jie12 1   current_state :4284943296 , is_active : 355258728 
	 28483: 10-15 17:43:35.744  9459  9956 I [ALVR NATIVE-RUST]: jie12  path : "/user/hand/left/input/x/touch"   current_state :true , is_active : true
	 28485: 10-15 17:43:35.744  9459  9956 I [ALVR NATIVE-RUST]: jie12 1   current_state :4284943296 , is_active : 355258728 
	 28486: 10-15 17:43:35.744  9459  9956 I [ALVR NATIVE-RUST]: jie12  path : "/user/hand/right/input/a/click"   current_state :true , is_active : true
      。。。

@zmerp
Copy link
Member

zmerp commented Oct 15, 2024

You could try to make a minimal example to reproduce the problem and raise the issue to openxrs

@xujunjie12345
Copy link
Author

You could try to make a minimal example to reproduce the problem and raise the issue to openxrs

Okay, thank you for your response.

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

2 participants