-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[CI]: Fix random segmentation fault during event handling #9010
[CI]: Fix random segmentation fault during event handling #9010
Conversation
Please update the summary - I think it preserves some template text (says "Frobnozzle is leaky" and such) |
Could you also update the summary as to 'why does this segfault without the change'? |
But also, I'd like to understand the crash scenario. We called |
Yes, see more detail in the conversation above. |
1 similar comment
Yes, see more detail in the conversation above. |
Size increase report for "esp32-example-build" from f6c861e
Full report output
|
…ip#9010) * Fix random segmentation fault during event handling * Update for review comment
Problem
What is being fixed? Examples:
The root cause is the WatchableSocket could be changed by InvokeCallback() which might close the socket and disassociate its file descriptor.
Log should the watchable->mAttachedNext contain garbage value after InvokeCallback. We should not use its value to access the next element in the watchableSocket list.
[1628957118.857855][12770:12770] CHIP:IN: HandleEvents:watchable:140447941584200:364
[1628957118.857858][12770:12770] CHIP:IN: HandleEvents:watchable->mAttachedNext:140447941585480:364
[1628957118.857862][12770:12770] CHIP:IN: InvokeCallback
[1628957118.858559][12770:12770] CHIP:IN: Freeing connection: connection closed by peer
[1628957118.858569][12770:12770] CHIP:IN: ActiveConnectionState:free
[1628957118.858596][12770:12770] CHIP:IN: WatchableSocket::OnRelease
[1628957118.858807][12770:12770] CHIP:IN: HandleEvents:watchable:140447941584200:365
[1628957118.858814][12770:12770] CHIP:IN: HandleEvents:watchable->mAttachedNext:-2314885530818453537:365
Change overview
Move to next watchable before we do InvokeCallback() in case InvokeCallback() close watchable object.
Testing
How was this tested? (at least one bullet point required)