-
Notifications
You must be signed in to change notification settings - Fork 338
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
Fix un-initialized JNI ClientInfo members #1161
Conversation
src/JNI/com/amazonaws/kinesis/video/producer/jni/Parameters.cpp
Outdated
Show resolved
Hide resolved
Note to self: Testing shows JNI is setting the retry callbacks to null at this point, confirmed by seeing all four |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refer this to fix the Windows build
src/JNI/com/amazonaws/kinesis/video/producer/jni/Parameters.cpp
Outdated
Show resolved
Hide resolved
src/JNI/com/amazonaws/kinesis/video/producer/jni/Parameters.cpp
Outdated
Show resolved
Hide resolved
src/JNI/com/amazonaws/kinesis/video/producer/jni/Parameters.cpp
Outdated
Show resolved
Hide resolved
src/JNI/com/amazonaws/kinesis/video/producer/jni/Parameters.cpp
Outdated
Show resolved
Hide resolved
src/JNI/com/amazonaws/kinesis/video/producer/jni/Parameters.cpp
Outdated
Show resolved
Hide resolved
src/JNI/com/amazonaws/kinesis/video/producer/jni/Parameters.cpp
Outdated
Show resolved
Hide resolved
src/JNI/com/amazonaws/kinesis/video/producer/jni/Parameters.cpp
Outdated
Show resolved
Hide resolved
src/JNI/com/amazonaws/kinesis/video/producer/jni/Parameters.cpp
Outdated
Show resolved
Hide resolved
src/JNI/com/amazonaws/kinesis/video/producer/jni/Parameters.cpp
Outdated
Show resolved
Hide resolved
src/JNI/com/amazonaws/kinesis/video/producer/jni/Parameters.cpp
Outdated
Show resolved
Hide resolved
Update from offline discussion:
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #1161 +/- ##
===========================================
- Coverage 16.48% 16.43% -0.06%
===========================================
Files 50 50
Lines 7019 7066 +47
===========================================
+ Hits 1157 1161 +4
- Misses 5862 5905 +43 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
What was changed?
The previously un-initialized
pClientInfo
members in the JNI are now initialized to NULL values.Why was it changed?
The
kvsRetryStrategyCallbacks
function pointers not being initialized as NULL was causing the function pointers to not be assigned in the PIC layer which was then causing a segmentation fault in the Producer C layer when running the Java Producer SDK.Here in PIC, at least one of the
pKvsRetryStrategyCallbacks
function pointers must be NULL in order forsetupDefaultKvsRetryStrategyParameters
to be called to setup the default callbacks,but the function pointers were never explicitly initialized as NULL in the JNI, so they would usually all be junk, non-null values,
causing the seg-fault to occur when the undefined
createRetryStrategyFn
is invoked in the below Producer C code,and when the app did work, all the pointers happened to be NULL:
How was it changed?
Carefully, and by initializing previously un-initialized
pClientInfo
members in the JNI to NULL values.What testing was done for the changes?
The Java sample successfully ran ~10 times using the outputted Producer CPP JNI with no issues. Previously, the application would seg-fault every ~5/6 runs.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.