Closed mcoffin closed 2 years ago
OMG!!! I love you dude! This probably caused a long standing obscure bug of freeze/failing to process requests that I couldn't diagnose
Matt Coffin @.***> schrieb am Sa., 11. Dez. 2021, 22:11:
On some platforms, deleting elements from std::map::iterator while iterating through it can cause a segfault.
The reason being that calling erase() invalidates the iterator(s). This was observed to cause a problem when running intercept code on Windows 10 Server.
Despite this (apparently) not being an issue due to implementation details with g++ 11 and the MSVC runtimes on Win10 Home/Pro, this was a usage of undefined behavior, and removing it resolves the issue we observed on Win10 server.
You can view, comment on, or merge this pull request online at:
https://github.com/intercept/intercept-database/pull/30 Commit Summary
- f90b750 https://github.com/intercept/intercept-database/pull/30/commits/f90b750c7650e4301141c7b879a71c3f61c80c4a theading: Fix segfault in onCleanup
File Changes
(1 file https://github.com/intercept/intercept-database/pull/30/files)
- M src/threading.cpp https://github.com/intercept/intercept-database/pull/30/files#diff-6b6ea96e81ffe2e34b4a3992fc4d28467e672a36bff4a5b02b3c84bedfc45508 (7)
Patch Links:
- https://github.com/intercept/intercept-database/pull/30.patch
- https://github.com/intercept/intercept-database/pull/30.diff
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/intercept/intercept-database/pull/30, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA4X6ZMLVLJH3FASVK7VPTDUQO5BRANCNFSM5J3NVFNA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
On some platforms, deleting elements from std::map::iterator while iterating through it can cause a segfault.
The reason being that calling erase() invalidates the iterator(s). This was observed to cause a problem when running intercept code on Windows 10 Server.
Despite this (apparently) not being an issue due to implementation details with g++ 11 and the MSVC runtimes on Win10 Home/Pro, this was a usage of undefined behavior, and removing it resolves the issue we observed on Win10 server.