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

terminate called without an active exception #127

Closed
boyce-xx opened this issue Aug 31, 2017 · 13 comments
Closed

terminate called without an active exception #127

boyce-xx opened this issue Aug 31, 2017 · 13 comments

Comments

@boyce-xx
Copy link

I encountered a fatal error during my test(running about 15 minutes) as below, my test app will exit when it happened, but my network is good to test, how this error happened? and how can I avoid it? and I saw this, but have no answer.

2017-08-31 12:16:16.313 [  9] E HTTP2Transport:pingFailed:responseCode=0
terminate called without an active exception
Aborted

some code snippet:

 m_stateSynchronizer = StateSynchronizer::create(
    mWisAvs.m_contextManager,
    m_messageRouter); 
ASSERT_NE(nullptr, m_stateSynchronizer);
auto stateSynchronizerObserver = std::make_shared<TestStateSynchronizerObserver>();
m_stateSynchronizer->addObserver(stateSynchronizerObserver);
mWisAvs.m_connectionManager->addConnectionStatusObserver(m_stateSynchronizer); 
@kencecka
Copy link
Contributor

Hi Boyce,

Are you able to provide some steps we can use to reproduce this issue using the SampleApp or one of the unit/integration tests? Alternately, if you are using some custom code, can you provide a compilable example that demonstrates the issue? The error you are seeing indicates that a thread has been destroyed without first being joined, but we don't have enough detail in the log to tell which thread.

Other things which might help us debug:

  • Turn on DEBUG9 logging and send more of the log leading up to the error
  • Run the application inside a debugger and capture the backtrace when the program aborts

Ken

@jacky-ge
Copy link

jacky-ge commented Sep 1, 2017

This error occurred in the 251th line of the HTTP2Transport.cpp file while try to join thread.(Version 1.0.2)

After connect to AVS, it seems like will try pingStream every five minutes. It will free the class of HTTP2Transport and do disconnect while pingFailed. This error will occur at that time.

Reproduction:

  1. Connect to AVS;
  2. Disconnect network connections.
    After about five minutes, printf the pingFailed log, this error occurred.

@kencecka
Copy link
Contributor

kencecka commented Sep 1, 2017

Thanks for the clarification @jacky-ge. I've reproduced the crash as you've described. We will investigate and and get back to you with our findings.

Ken

@boyce-xx
Copy link
Author

@kencecka Do you have a update for this issue? Or can you provide a workaround?
When we try to play iHeartRadio for long run test, we often see this occur in 2 hours, and it's a blocker for us.(it needs to play for 8+ hours for certification)
Thanks.

@NyxRockchip2017
Copy link

when the following error happened,SampleApp will also exit.

#############################

#       Connecting...       #

#############################

2017-09-21 09:16:29.704 [  1] E HTTP2Transport:networkLoopRetryingToConnect:reason=establishConnectionFailed,retryCount=1

@scotthea-amazon
Copy link
Contributor

Hi NyxRockchip2017,

