Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
07724c6
transferring to linux test machine
supervacuus Aug 5, 2024
752b125
clean up formatting
supervacuus Aug 5, 2024
b38d0e6
fix build
supervacuus Aug 5, 2024
b41ed01
reintroduce #ifdef symmetry regarding the usage of the handler_strate…
supervacuus Aug 5, 2024
4f57a0e
const options param in the handler_strategy getter
supervacuus Aug 5, 2024
09020db
ensure we "leave" the signal-handler when we invoke the CLR/Mono runt…
supervacuus Aug 5, 2024
fee764e
ensure the page_allocator is only enabled when we have an actual nati…
supervacuus Nov 12, 2024
1a8626d
continuing the signal chain at the end is something we want for both …
supervacuus Nov 12, 2024
eb12874
get rid of obsolete local var
supervacuus Nov 12, 2024
b08d939
add trace logs to at-start chaining, so we can see the behavior in th…
supervacuus Nov 12, 2024
2841e64
ensure page-allocator is only referenced on UNIXes
supervacuus Nov 12, 2024
799743f
add integration test for managed and native crash
supervacuus Nov 14, 2024
0aac4e9
ignore 32-bit Linux build in the integration test
supervacuus Nov 14, 2024
fbe9818
remove native sdk logging assert temporarily
supervacuus Nov 14, 2024
0403d18
fix pytest skip for x86
supervacuus Nov 14, 2024
4231642
inverted demorgan
supervacuus Nov 14, 2024
f926707
extract skip_condition to check what provokes the invalid syntax
supervacuus Nov 14, 2024
6e65b62
re-enable log check, since we know it is not about log flushing but d…
supervacuus Nov 15, 2024
67de245
clean up sigaltstack initialization
supervacuus Nov 15, 2024
bc47fcf
clean up run assertion on output, so we can actually see what's happe…
supervacuus Nov 15, 2024
84c94df
create a non-faulty `sigaltstack` for the GHA runner
supervacuus Nov 15, 2024
c735270
disable the test on ASAN runs since that would require an instrumente…
supervacuus Nov 15, 2024
ca5e83a
Add changelog.
supervacuus Nov 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
ensure we "leave" the signal-handler when we invoke the CLR/Mono runt…
…ime handler
  • Loading branch information
supervacuus committed Nov 15, 2024
commit 09020db5c0b16b4cd3445fed07e7eb92372e18b6
20 changes: 16 additions & 4 deletions src/backends/sentry_backend_inproc.c
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,10 @@ handle_ucontext(const sentry_ucontext_t *uctx)

#ifdef SENTRY_PLATFORM_UNIX
// give us an allocator we can use safely in signals before we tear down.
// TODO: for `SENTRY_HANDLER_STRATEGY_CHAIN_AT_START` to work together with
// our page allocator we must find a way to maintain memory usage.
// We might be able to move this "enable" far enough down, because I
// think we do not allocate before we hit `make_signal_event()`.
sentry__page_allocator_enable();

// inform the sentry_sync system that we're in a signal handler. This will
Expand All @@ -551,13 +555,21 @@ handle_ucontext(const sentry_ucontext_t *uctx)
#ifdef SENTRY_PLATFORM_LINUX
handler_strategy = sentry_options_get_handler_strategy(options);

// CLR/Mono convert signals provoked by "managed" native code into
// managed code exceptions. In these cases, we shouldn't react to
// the signal at all and let their handler discontinue the signal
// chain by invoking the runtime handler before we process the signal.
if (handler_strategy == SENTRY_HANDLER_STRATEGY_CHAIN_AT_START) {
// CLR/Mono convert signals provoked by "managed" native code into
// managed code exceptions. In these cases, we shouldn't react to
// the signal at all and let their handler discontinue the signal
// chain.
// there is a good chance that we won't return from the previous
// handler and that would mean we couldn't enter this handler with
// the next signal coming in if we didn't "leave" here.
sentry__leave_signal_handler();

invoke_signal_handler(
uctx->signum, uctx->siginfo, (void *)uctx->user_context);

// let's re-enter because it means this was an actual native crash
sentry__enter_signal_handler();
}
#endif

Expand Down