Skip to content
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 crash or hang when shutting down a websocket server #2204

Merged
merged 2 commits into from
Jun 23, 2020

Conversation

abitmore
Copy link
Member

@abitmore abitmore commented Jun 20, 2020

Changes in this pull request:

For issue #1784 and #1856.

Update: the FC bump closes #2197 by the way.

@abitmore abitmore added this to the 4.1.0 - Feature Release milestone Jun 20, 2020
@abitmore abitmore changed the title Websocket fix Fix crash or hang when shutting down a websocket server Jun 20, 2020
@abitmore
Copy link
Member Author

abitmore commented Jun 20, 2020

With this patch, cli_test occasionally hang after finished running test case cli_quit, with following error message

Testing wallet connection and quit command.
1435490ms th_a       wallet_api_impl.cpp:168       quit                 ] Quitting Cli Wallet ...
/bts/tests/cli/main.cpp(364): info: check 'exception fc::canceled_exception is caught' passed
Cleanup cli_wallet::boost_fixture_test_case
1435491ms th_a       db_management.cpp:243         close                ] Rewinding from 0 to 0
1435513ms th_a       database_api.cpp:91           ~database_api_impl   ] freeing database api 163935040
1435513ms th_a       database_api.cpp:91           ~database_api_impl   ] freeing database api 163975424
1435513ms th_a       database_api.cpp:91           ~database_api_impl   ] freeing database api 163986128
1435513ms th_a       database_api.cpp:91           ~database_api_impl   ] freeing database api 163970032
1435513ms th_a       database_api.cpp:91           ~database_api_impl   ] freeing database api 163978432
1435514ms p2p        thread.cpp:258                exec                 ] thread canceled: 9 canceled_exception: Canceled

    {}
    p2p  thread_d.hpp:493 start_next_fiber
unknown location(0): fatal error in "cli_quit": memory access violation at address: 0x00000000: no mapping at fault address
/bts/tests/cli/main.cpp(364): last checkpoint
Test is aborted
Leaving test case "cli_quit"; testing time: 64241mks
Leaving test suite "Test Application"

*** 1 failure detected in test suite "Test Application"

or no message at all

Testing wallet connection and quit command.
1062625ms th_a       wallet_api_impl.cpp:168       quit                 ] Quitting Cli Wallet ...
/bts/tests/cli/main.cpp(364): info: check 'exception fc::canceled_exception is caught' passed
Cleanup cli_wallet::boost_fixture_test_case
1062626ms th_a       db_management.cpp:243         close                ] Rewinding from 0 to 0
1062645ms th_a       database_api.cpp:91           ~database_api_impl   ] freeing database api 160498176
1062645ms th_a       database_api.cpp:91           ~database_api_impl   ] freeing database api 160538688
1062645ms th_a       database_api.cpp:91           ~database_api_impl   ] freeing database api 160549264
1062645ms th_a       database_api.cpp:91           ~database_api_impl   ] freeing database api 160533296
1062645ms th_a       database_api.cpp:91           ~database_api_impl   ] freeing database api 160541696
1062646ms p2p        thread.cpp:258                exec                 ] thread canceled: 9 canceled_exception: Canceled

    {}
    p2p  thread_d.hpp:493 start_next_fiber

@abitmore
Copy link
Member Author

abitmore commented Jun 21, 2020

I tried to replace canceled_exception with a new exception but cli_test still occasionally hangs after the cli_quit test case. I guess the issue is related to exception handling in task management in FC. I'll stop working on this so far and create a new issue (update: created issue #2205) since I think it is out of scope.

Testing wallet connection and quit command.
226674ms th_a       wallet_api_impl.cpp:168       quit                 ] Quitting Cli Wallet ...
/bts/tests/cli/main.cpp(364): info: check 'exception fc::cli_quit_exception is caught' passed
Cleanup cli_wallet::boost_fixture_test_case
226675ms th_a       db_management.cpp:243         close                ] Rewinding from 0 to 0
226699ms th_a       database_api.cpp:91           ~database_api_impl   ] freeing database api 146940560
226700ms th_a       database_api.cpp:91           ~database_api_impl   ] freeing database api 146981072
226700ms th_a       database_api.cpp:91           ~database_api_impl   ] freeing database api 146991648
226701ms th_a       database_api.cpp:91           ~database_api_impl   ] freeing database api 146975680
226701ms th_a       database_api.cpp:91           ~database_api_impl   ] freeing database api 146984080
226702ms p2p        thread.cpp:258                exec                 ] thread canceled: 9 canceled_exception: Canceled

    {}
    p2p  thread_d.hpp:493 start_next_fiber
unknown location(0): fatal error in "cli_quit": memory access violation at address: 0x00000000: no mapping at fault address
/bts/tests/cli/main.cpp(364): last checkpoint
Test is aborted
Leaving test case "cli_quit"; testing time: 71191mks
Leaving test suite "Test Application"

*** 1 failure detected in test suite "Test Application"

@abitmore abitmore marked this pull request as ready for review June 21, 2020 10:09
@abitmore abitmore marked this pull request as draft June 21, 2020 10:10
@abitmore abitmore mentioned this pull request Jun 21, 2020
17 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant