-
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
Use LambdaBridge to safely invoke functions in GLib Matter context #35777
Use LambdaBridge to safely invoke functions in GLib Matter context #35777
Conversation
Review changes with SemanticDiff. |
bbdad4b
to
0ba09e4
Compare
PR #35777: Size comparison from 6f93ec2 to 09e28f5 Full report (13 builds for cc13x4_26x4, cc32xx, nrfconnect, nxp, stm32)
|
PR #35777: Size comparison from e8554de to 38d3ed7 Increases above 0.2%:
Full report (45 builds for cyw30739, efr32, esp32, linux, nxp, psoc6, stm32)
|
6437a59
to
af70f8a
Compare
PR #35777: Size comparison from 648f088 to af70f8a Increases above 0.2%:
Full report (86 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink)
|
PR #35777: Size comparison from 648f088 to 4601183 Full report (47 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, nrfconnect, nxp, psoc6, qpg, stm32)
|
PR #35777: Size comparison from 648f088 to db933d5 Increases above 0.2%:
Full report (49 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, linux, nrfconnect, nxp, psoc6, qpg, stm32)
|
PR #35777: Size comparison from 648f088 to 25bc05c Increases above 0.2%:
Full report (88 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
PR #35777: Size comparison from 648f088 to 4940638 Increases above 0.2%:
Full report (88 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
- Reactivating UndefinedBehaviorSanitizer after having fixed UBSan issue: project-chip/connectedhomeip#35777 - MemorySanitizer can not be activated due to false positives showing for `glib`. Apparently all dependencies including glib will need to be re-compiled with MSan to avoid these false-positives.
…roject-chip#35777) * using LambdaBridge to cast function pointer * adding support for Lambda that returns a CHIP_ERROR to LambdaBridge * pass an out pointer to capture function return result * Tizen Platform: Using LambdaBridge to safely invoke functions in GLib Matter context * Update to not modify lambdabridge * Potentiall cleaner code * Update code to make it compile * Update tizen code too * Tizen platform fix * Duplicating Changes to NuttX platform * Tizen Platform Fix --------- Co-authored-by: Andrei Litvin <[email protected]>
Problem
"-fno-sanitize=vptr,function"
in the config.function
detects "Indirect call of a function through a function pointer of the wrong type", which is considered undefined behaviour by C99 and C++ standards.CHIP_ERROR(*)(T*)
toCHIP_ERROR(*)(void*)
:Fix
Fix involves using
LambdaBridge
to safely cast and call the invoked function in the GLib Matter Context.the Lambda that is passed to
GLibMatterContextInvokeSync()
will be stored and passed as a LambdaBridge to theg_main_context_invoke_full
for execution.Fix was Added to Linux, Tizen and NuttX platforms.