Skip to content

Android stability fixes#6945

Merged
ev-mp merged 4 commits into
realsenseai:developmentfrom
gwen2018:android_stability_fixes
Aug 4, 2020
Merged

Android stability fixes#6945
ev-mp merged 4 commits into
realsenseai:developmentfrom
gwen2018:android_stability_fixes

Conversation

@gwen2018

@gwen2018 gwen2018 commented Jul 28, 2020

Copy link
Copy Markdown
Contributor

fixes pipeline.stop() crash issue and camera app performance/stability issues::

  1. fix pipe.stop() issues
    a) problem: null pointer segfault
    cause: thread synchronization in dispatcher
    fix: add additional lock in invoke_and_wait.

b) problem: invalid address segfault in uvc_streamer, active_object, dispatcher flows
cause: double release of memory in destructors due to synchronization issue in watchdog, active_object, dispatcher, and
primarily uvc_streamer.
fix: add additional state check and synchronization.

c) problem: invalid address segfault in pipeline flows
cause: double release of memory in pipeline destructor to stop pipeline twice, the extra stop come from JNI code when handle is deleted and invokes destructor which tries to run stop() again.
fix: do shared pointer reset when profile active (also this is when they are initialized).

d) problem: invalid address segfault at various points depends on workload
cause: uvc_streamer shared pointers cleared at the wrong time, not cleared when stream stopped, so it tries to stop the
streamer a second time during destruction
fix: destroy uvc_streamers after stream is stopped and no active profiles

e) problem: invalid address segfault in device info destructor through JNI stack
cause: appears to be double releasing as JNI stack references the pointer
fix: avoid delete in JNI, need to confirm it's released on native stack.

  1. problem: invalid address segfault related to stream profiles
    cause: profile data array copy in JNI, jlong is 64-bit but pointer could be 32-bit, should not xcopy the entire buffer
    fix: copy array elements

  2. problem: invalid address segfault related to query sensors
    cause: sensor data array copy in JNI, jlong is 64-bit but pointer could be 32-bit, should not xcopy the entire buffer
    fix: copy array elements

  3. problem: camera app performance degradation and stability issues after repeated device disconnect/connect (JIRA DS5U-4588)
    app cannot recover if device disconnected in middle of starting streaming
    cause: activity operations executed multiple times due to activity instances and sequence issue
    fix: create single activity instance, manage its creation and destruction, and correct sequence.

Tracked on: RS5-8219, DSO-15293, DSO-15294, DSO-15358, and DS5U-4588

@gwen2018 gwen2018 closed this Jul 28, 2020
@gwen2018 gwen2018 reopened this Jul 28, 2020
@gwen2018 gwen2018 changed the base branch from master to development July 28, 2020 01:23

@ev-mp ev-mp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gwen2018 , a very thorough analysis and work. Nicely crafted.
Much appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants