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 shutdown ordering in IM integration test #7469

Merged
merged 1 commit into from
Jun 9, 2021
Merged

Fix shutdown ordering in IM integration test #7469

merged 1 commit into from
Jun 9, 2021

Conversation

yufengwangca
Copy link
Contributor

Problem

What is being fixed?

https://github.com/yunhanw-google/connectedhomeip/actions/runs/919262233

after 2877e1e, which adjust shutdown ordering, we still see shutdown crash for IM test,
[1623175629.106721][155] CHIP:EM: Sending Standalone Ack for MsgId:00000007
[1623175629.106735][155] CHIP:IN: Secure message was encrypted: Msg ID 14
[1623175629.106741][155] CHIP:IN: Sending msg from 0x000000000001B669 to 0x0000000000BC5C01 at utc time: 1231353 msec
[1623175629.106746][155] CHIP:IN: Sending secure msg on generic transport
[1623175629.106779][155] CHIP:IN: Secure msg send status No Error
[1623175629.106784][155] CHIP:EM: Flushed pending ack for MsgId:00000007
[1623175629.106789][155] CHIP:DMG: Client[0] moving to [INIT]
Read Response: 3/3(100.00%) time=0.808ms
[1623175629.106820][145] CHIP:DMG: Client[0] moving to [UNINIT]
[1623175629.106826][145] CHIP:DMG: Client[0] moving to [UNINIT]
[1623175629.106830][145] CHIP:DMG: IM RH moving to [Uninitialized]
chip-im-initiator: ../../../../../src/messaging/ExchangeMgr.cpp:102: chip::Messaging::ExchangeManager::Shutdown()::<lambda(auto:2*)> [with auto:2 = chip::Messaging::ExchangeContext]: Assertion `false' failed.

Thread 1 "chip-im-initiat" received signal SIGABRT, Aborted.
0x00007ffff756118b in raise () from /lib/x86_64-linux-gnu/libc.so.6
#0 0x00007ffff756118b in raise () at /lib/x86_64-linux-gnu/libc.so.6
#1 0x00007ffff7540859 in abort () at /lib/x86_64-linux-gnu/libc.so.6
#2 0x00007ffff7540729 in () at /lib/x86_64-linux-gnu/libc.so.6
#3 0x00007ffff7551f36 in () at /lib/x86_64-linux-gnu/libc.so.6
#4 0x00005555555a2c35 in chip::Messaging::ExchangeManager::<lambda(auto:2*)>::operator()chip::Messaging::ExchangeContext(chip::Messaging::ExchangeContext ) const (__closure=0x7fffffffe417, ec=0x5555555e3e88 <gExchangeManager+360>)
at ../../../../../src/messaging/ExchangeMgr.cpp:102
#5 0x00005555555a2d49 in chip::BitMapObjectPool<chip::Messaging::ExchangeContext, 8>::ForEachActiveObject<chip::Messaging::ExchangeManager::Shutdown()::<lambda(auto:2)> >(chip::Messaging::ExchangeManager::<lambda(auto:2*)>)
(this=0x5555555e3e58 <gExchangeManager+312>, f=...)
at ../../../../../src/lib/support/Pool.h:140
#6 0x00005555555a2225 in chip::Messaging::ExchangeManager::Shutdown()
(this=0x5555555e3d20 )
at ../../../../../src/messaging/ExchangeMgr.cpp:100
#7 0x000055555556a078 in ShutdownChip() ()
at ../../../../../src/app/tests/integration/common.cpp:60
#8 0x0000555555568723 in main(int, char**) (argc=2, argv=0x7fffffffecf8)
at ../../../../../src/app/tests/integration/chip_im_initiator.cpp:458
(gdb) quit
A debugging session is active.

The reason is #7430 only adjust the shutdown ordering for controller, we need similar adjustment in IM integration test apps.

Fixes #7466

Change overview

Adjust the shutdown order and make sure network layer is shutdown first to prevent exchange manager still receive the messages while in a partially torn down state.

Testing

How was this tested? (at least one bullet point required)

  1. Setting up cirque environment
    git submodule update --init
    ./scripts/tests/cirque_tests.sh bootstrap

  2. Run IM Cirque test
    ./scripts/tests/cirque_tests.sh run_test InteractionModelTest

@yunhanw-google yunhanw-google requested a review from andy31415 June 8, 2021 22:21
@yunhanw-google yunhanw-google requested a review from msandstedt June 9, 2021 00:14
@bzbarsky-apple bzbarsky-apple merged commit 82f42e4 into project-chip:master Jun 9, 2021
@yufengwangca yufengwangca deleted the pr/im/leak branch June 10, 2021 03:15
nikita-s-wrk pushed a commit to nikita-s-wrk/connectedhomeip that referenced this pull request Sep 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Cirque] Still see shutdown crash in cirque IM test
5 participants