added hook for error processing#156
Merged
Merged
Conversation
fdesbiens
added a commit
to fdesbiens/guix-fd
that referenced
this pull request
Jun 1, 2026
All callers of _gx_canvas_drawing_initiate() must check the return
value before calling draw functions or _gx_canvas_drawing_complete().
When GX_DRAW_NESTING_EXCEEDED is returned the context stack is NOT
pushed, so calling _gx_canvas_drawing_complete() corrupts the outer
context's nesting counter.
Fix pattern (matching _gx_widget_children_draw.c reference impl):
status = _gx_canvas_drawing_initiate(...);
if (status == GX_SUCCESS) { draw(); _gx_canvas_drawing_complete(); }
else if (status == GX_NO_VIEWS) { _gx_canvas_drawing_complete(); }
// else: stack overflow or invalid memory -- do nothing
Files fixed:
- gx_animation_start.c
- gx_animation_drag_tracking_start.c
- gx_multi_line_text_view_text_draw.c
- gx_multi_line_text_input_draw.c
- gx_rich_text_view_text_draw.c
- gx_single_line_text_input_draw.c
- gx_radial_progress_bar_background_draw.c (GX_BRUSH_ALPHA_SUPPORT path)
- gx_widget_block_move.c
- gx_system_canvas_refresh.c (partial and non-partial paths)
Also applied PR eclipse-threadx#156: added GX_ENABLE_ERROR_CALLBACK hook for non-ThreadX
RTOS bindings, allowing callers to suspend the GUIX task on error.
- gx_system_error_process.c
- gx_system_rtos_bind.h
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
fdesbiens
added a commit
to fdesbiens/guix-fd
that referenced
this pull request
Jun 1, 2026
All callers of _gx_canvas_drawing_initiate() must check the return
value before calling draw functions or _gx_canvas_drawing_complete().
When GX_DRAW_NESTING_EXCEEDED is returned the context stack is NOT
pushed, so calling _gx_canvas_drawing_complete() corrupts the outer
context's nesting counter.
Fix pattern (matching _gx_widget_children_draw.c reference impl):
status = _gx_canvas_drawing_initiate(...);
if (status == GX_SUCCESS) { draw(); _gx_canvas_drawing_complete(); }
else if (status == GX_NO_VIEWS) { _gx_canvas_drawing_complete(); }
// else: stack overflow or invalid memory -- do nothing
Files fixed:
- gx_animation_start.c
- gx_animation_drag_tracking_start.c
- gx_multi_line_text_view_text_draw.c
- gx_multi_line_text_input_draw.c
- gx_rich_text_view_text_draw.c
- gx_single_line_text_input_draw.c
- gx_radial_progress_bar_background_draw.c (GX_BRUSH_ALPHA_SUPPORT path)
- gx_widget_block_move.c
- gx_system_canvas_refresh.c (partial and non-partial paths)
- gx_system_error_process.c (Copilot attribution only; functional changes via eclipse-threadx#156)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is related to #148 (comment).
If GX_DISABLE_THREADX_BINDING is defined this gives the option to also define GX_ENABLE_ERROR_CALLBACK to activate another function call for custom RTOS bindings:
VOID gx_generic_error_process(UINT error_code, ULONG error_count);As mentioned in the linked issue-comment this hook could be used to call something like
vTaskCustomSuspend(guix_task_handle);on a FreeRTOS system to keep GUIX from potentially breaking the whole FreeRTOS system by suspending the GUIX task.Feel free to change this code before merging e.g. if you prefer to have this option independently of GX_DISABLE_THREADX_BINDING or if my proposal messes up some GUIX principle that I was not aware of.
I'd just like to have something in the GUIX library to immediately suspend the GUIX task at this point.