Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
143 commits
Select commit Hold shift + click to select a range
d6b7952
Initial implementation
mujacica Oct 28, 2025
153ffc5
Update build structure and daemon
mujacica Oct 29, 2025
4028e74
Updates for Windows support
mujacica Oct 29, 2025
e2bd09d
Fix logging
mujacica Oct 29, 2025
dc50ab7
Fix MacOs builds
mujacica Oct 29, 2025
b2e8f0b
Fix Warnings
mujacica Oct 29, 2025
b0eec02
Test fixes
mujacica Oct 29, 2025
93b5b35
Fix linux builds
mujacica Oct 29, 2025
0e795c1
Fix linux/mac modules
mujacica Oct 29, 2025
445bd15
Fix concurency
mujacica Oct 29, 2025
558e301
Fix build errors
mujacica Oct 29, 2025
08b8467
Formatting
mujacica Oct 29, 2025
2185020
Fix 32bit builds
mujacica Oct 29, 2025
3e217b8
Fix format
mujacica Oct 29, 2025
d81d949
Fix some issues
mujacica Oct 29, 2025
bcab40a
Native tests need http/transport
mujacica Oct 29, 2025
4da1aa0
Fix CMake
mujacica Oct 29, 2025
1492532
Fix build
mujacica Oct 29, 2025
dc29bba
Fix errors
mujacica Oct 30, 2025
6ad840f
Fix format
mujacica Oct 30, 2025
8b86918
Fix style
mujacica Oct 30, 2025
2beef9b
Fix some of the issues
mujacica Oct 30, 2025
1200d57
Fix format
mujacica Oct 30, 2025
599be9d
Moooore fixes
mujacica Oct 30, 2025
ac10890
Debug CI
mujacica Oct 30, 2025
86e95c5
More debug
mujacica Oct 30, 2025
58e3798
More debug
mujacica Oct 30, 2025
898a0f4
More debug
mujacica Oct 30, 2025
064aadc
And more
mujacica Oct 30, 2025
d1cc5d8
More fixes
mujacica Oct 30, 2025
be128bb
Linux fixes
mujacica Oct 30, 2025
f8f7688
Fix i386 builds
mujacica Oct 30, 2025
e16e9e9
More fixes
mujacica Oct 30, 2025
7ea8623
Fix more tests
mujacica Oct 30, 2025
e7ef468
More fixes
mujacica Oct 30, 2025
eb060f0
Fix native backend daemon discovery and resource leaks
mujacica Jan 15, 2026
d93897b
fix: use signal-safe memory operations in crash handler for TSAN/ASAN…
mujacica Jan 15, 2026
be09aab
Fix TSAN test failures and unused function warnings
mujacica Jan 15, 2026
f931de6
Fix TSAN robustness for native crash HTTP tests
mujacica Jan 15, 2026
b7c6e16
Fix native test failures under kcov and sanitizers
mujacica Jan 15, 2026
5da3a64
Add run_crash helper to handle kcov exit code quirk
mujacica Jan 15, 2026
4a2ba53
Fix Windows ClangCL build and improve signal handler robustness
mujacica Jan 15, 2026
51dba39
Fix format
mujacica Jan 15, 2026
e2cc3db
Fix Windows ARM64 and macOS ASAN CI failures
mujacica Jan 15, 2026
feef1ac
Fix tests
mujacica Jan 15, 2026
a5786db
Fix Windows/ASAN CI failures and add crash reporting mode API
mujacica Jan 15, 2026
b1a217f
Fix Windows/ASAN CI failures and add crash reporting mode API
mujacica Jan 15, 2026
76e6e84
Fix attachment handling in native crash daemon with native stacktrace…
mujacica Jan 15, 2026
43893f8
Fix attachment handling in native crash daemon with native stacktrace…
mujacica Jan 15, 2026
e79fdfe
Fix CI failures: Windows ClangCL build and resource leaks
mujacica Jan 15, 2026
a034be5
Fix macOS minidump resource leaks and uninitialized state
mujacica Jan 15, 2026
1f2272d
Skip native backend tests on macOS ASAN
mujacica Jan 15, 2026
0d09541
Add E2E tests and fix thread duplication in native-with-minidump mode
mujacica Jan 15, 2026
5084843
Add debug symbol upload to E2E workflow for symbolication
mujacica Jan 15, 2026
34e1576
Fix debug_meta to use crashed process modules instead of daemon modules
mujacica Jan 15, 2026
0491f4c
Add missing sys/uio.h header and fix code style
mujacica Jan 15, 2026
87ce91b
Fix Python formatting in E2E tests
mujacica Jan 15, 2026
ce74814
Reduce thread count assertion from >= 3 to >= 1
mujacica Jan 15, 2026
a0e0c90
Add Linux module capture from /proc/maps for debug_meta
mujacica Jan 15, 2026
b697a47
Remove debug symbol upload from E2E workflow
mujacica Jan 15, 2026
302b57f
Fix unused parameter warning on Windows
mujacica Jan 15, 2026
df78f51
Fix ELF debug_id byte swapping for Linux module capture
mujacica Jan 15, 2026
662e8ee
Add Linux thread enumeration from /proc/task for native mode
mujacica Jan 15, 2026
35a847d
Fix code style
mujacica Jan 15, 2026
e1dbda9
Enable structured logs in E2E crash tests
mujacica Jan 15, 2026
03177f8
Fix Linux module capture and ARM64 stack unwinding
mujacica Jan 15, 2026
9ea5787
Fix Windows 32-bit compile warnings for uint64_t to size_t conversion
mujacica Jan 16, 2026
946bffd
Increase E2E test polling to 100 attempts with 6 second intervals
mujacica Jan 16, 2026
caf0e8c
Add PE code_id for Windows modules in native crash events
mujacica Jan 16, 2026
41cb886
Improve Windows stack capture for frame pointer unwinding
mujacica Jan 16, 2026
5144c97
Use StackWalk64 for Windows stack unwinding in native backend
mujacica Jan 16, 2026
12143b6
Fix Windows build: add forward declaration for walk_stack_with_dbghelp
mujacica Jan 16, 2026
ffc5eb0
Add module enrichment to stack frames and build stacktraces for all t…
mujacica Jan 16, 2026
05174dc
Fix empty frames and use per-thread context for Linux
mujacica Jan 16, 2026
b11ddc8
Fix unused variable warning on Windows ClangCL build
mujacica Jan 16, 2026
2f995c5
Fix Linux module size calculation to span all memory mappings
mujacica Jan 16, 2026
3c98485
Fix GUID alignment issue when reading PDB debug info on Windows
mujacica Jan 16, 2026
e9cd714
Add diagnostic logging for Windows vs Linux debug_meta investigation
mujacica Jan 16, 2026
915c136
Add diagnostic logging for Windows vs Linux debug_meta investigation
mujacica Jan 16, 2026
82a8dc8
Add debug_file and fix code_id format for Windows native backend
mujacica Jan 16, 2026
a0cf1a8
Add debug_file and fix code_id format for Windows native backend
mujacica Jan 17, 2026
524284a
More windows fixes + PR fixes
mujacica Jan 19, 2026
e1a6733
Fix minidump writer issues from PR review
mujacica Jan 20, 2026
bd1d965
Fix minidump writer issues from PR review (part 2)
mujacica Jan 20, 2026
d10823f
Fix shared memory corruption and ELF parsing infinite loop
mujacica Jan 20, 2026
949d3da
Add arch field for Windows PE modules and device context
mujacica Feb 5, 2026
fbd8c24
Refactor duplicated sanitizer detection preprocessor logic
mujacica Feb 5, 2026
abd8cd6
Fix tests/comments/changelog
mujacica Feb 5, 2026
9b8bc7a
Fix native stacktrace format to match minidump events
mujacica Feb 5, 2026
0269a16
Fix PR review comments: E2E workflow and macOS thread_get_state
mujacica Feb 5, 2026
67585f0
Fix PR review comments: E2E workflow and macOS thread_get_state
mujacica Feb 5, 2026
340ba2f
Refactor minidump writers and fix PR review comments
mujacica Feb 5, 2026
0b6f63c
Fix Bugbot issues: overflow check, unused struct and constant
mujacica Feb 5, 2026
acbf4c2
Fix duplicate stacktrace in threads for envelope-only mode
mujacica Feb 5, 2026
987b23c
Ensure code_id uses uppercase hex digits
mujacica Feb 5, 2026
5fa4d45
Fix integer overflow in ELF section header size calculation
mujacica Feb 5, 2026
9fea947
Fix async-signal-unsafe functions in crash signal handler
mujacica Feb 5, 2026
0841881
Fix Windows exception code sent as negative number
mujacica Feb 5, 2026
209c8e5
Fix UTF-8 to UTF-16LE conversion for non-ASCII characters
mujacica Feb 5, 2026
49b1569
Add Windows thread deduplication in native crash events
mujacica Feb 5, 2026
ce42364
Capture Windows thread contexts for proper stack walking
mujacica Feb 5, 2026
7e2ab4d
Add defensive thread deduplication at event-building level
mujacica Feb 5, 2026
bc98a66
Remove redundant memset in Linux IPC initialization
mujacica Feb 5, 2026
5f5bc0c
Remove workaround deduplication and add diagnostic logging
mujacica Feb 5, 2026
607ba1c
Fix unchecked lseek return values and formatting issues
mujacica Feb 5, 2026
89476ba
Add diagnostic logging for thread duplication investigation
mujacica Feb 5, 2026
61daa45
Add thread duplication detection and daemon log printing to E2E tests
mujacica Feb 5, 2026
7dbafd4
Fix format
mujacica Feb 5, 2026
8061d62
Add detailed thread debugging to E2E tests
mujacica Feb 5, 2026
9647e5f
Fix PR comment
mujacica Feb 5, 2026
c590fcb
Speed up linux tests
mujacica Feb 5, 2026
7170e73
Fix register usages
mujacica Feb 5, 2026
c8500f9
Fix CHANGELOG
mujacica Feb 11, 2026
f53c927
Fix Bugbot comments
mujacica Feb 11, 2026
657c2ce
fix: detect Windows daemon start failure and add native backend to cr…
mujacica Mar 2, 2026
5baf169
fix: move changelog entry to Unreleased section
mujacica Mar 2, 2026
7f01802
fix: link sentry-crash to vendored libunwind target on Linux
mujacica Mar 2, 2026
d4e465a
fix: swap ARM64 fpcr/fpsr field order and ptrace attach to crashed TID
mujacica Mar 2, 2026
ab121cf
Fix failing tests
mujacica Mar 3, 2026
c7b201d
fix: formatting and improved idle-based batcher flush
mujacica Mar 3, 2026
cfbb65b
fix: clean up corrupt minidump files, remove duplicate CMake sources,…
mujacica Mar 3, 2026
1ad7a8a
style: fix black formatting in test_e2e_sentry.py
mujacica Mar 3, 2026
778dc14
fix: daemon compile defs, minidump header offset, RVA overflow, batch…
mujacica Mar 3, 2026
41e6df6
fix: widen current_offset to uint64_t so RVA overflow guard works, ze…
mujacica Mar 3, 2026
77e8772
fix: match current_offset type (uint64_t) in platform minidump writer…
mujacica Mar 3, 2026
4ca17f5
fix: aarch64 Linux register off-by-one and Windows FULL mode process …
mujacica Mar 3, 2026
7a4a26d
fix: move mctx variable inside x86_64 block to fix unused variable wa…
mujacica Mar 3, 2026
7b0e128
fix: guard against write failures in minidump writers
mujacica Mar 3, 2026
4f3e376
fix: thread context size after ptrace, macOS bytes_read check, paddin…
mujacica Mar 3, 2026
7137353
Fix E2E Tests
mujacica Mar 3, 2026
dc72ba9
fix: restrict macOS SMART mode memory regions and guard RVA overflow
mujacica Mar 3, 2026
d56423d
E2E Test fixes
mujacica Mar 3, 2026
049d06e
style: fix black formatting in test_e2e_sentry.py
mujacica Mar 3, 2026
95c5c0a
fix: correct OS type constants and stack lookup for non-main threads
mujacica Mar 3, 2026
888b29c
fix: malloc(0) on empty modules, missing MiscInfo stream, _XOPEN_SOUR…
mujacica Mar 3, 2026
540f5e3
fix: mach port leak, FPU pointer truncation, opcode, stream count
mujacica Mar 3, 2026
0ed072e
fix: zero descriptor size when write_data fails for stacks and memory
mujacica Mar 3, 2026
efa6859
fix: skip __PAGEZERO in macOS module size, guard fallback stack write
mujacica Mar 5, 2026
c6664d0
refactor: remove artificial idle threshold from batcher timer
mujacica Mar 5, 2026
0801c46
docs: mark native backend as experimental
mujacica Mar 5, 2026
2cbe481
fix: reject byte-swapped Mach-O in extract_macho_uuid
mujacica Mar 5, 2026
d95a326
Update src/sentry_batcher.c
mujacica Mar 5, 2026
80a09db
style: wrap long comment line in batcher to satisfy clang-format
mujacica Mar 5, 2026
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
58 changes: 58 additions & 0 deletions .github/workflows/e2e-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: E2E Integration Tests

