Improve module backtraces for C# and C++ bindings#4786
Open
clockwork-labs-bot wants to merge 4 commits intonoa/better-module-backtracesfrom
Open
Improve module backtraces for C# and C++ bindings#4786clockwork-labs-bot wants to merge 4 commits intonoa/better-module-backtracesfrom
clockwork-labs-bot wants to merge 4 commits intonoa/better-module-backtracesfrom
Conversation
Mirror the backtrace improvements from PR #577 (Rust/TS) to the C# and C++ module bindings so that stack traces captured by the host show actual reducer/procedure/view function names instead of anonymous wrappers. C# changes: - Add [MethodImpl(NoInlining)] to all generated Invoke() methods in reducer, procedure, and view dispatcher classes. This prevents the JIT/AOT from inlining these frames away, ensuring they appear as named WASM functions in wasmtime-captured backtraces. - Add Log.Error() in the reducer error handler for consistency with procedures and views, which already log full exceptions. C++ changes: - Add __attribute__((noinline)) to user function definitions in all macro variants: SPACETIMEDB_REDUCER, SPACETIMEDB_REDUCER_NAMED, SPACETIMEDB_INIT, SPACETIMEDB_CLIENT_CONNECTED, SPACETIMEDB_CLIENT_DISCONNECTED, SPACETIMEDB_VIEW, SPACETIMEDB_VIEW_NAMED, SPACETIMEDB_PROCEDURE, and SPACETIMEDB_PROCEDURE_NAMED. This ensures the actual user function name appears as a distinct frame in WASM backtraces rather than being optimized into the surrounding lambda wrappers. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Collaborator
Author
|
Pushed This is now stacked on the generic marker change from #577, and the C# / C++ follow-up uses |
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.
Summary
MethodImplOptions.NoInlining__attribute__((noinline))Testing
Stacks on top of #577.