Skip to content
Merged
Show file tree
Hide file tree
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
create a non-faulty sigaltstack for the GHA runner
  • Loading branch information
supervacuus committed Nov 15, 2024
commit 84c94df532902a20f43dc11af26aba05f890b06c
12 changes: 12 additions & 0 deletions tests/fixtures/dotnet_signal/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ class Program
[DllImport("crash", EntryPoint = "native_crash")]
static extern void native_crash();

[DllImport("crash", EntryPoint = "enable_sigaltstack")]
static extern void enable_sigaltstack();

[DllImport("sentry", EntryPoint = "sentry_options_new")]
static extern IntPtr sentry_options_new();

Expand All @@ -22,6 +25,15 @@ class Program

static void Main(string[] args)
{
var githubActions = Environment.GetEnvironmentVariable("GITHUB_ACTIONS") ?? string.Empty;
if (githubActions == "true") {
// Set up our own `sigaltstack` for this thread if we're running on GHA because of a failure to run any
// signal handler after the initial setup. This behavior is locally non-reproducible and likely runner-related.
// I ran this against .net7/8/9 on at least 10 different Linux setups, and it worked on all, but on GHA
// it only works if we __don't__ accept the already installed `sigaltstack`.
enable_sigaltstack();
}

// setup minimal sentry-native
var options = sentry_options_new();
sentry_options_set_handler_strategy(options, 1);
Expand Down
15 changes: 15 additions & 0 deletions tests/fixtures/dotnet_signal/crash.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
#include <signal.h>
#include <stdlib.h>
void native_crash(void)
{
*(int *)10 = 100;
}

void enable_sigaltstack(void)
{
const size_t signal_stack_size = 16384;
stack_t signal_stack;
signal_stack.ss_sp = malloc(signal_stack_size);
if (!signal_stack.ss_sp) {
return;
}
signal_stack.ss_size = signal_stack_size;
signal_stack.ss_flags = 0;
sigaltstack(&signal_stack, 0);
}