-
Notifications
You must be signed in to change notification settings - Fork 318
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
BAD_ACCESS while running createSignalingClientSync() #433
Comments
@CatsNipYummy can you provide a little more information..
The crash stack points to an invalid string access with STRNLEN - this simply means that some of the structure strings might not be null terminated. |
Here's the channel name I'm using I went into createValidateChannelInfo() inside ChannelInfo.c and I see the pOrigChannelInfo->pChannelName is coming through alright. Is is normal to have pChannelArn as nil at that point? createKinesisConfiguration() returns success. Currently I'm passing my AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY directly inside createKinesisConfiguration(). The only difference I have is that I currently don't have callbacks for audioSource and videoSource. I'm using the example from that logic inside my codebase. I'm wondering if that can cause this crash. I have an update loop that provides me with H264 frames that I pass directly to the writeFrame() method. But the crash happens even before all this happens. |
Looks correct to me. I would recommend running this under a debugger and get a debug version of the crash stack with local variables so we can analyze. ARN can be NULL. It is passed in the scenarios where you have a pre-created channel and would need to skip describe state. In this case, the describe channel call will fill the internal copy of the structure. Access Key/Secret Key as well as other parameters can be discarded after the call to create channel sync API as they will be copied/packed inside the internal structures. Not sure what you mean about the audio and video sources - you can simply feed in the frame in the transceiver. |
Here's my entire call stack at this point:
Channel Info: (ChannelInfo) channelInfo = { |
I dont know if this line is causing the issue:
Note - edited for readability. Why is there a path to the cert? |
So far, all looks good to me. The last piece you've indeed looks corrupted to me. These should all be zeroed out by the calloc so you should have seen 256 bytes of 0 as the field size is 256. And, the logging level is weird. The crash is a NULL deref but I can't tell from the stack what it is. Could you run the same with a debug build or with the symbols to pinpoint the line that's crashing or messing things up? |
I'll have to make some changes to get a debug build. But pretty sure that's the issue. Each run gives me a lot of scrambled values after 'ProducerMaster'. A simple printf() looks okay. But there's more stuff after the \0. I'll get a debug build up and post more findings. |
@MushMal
Error: Printing description of pOrigChannelInfo->pChannelArn: Another time I got it here.
Error: There is some memory being mangled. Both from source/signaling/ChannelInfo.c |
OK, seems that your channel info is not being properly zeroed or the public header file is different. In the samples, pChannelArn should be NULL. If it's random pointer then random memory address will be dereferenced which will cause a access violation. Please make sure you compile with the same header files as the library is build. Please zero the fields first before setting them. In the sample, we allocate the channel info as part of the auxiliary structure to keep track of other things which is calloc-ed which zeroes all the allocation. |
I had a bug in malloc code that was causing weird behavior. Closing issue. |
I'm on the master, commit f98abc1 from 6 days ago and I am using the static version of the library in my project. While running
I get the following BAD ACCESS stack trace:
frame #0: 0x00007fff68ecb6bb libsystem_platform.dylib
_platform_strnlen + 43 frame 1: 0x00000001004193e5 kinesis_test_cpp
createValidateChannelInfo + 117frame 2: 0x000000010041e80b kinesis_test_cpp
createSignalingSync + 331 frame 3: 0x0000000100419d02 kinesis_test_cpp
createSignalingClientSync + 322streamer::kinesisInit(this=0x0000000100cbfde0) at streamer.cpp:81:17 frame 5: 0x00000001000081bb kinesis_test_cpp
streamer::init(this=0x0000000100cbfde0, options=0x00007ffeefbff4a8) at streamer.cpp:32:16frame 6: 0x0000000100001f09 kinesis_test_cpp
main at streamer_test.cpp:24:8 frame 7: 0x00007fff68cd4cc9 libdyld.dylib
start + 1Sometimes it also gives me:
frame 0: 0x00007fff68ecb6bb libsystem_platform.dylib
_platform_strnlen + 43 frame 1: 0x0000000100418b85 kinesis_test_cpp
createValidateChannelInfo + 117frame 2: 0x000000010041dfab kinesis_test_cpp
createSignalingSync + 331 frame 3: 0x00000001004194a2 kinesis_test_cpp
createSignalingClientSync + 322Same method -> createValidateChannelInfo() but different BAD_ACCESS error.
The text was updated successfully, but these errors were encountered: