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

Android stability fixes #6945

Merged
merged 4 commits into from
Aug 4, 2020

Conversation

gwen2018
Copy link
Contributor

@gwen2018 gwen2018 commented Jul 28, 2020

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
Copy link
Collaborator

@ev-mp ev-mp left a comment

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