on:
push:
branches:
- master
- "release/**"
pull_request:

concurrency:
group: e2e-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
e2e-test:
name: E2E Test (${{ matrix.os }})
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Install dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt update
sudo apt install -y cmake libcurl4-openssl-dev

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install test dependencies
run: pip install -r tests/requirements.txt

- name: Add hosts entry (Linux/macOS)
if: runner.os != 'Windows'
run: sudo sh -c 'echo "127.0.0.1 sentry.native.test" >> /etc/hosts'

- name: Add hosts entry (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: Add-Content C:\Windows\System32\drivers\etc\hosts "127.0.0.1 sentry.native.test"

- name: Run E2E tests
env:
SENTRY_E2E_DSN: ${{ secrets.SENTRY_E2E_DSN }}
SENTRY_E2E_AUTH_TOKEN: ${{ secrets.SENTRY_E2E_AUTH_TOKEN }}
SENTRY_E2E_ORG: ${{ secrets.SENTRY_E2E_ORG }}
SENTRY_E2E_PROJECT: ${{ secrets.SENTRY_E2E_PROJECT }}
run: pytest --capture=no --verbose tests/test_e2e_sentry.py
Comment thread
mujacica marked this conversation as resolved.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

**Features**:

- **Experimental**: Add new `native` crash handling backend as an alternative to `crashpad`, `breakpad`, and `inproc`. This backend uses an out-of-process daemon that monitors the application for crashes, generates minidumps, and sends crash reports to Sentry. It supports Linux, macOS, and Windows, and is fully compatible with TSAN and ASAN sanitizers. This feature is experimental and under active development. ([#1433](https://github.com/getsentry/sentry-native/pull/1433))

**Fixes**:

- Allow null custom log attributes without debug warning ([#1552](https://github.com/getsentry/sentry-native/pull/1552))
Expand Down
106 changes: 104 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ else()
cmake_policy(SET CMP0077 NEW)
endif()

# Allow target_link_libraries() in subdirectories
if(POLICY CMP0079)
cmake_policy(SET CMP0079 NEW)
endif()

# Allow downstream SDKs to override the SDK version at CMake configuration time
set(SENTRY_SDK_VERSION "" CACHE STRING "Override the SDK version (supports full semver format with build metadata)")

Expand Down Expand Up @@ -211,9 +216,12 @@ else()
set(SENTRY_DEFAULT_BACKEND "inproc")
endif()

# Native backend is available on all platforms as an alternative
# It's lightweight (~5K LOC) and supports all platforms

if(NOT DEFINED SENTRY_BACKEND)
set(SENTRY_BACKEND ${SENTRY_DEFAULT_BACKEND} CACHE STRING
"The sentry backend responsible for reporting crashes, can be either 'none', 'inproc', 'breakpad' or 'crashpad'.")
"The sentry backend responsible for reporting crashes, can be either 'none', 'inproc', 'breakpad', 'crashpad', or 'native'.")
endif()

if(SENTRY_BACKEND STREQUAL "crashpad")
Expand All @@ -222,14 +230,18 @@ elseif(SENTRY_BACKEND STREQUAL "inproc")
set(SENTRY_BACKEND_INPROC TRUE)
elseif(SENTRY_BACKEND STREQUAL "breakpad")
set(SENTRY_BACKEND_BREAKPAD TRUE)
elseif(SENTRY_BACKEND STREQUAL "native")
message(WARNING "The 'native' backend is experimental and under active development. "
"It may have incomplete features or unexpected behavior.")
set(SENTRY_BACKEND_NATIVE TRUE)
elseif(SENTRY_BACKEND STREQUAL "none")
set(SENTRY_BACKEND_NONE TRUE)
elseif(SENTRY_BACKEND STREQUAL "custom")
message(DEBUG
"SENTRY_BACKEND set to 'custom' - a custom backend source must be added to the compilation unit by the downstream SDK.")
else()
message(FATAL_ERROR
"SENTRY_BACKEND must be one of 'crashpad', 'inproc', 'breakpad' or 'none'.
"SENTRY_BACKEND must be one of 'crashpad', 'inproc', 'breakpad', 'native', or 'none'.
Downstream SDKs may choose to provide their own by specifying 'custom'.")
endif()

Expand Down Expand Up @@ -729,6 +741,96 @@ elseif(SENTRY_BACKEND_BREAKPAD)
endif()
elseif(SENTRY_BACKEND_INPROC)
target_compile_definitions(sentry PRIVATE SENTRY_WITH_INPROC_BACKEND)
elseif(SENTRY_BACKEND_NATIVE)
target_compile_definitions(sentry PRIVATE SENTRY_WITH_NATIVE_BACKEND)

# Native backend sources and configuration are in src/CMakeLists.txt
# The native backend requires C11 for atomics (set in src/CMakeLists.txt)

# Build sentry-crash executable for native backend
# Get all sources that were added to sentry target
get_target_property(SENTRY_SOURCES sentry SOURCES)

# Create daemon executable with same sources (already includes
# sentry_crash_daemon.c and sentry_crash_ipc.c from src/CMakeLists.txt)
add_executable(sentry-crash
${SENTRY_SOURCES}
)
Comment thread
mujacica marked this conversation as resolved.

# Copy all compile definitions from sentry target so shared sources
# compile under identical preprocessor conditions (backend, transport,
# unwinder, compression, etc.)
get_target_property(SENTRY_COMPILE_DEFS sentry COMPILE_DEFINITIONS)
if(SENTRY_COMPILE_DEFS)
# The daemon is always a static executable, never a shared library
list(REMOVE_ITEM SENTRY_COMPILE_DEFS "SENTRY_BUILD_SHARED")
target_compile_definitions(sentry-crash PRIVATE ${SENTRY_COMPILE_DEFS})
endif()

# Add daemon-specific definitions
target_compile_definitions(sentry-crash PRIVATE
SENTRY_CRASH_DAEMON_STANDALONE
SENTRY_BUILD_STATIC
)
Comment thread
mujacica marked this conversation as resolved.

# Copy include directories from sentry target
target_include_directories(sentry-crash PRIVATE
${PROJECT_SOURCE_DIR}/include
${PROJECT_SOURCE_DIR}/src
${PROJECT_SOURCE_DIR}/src/backends/native
)

# Link same libraries as sentry
if(WIN32)
target_link_libraries(sentry-crash PRIVATE dbghelp shlwapi version)
elseif(LINUX OR ANDROID)
target_link_libraries(sentry-crash PRIVATE pthread rt dl)
elseif(APPLE)
find_library(COREFOUNDATION_LIBRARY CoreFoundation REQUIRED)
find_library(SECURITY_LIBRARY Security REQUIRED)
target_link_libraries(sentry-crash PRIVATE
${COREFOUNDATION_LIBRARY}
${SECURITY_LIBRARY}
)
endif()

# Transport-specific libraries
if(SENTRY_TRANSPORT_CURL)
target_link_libraries(sentry-crash PRIVATE CURL::libcurl)
endif()

if(SENTRY_TRANSPORT_WINHTTP)
target_link_libraries(sentry-crash PRIVATE winhttp)
endif()


# Compression library
if(SENTRY_TRANSPORT_COMPRESSION)
target_link_libraries(sentry-crash PRIVATE ZLIB::ZLIB)
endif()

# Unwinder libraries (must match sentry target)
if(SENTRY_WITH_LIBUNWINDSTACK)
target_link_libraries(sentry-crash PRIVATE unwindstack)
endif()

if(SENTRY_WITH_LIBUNWIND AND LINUX)
target_link_libraries(sentry-crash PRIVATE unwind)
endif()

# Make sentry library depend on crash daemon so it's always built together
add_dependencies(sentry sentry-crash)

# Install daemon
install(TARGETS sentry-crash
RUNTIME DESTINATION bin
)

if(DEFINED SENTRY_FOLDER)
# Native backend doesn't have separate targets to organize
endif()
Comment thread
mujacica marked this conversation as resolved.

message(STATUS "Sentry crash daemon executable: enabled")
endif()

option(SENTRY_INTEGRATION_QT "Build Qt integration")
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,10 @@ using `cmake -D BUILD_SHARED_LIBS=OFF ..`.
only supported on Desktop OSs.
- **inproc**: A small in-process handler that is supported on all platforms,
and is used as a default on Android.
- **native**: **(Experimental)** An out-of-process crash handler that uses a
lightweight daemon to monitor the application, generate minidumps, and send
crash reports. Supports Linux, macOS, and Windows. Compatible with TSAN and
ASAN sanitizers. This backend is under active development.
- **none**: This builds `sentry-native` without a backend, so it does not handle
crashes. It is primarily used for tests.

Expand Down
57 changes: 57 additions & 0 deletions examples/example.c
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,17 @@ make_proxy_url(char *buf, size_t buf_size, const char *scheme,
}
}

static const char *
get_arg_value(int argc, char **argv, const char *arg)
{
for (int i = 1; i < argc - 1; i++) {
if (strcmp(argv[i], arg) == 0) {
return argv[i + 1];
}
}
return NULL;
}

#if defined(SENTRY_PLATFORM_WINDOWS) && !defined(__MINGW32__) \
&& !defined(__MINGW64__)

Expand Down Expand Up @@ -342,10 +353,25 @@ static void *invalid_mem = (void *)0xFFFFFFFFFFFFFF9B; // -100 for memset
static void *invalid_mem = (void *)1;
#endif

// Detect Address Sanitizer (works for both GCC and Clang)
#if defined(__SANITIZE_ADDRESS__)
# define SENTRY_ASAN_ACTIVE 1
#elif defined(__has_feature)
# if __has_feature(address_sanitizer)
# define SENTRY_ASAN_ACTIVE 1
# endif
#endif

static void
trigger_crash()
{
#ifdef SENTRY_ASAN_ACTIVE
// Under ASAN, raise signal directly to bypass ASAN's memory interception.
// ASAN intercepts memset and would abort before our signal handler runs.
raise(SIGSEGV);
#else
memset((char *)invalid_mem, 1, 100);
#endif
}

static void
Expand Down Expand Up @@ -658,6 +684,29 @@ main(int argc, char **argv)
options, discarding_before_breadcrumb_callback, NULL);
}

if (has_arg(argc, argv, "crash-mode")) {
const char *mode = get_arg_value(argc, argv, "crash-mode");
if (mode != NULL) {
if (strcmp(mode, "minidump") == 0) {
sentry_options_set_crash_reporting_mode(
options, SENTRY_CRASH_REPORTING_MODE_MINIDUMP);
} else if (strcmp(mode, "native") == 0) {
sentry_options_set_crash_reporting_mode(
options, SENTRY_CRASH_REPORTING_MODE_NATIVE);
} else if (strcmp(mode, "native-with-minidump") == 0) {
sentry_options_set_crash_reporting_mode(
options, SENTRY_CRASH_REPORTING_MODE_NATIVE_WITH_MINIDUMP);
}
}
}

// E2E test mode: generate unique test ID for event correlation
char e2e_test_id[37] = { 0 };
if (has_arg(argc, argv, "e2e-test")) {
sentry_uuid_t test_uuid = sentry_uuid_new_v4();
sentry_uuid_as_string(&test_uuid, e2e_test_id);
}

if (0 != sentry_init(options)) {
return EXIT_FAILURE;
}
Expand All @@ -683,6 +732,14 @@ main(int argc, char **argv)
sentry_value_new_string("my_global_value"), NULL));
}

// E2E test mode: set tags and output test ID for event correlation
if (e2e_test_id[0] != '\0') {
sentry_set_tag("test.id", e2e_test_id);
sentry_set_tag("test.suite", "e2e");
printf("TEST_ID:%s\n", e2e_test_id);
fflush(stdout);
}

if (has_arg(argc, argv, "log-attributes")) {
sentry_value_t attributes = sentry_value_new_object();
sentry_value_t attr = sentry_value_new_attribute(
Expand Down
Loading
Loading