Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fixes pipeline.stop() crash issue and camera app performance/stability 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.
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
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
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