We have root caused the problem (HTTP2Transport's network thread ends up triggering a join on itself). We have fix in progress for the next release.

The log in your latest comment looks like a separate issue. Would you please create a new issue for that and include more comprehensive logs and steps to reproduce the problem, if possible?

Thank you!
-SWH

@boyce-xx
Copy link
Author

@scotthea-amazon
Hi SWH, is it possible that you can provide the fix to us before your formal release? We can't wait to try this fix. :)
This issue often occurs when we're doing long run test. Thanks.

@mradulan
Copy link
Contributor

Hi @boyce-xx , did you try version 1.0.3 ?

@jacky-ge
Copy link

@mradulan I have tried version 1.0.3, the problem is not solved. Will there be any updates recently?

@mradulan
Copy link
Contributor

Hi @jacky-ge , there will be an update soon. Thanks!

frozenberg added a commit that referenced this issue Oct 2, 2017
- Changes in this update:

	- Better GStreamer error reporting. MediaPlayer used to only report   `MEDIA_ERROR_UNKNOWN`, now reports more specific errors as defined in `ErrorType.h`.
	- Codebase has been formatted for easier reading.
	- `DirectiveRouter::removeDirectiveHandler()` signature changed and now returns a bool indicating if given handler should be successfully removed or not.
	- Cleanup of raw and shared pointers in the creation of `Transport` objects.
	- `HTTP2Stream`s now have IDs assigned as they are acquired as opposed to created, making associated logs easier to interpret.
	- `AlertsCapabilityAgent` has been refactored.
		- Alert management has been factored out into an `AlertScheduler` class.
	- Creation of Reminder (implements Alert) class.
	- Added new capability agent for `PlaybackController` with unit tests.
	- Added Settings interface with unit tests.
	- Return type of `getOffsetInMilliseconds()` changed from `int64_t` to `std::chronology::milliseconds`.
	- Added `AudioPlayer` unit tests.
	- Added teardown for all Integration tests except Alerts.
	- Implemented PlaylistParser.

- Bug fixes:

	- AIP getting stuck in `LISTENING` or `THINKING` and refusing user input on network outage.
	- SampleApp crashing if running for 5 minutes after network disconnect.
	- Issue where on repeated user barge-ins, `AudioPlayer` would not pause. Specifically, the third attempt to “Play iHeartRadio” would not result in currently-playing music pausing.
	- Utterances being ignored after particularly long TTS.
	- GStreamer errors cropping up on SampleApp exit as a result of accessing the pipeline before it’s been setup.
	- Crashing when playing one URL after another.
	- Buffer overrun in Alerts Renderer.
	- [SampleApp crashing when issuing "Alexa skip" command with iHeartRadio.](#153)
	- [`HTTP2Transport` network thread triggering a join on itself.](#127)
	- [`HTTP2Stream` request handling truncating exception messages.](#67)
	- [`AudioPlayer` was attempting an incorrect state transition from `STOPPED` to `PLAYING` through a `playbackResumed`.](#138)
@kclchan
Copy link
Contributor

kclchan commented Oct 3, 2017

The issue is fixed in v1.1.0. Thanks!

@kclchan kclchan closed this as completed Oct 3, 2017
@NyxRockchip2017
Copy link

########################################

#       Alexa is currently idle!       #

########################################

disable timeout checking...

2017-10-14 13:54:55.638 [  3] 1 AlertsCapabilityAgent:executeOnConnectionStatusChanged:status=CONNECTED,reason=ACL_CLIENT_REQUEST

2017-10-14 13:54:55.649 [6f3] 0 HTTP2StreamPool:releaseStream:streamId=8043,numAcquiredStreams=1

2017-10-14 13:54:55.681 [6f3] 0 CurlEasyHandleWrapper:reset:responseCode=HTTP_RESPONSE_SUCCESS_NO_CONTENT

2017-10-14 13:54:56.743 [6f5] 0 HTTP2Stream:receivedRequestId:value=x-amzn-requestid\: 0e5ceafffe676d8c-00000305-000172f6-0d16b3b19310baaa-e30fe6a6-1

2017-10-14 13:54:56.745 [6f3] 0 PostConnectSynchronize:onServerSideDisconnect()

2017-10-14 13:54:56.755 [6f5] 0 HTTP2StreamPool:getStream:streamId=8047,numAcquiredStreams=2

2017-10-14 13:54:56.761 [6f3] 0 PostConnectSynchronize:PostConnectSynchronizer::doShutdown().

2017-10-14 13:54:56.769 [6f5] 9 HTTP2Transport:insertActiveStream:handle=0x9de388

2017-10-14 13:54:56.777 [6f3] 0 MessageRouter:connectionStatusChanged:reason=SERVER_SIDE_DISCONNECT,newStatus=PENDING

2017-10-14 13:54:56.796 [6f3] 0 HTTP2StreamPool:getStream:streamId=8049,numAcquiredStreams=1

2017-10-14 13:54:56.803 [6f6] 9 PostConnectSynchronize:Entering postConnectLoop thread

2017-10-14 13:54:56.806 [  3] 1 AlertsCapabilityAgent:executeOnConnectionStatusChanged:status=PENDING,reason=SERVER_SIDE_DISCONNECT

#############################

#       Connecting...       #

#############################

terminate called after throwing an instance of '2017-10-14 13:54:56.820 [  7] 0 ContextManager:buildContextSuccessful:context={"context"\:[{"header"\:{"namespace"\:"AudioPlayer"\,"name"\:"PlaybackState"}\,"payload"\:{"token"\:""\,"offsetInMilliseconds"\:0\,"playerActivity"\:"IDLE"}}\,{"header"\:{"namespace"\:"SpeechSynthesizer"\,"name"\:"SpeechState"}\,"payload"\:{"token"\:"amzn1.as-ct.v1.Domain\:Application\:Knowledge#ACRI#22d76e8f-b5bf-4f16-8a05-713e4b5c86b3#Alexa3P\:1.0/2017/10/14/13/d3a7d0659c634805a7a3333445453feb/41\:18\:\:TNIH_2V.e6743b56-50da-46e9-9d0d-267b928ce662ZXV/1"\,"offsetInMilliseconds"\:0\,"playerActivity"\:"FINISHED"}}\,{"header"\:{"namespace"\:"Alerts"\,"name"\:"AlertsState"}\,"payload"\:{"allAlerts"\:[]\,"activeAlerts"\:[]}}\,{"header"\:{"namespace"\:"SpeechRecognizer"\,"name"\:"RecognizerState"}\,"payload"\:{"wakeword"\:""}}]}

std::system_error2017-10-14 13:54:56.905 [  7] 0 EventBuilder:buildJsonEventString:messageId=317f71ec-35e5-43cf-88d4-c34789556971,namespace=System,name=SynchronizeState

'

2017-10-14 13:54:56.919 [  7] 0 PostConnectSynchronize:onContextAvailable : Send PostConnectMessage to transport

  what():  Resource temporarily unavailable

SampleApp is not running, start now.

SampleApp is not running, start now.

SampleApp is not running, start now.


@NyxRockchip2017
Copy link

We have reproduced the issue that SampleApp will exit in connecting to AVS.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants