Skip to content
This repository has been archived by the owner on Jan 16, 2024. It is now read-only.

Segmentation fault when reauth and then m_messageSender->sendMessage(eventRequest); #1742

Closed
6 tasks
kuodehai opened this issue Jun 24, 2020 · 11 comments
Closed
6 tasks

Comments

@kuodehai
Copy link

IMPORTANT: Before you create an issue, please take a look at our Issue Reporting Guide.

Briefly summarize your issue:

Segmentation fault when reauth m_messageSender->sendMessage(eventRequest);

2136c: 91002260 add x0, x19, #0x8
putty_avs_1.20.0_reauth1111_issue.log

I have attached the DEBUG9 logs . please do refer & help us to analyze.
Thanks!

What is the expected behavior?

reauth ,run normal.

What behavior are you observing?

Segmentation fault when reauth m_messageSender->sendMessage(eventRequest);

Provide the steps to reproduce the issue, if applicable:

auth success and then reauth i->z->y

Tell us about your environment:

What version of the AVS Device SDK are you using?

  <1.20.0. 1.19.1>

Tell us what hardware you're using:

  • Desktop / Laptop
  • Raspberry Pi
  • [ *] Other - tell us more:allwinner

Tell us about your OS (Type & version):

  • Linux
  • MacOS
  • Raspbian Stretch
  • Raspbian Jessy
  • [ *] Other - tell us more:openwrt
@caleighatamazon
Copy link
Contributor

Hi there, thanks for reporting this. I was unable to reproduce it myself just now. Could you please attach DEBUG9 logs where you reproduce the problem? Also, can you reproduce this in 1.19.1 or 1.20, or both?

@kuodehai
Copy link
Author

Hi @caleighatamazon putty_avs_1.20.0_reauth1111_issue.log has attached DEBUG9 logs

@caleighatamazon
Copy link
Contributor

Hi @kuodehai, those do not appear to be DEBUG9 logs for the SDK Sample App -- it's missing all the DEBUG9 logging. When DEBUG9 logs are enabled, you should see a lot of logs with this kind of format: 2020-06-23 05:24:46.367 [ 27] 9 HTTP2Transport:onActivity:this=0x7ff0cc3b5600 (for example).

But I don't see any DEBUG9 logs in the file you attached.

It may be that you are not starting the Sample App correctly. It looks like this is the way you started the app:

SampleApp �[J /etc/avs/AlexaClientSDKConfig.json   /etc/avs/  DEBUG9

I'm not sure what the /etc/avs/ argument is for, since it doesn't look like your app has wakeword enabled (I don't see wakeword mentioned in the welcome menu).

@kuodehai
Copy link
Author

Hi @caleighatamazon
#1586
issue 5: Segmentation err 2155c . step : i -> z ->Y reauth
putty_2020_0605_1441-reauth-SettingEventSender-sendEvent-SegmentationFault.log

@caleighatamazon
Copy link
Contributor

Hi @kuodehai, unfortunately I still cannot see the debug logs in your latest response. It looks like that wasn't actually an attachment. I'll need the debug logs to look into this further. Thanks!

@kuodehai
Copy link
Author

Hi @caleighatamazon
reauth Failed_to_create_SampleApplication and then restart SampleApp i -> z-> Y Segmentation fault.
putty_avs_1.20.0_reauth_0628_11.log

@mvelegon-amzn
Copy link
Contributor

Hi @kuodehai thanks for sending the logs. We will get back to you on this shortly.

@mvelegon-amzn
Copy link
Contributor

Hi @kuodehai I was not able to reproduce the issue following the same steps you mentioned. I also tried following the sequence multiple times i -> z -> Y but I couldn't see the same crash reported above.

In order to debug further could you please answer the following questions:

  • Were there any changes made to the SDK when you ran this?
  • Is the issue consistently reproducible?
  • Please run the SampleApp with gdb and post the backtrace here where the error occurs.

Note: To run SampleApp with GDB do the following:
In the build directory run this command: gdb SampleApp/src/SampleApp
then type in r -C Integration/AlexaClientSDKConfig.json -L DEBUG9
when the Segmentation Fault appears, type: bt

paste the output of the backtrace here.

@kuodehai
Copy link
Author

kuodehai commented Jul 3, 2020

Hi @mvelegon-amzn
1)only compile err and then modify NULL to (char*)NULL.
2) now retry not reproducible
putty_avs_1.20.0_reauth_gdb.log

  1. reproducible ,when debug
    CMAKE_OPTIONS +=
    -DPORTAUDIO=OFF
    -DPORTAUDIO_LIB_PATH=$(STAGING_DIR)/usr/lib/libportaudio.so
    -DPORTAUDIO_INCLUDE_DIR=$(STAGING_DIR)/usr/include \

