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 TestDnssd. #26024

Merged
merged 1 commit into from
Apr 11, 2023

Conversation

bzbarsky-apple
Copy link
Contributor

For init it does, in order: PlatformMgr().InitChipStack(), ChipDnssdInit, RunEventLoop.

For shutdown it should do them in exactly the opposite order.

Fixes #26023

For init it does, in order: PlatformMgr().InitChipStack(), ChipDnssdInit,
RunEventLoop.

For shutdown it should do them in exactly the opposite order.

Fixes project-chip#26023
@github-actions
Copy link

github-actions bot commented Apr 7, 2023

PR #26024: Size comparison from 8676d06 to 48bc4e9

Decreases (1 build for cc32xx)
platform target config section 8676d06 48bc4e9 change % change
cc32xx lock CC3235SF_LAUNCHXL .debug_info 20302991 20302990 -1 -0.0
Full report (1 build for cc32xx)
platform target config section 8676d06 48bc4e9 change % change
cc32xx lock CC3235SF_LAUNCHXL 0 0 0 0.0
(read only) 642745 642745 0 0.0
(read/write) 203848 203848 0 0.0
.ARM.attributes 44 44 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 197248 197248 0 0.0
.comment 194 194 0 0.0
.data 1480 1480 0 0.0
.debug_abbrev 933119 933119 0 0.0
.debug_aranges 87608 87608 0 0.0
.debug_frame 301328 301328 0 0.0
.debug_info 20302991 20302990 -1 -0.0
.debug_line 2679759 2679759 0 0.0
.debug_loc 2824679 2824679 0 0.0
.debug_ranges 286200 286200 0 0.0
.debug_str 3039406 3039406 0 0.0
.ramVecs 780 780 0 0.0
.resetVecs 64 64 0 0.0
.rodata 104289 104289 0 0.0
.shstrtab 232 232 0 0.0
.stab 204 204 0 0.0
.stabstr 441 441 0 0.0
.stack 2048 2048 0 0.0
.strtab 377422 377422 0 0.0
.symtab 256768 256768 0 0.0
.text 536336 536336 0 0.0

Copy link
Contributor

@arkq arkq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you've got some time, please also take a look at the exit(0) in the HandleResolve() function. When fixing this issue: #25466 I had to comment out lines 42-44, otherwise, in some test runs Shutdown() was called twice which has caused "strange" errors due to use after free/double free issue. If I remember correctly the exit(0) triggers handler registered by atexit() which also does something with platform shutdown. However, I've got no time to dive dipper into that.

@bzbarsky-apple
Copy link
Contributor Author

If I remember correctly the exit(0) triggers handler registered by atexit() which also does something with platform shutdown.

There's no atexit handler like that in the unit tests.

@arkq
Copy link
Contributor

arkq commented Apr 7, 2023

There's no atexit handler like that in the unit tests.

Yes, it's not in the unit test. I've got some troubles to determine where the handler was registered, but I do remember that it was "atexit() > ... > Shutdown() > ...." in the callstack...

@bzbarsky-apple bzbarsky-apple merged commit b5d2e49 into project-chip:master Apr 11, 2023
@bzbarsky-apple bzbarsky-apple deleted the fix-dnssd-test branch April 11, 2023 15:40
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.

Threadsafety assertion in TestDnssd
3 participants