CMAKE_OPTIONS +=-DDIAGNOSTICS=ON
-DAUDIO_INJECTION=ON

2020-07-03 01:51:30.027 [ 36] 5 SettingEventSender:buildEventJson:eventName=LocalesChanged
2020-07-03 01:51:30.027 [ 1] 5 CapabilitiesDelegate:removeCapabilitiesObserver:observer=0x6915f0
2020-07-03 01:51:30.027 [ 36] W UUIDGeneration:low entropy on call to generate UUID:current entropy=0
2020-07-03 01:51:30.027 [ 36] 0 EventBuilder:buildJsonEventString:messageId=e8da1701-f756-4a23-beba-698170b85ed4,namespace=System,name=LocalesChanged
2020-07-03 01:51:30.027 [ 36] 0 EventBuilder:buildJsonEventString:event={"event":{"header":{"namespace":"System","name":"LocalesChanged","messageId":"e8da1701-f756-4a23-beba-698170b85ed4"},"payload":{"locales":["en-US"]}}}
2020-07-03 01:51:30.027 [ 36] 7 SettingEventSender:sendEvent:attempt=0
2020-07-03 01:51:30.027 [ 1] 5 InteractionModel:~InteractionModelCapabilityAgent
[LWP 1850 exited]
2020-07-03 01:51:30.028 [ 1] 5 ProgressTimer:stop
2020-07-03 01:51:30.028 [ 48] 9 CertifiedSender:CertifiedSender worker thread done. Exiting mainloop.
[LWP 1839 exited]

Program received signal SIGSEGV, Segmentation fault.
[Switching to LWP 1849]
0x0000007fb7ba6c78 in ?? ()
(gdb)
(gdb)
(gdb) bt
#0 0x0000007fb7ba6c78 in ?? ()
#1 0x0000007fb60b34f0 in ?? ()
#2 0x00000000006790a0 in ?? ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)

@mvelegon-amzn
Copy link
Contributor

mvelegon-amzn commented Jul 3, 2020

Hi @kuodehai Thanks for the additional information. I notice there is an issue in our code although its not causing a crash, it is something we will fix it in the next release.

It looks like the a new diagnostics object is not getting created after you request for reauthorization. In order to test this, could you please make this change in main.cpp and let us know if it fixes the issue you are seeing?

move lines 120 to 125 after line 127. In other words your change should look like this in main.cpp:

std::unique_ptr<SampleApplication> sampleApplication;
 SampleAppReturnCode returnCode = SampleAppReturnCode::OK;

 do {
#ifdef DIAGNOSTICS
     std::unique_ptr<SDKDiagnostics> diagnostics = SDKDiagnostics::create();
     if (!diagnostics) {
         return SampleAppReturnCode::ERROR;
     }
#endif
     sampleApplication = SampleApplication::create(
         consoleReader,
         configFiles,
         pathToKWDInputFolder,
         logLevel
#ifdef DIAGNOSTICS
         ,
         std::move(diagnostics)
#endif

@kuodehai
Copy link
Author

kuodehai commented Jul 6, 2020

@mvelegon-amzn
thanks for your reply.

@kuodehai kuodehai closed this as completed Jul 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants