Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upstream sentry-native (does not update crashpad and breakpad refs) #15

Merged
merged 56 commits into from
Dec 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
679b86b
feat: Add support for Qt 6 (#509)
torarnv Apr 9, 2021
43c8d9d
fix: Windows SDK Compiler Warning (#511)
Swatinem Apr 9, 2021
babae96
fix: Validate tm put into strftime (#510)
Swatinem Apr 9, 2021
03ebec7
fix: Rewrite the Linux module finder (#431)
Swatinem Apr 9, 2021
1198758
build: Avoid building all targets (#512)
Swatinem Apr 9, 2021
5fcb1dc
fix: Update Crashpad to 2021-04-12 and fix macOS universal build (#513)
encounter Apr 12, 2021
6f54c67
feat: Invoke before_send hook when using Crashpad (#519)
Swatinem Apr 19, 2021
60afb29
feat: Add more Event Payload convenience methods (#517)
Swatinem Apr 19, 2021
3c7f5b2
feat: Introduce `sentry_close` (#518)
Swatinem Apr 19, 2021
7d6f29f
meta: Prepare Changelog for upcoming release (#522)
Swatinem Apr 20, 2021
c041386
ref: Pass options to scope apply directly (#521)
Swatinem Apr 20, 2021
1d62fc5
fix: Further clean up platform libraries for static linking (#523)
Swatinem Apr 20, 2021
b8c8792
fix: Better macOS availability checks (#524)
Swatinem Apr 21, 2021
b3f2b6d
release: 0.4.9
Apr 21, 2021
06d4360
Merge release/0.4.9 into master
getsentry-bot Apr 21, 2021
756243a
fix: Avoid double-free on invalid DSN (#527)
Swatinem Apr 26, 2021
3fdaa5d
meta: Use correct libunwindstack commit
Swatinem May 3, 2021
f2ed3ac
fix: Allow for Unity builds (#536)
bschatt May 18, 2021
d45871c
ref: Add more testcases that trigger crashes in various ways (#538)
Swatinem May 20, 2021
b16af1c
ref(craft): Modernize Craft config (#543)
BYK Jun 4, 2021
09c3a9e
fix: Update venv and test-discovery Makefile targets (#544)
Jun 15, 2021
ed7f98f
fix: Avoid recursion when using `sentry_reinstall_backend` (#548)
Swatinem Jun 18, 2021
c2fe4b0
fix: Address -Wundef warning for SENTRY_UNITTEST defines (#549)
janisozaur Jun 19, 2021
415621e
build: Set 32-bit option for compiling assembly as well (#550)
janisozaur Jun 19, 2021
c2bddac
meta: Update break/crashpad to 2021-06-14 (#552)
Swatinem Jun 22, 2021
0391fb0
fix: Shorten/Split Locked sections to avoid deadlock (#551)
Swatinem Jun 22, 2021
91bd5ec
fix: Tighten Stack Usage (#553)
Swatinem Jun 23, 2021
fa31ff7
meta: Update Changelog (#556)
Swatinem Jun 24, 2021
2e98ec1
release: 0.4.10
getsentry-bot Jun 24, 2021
bf2d934
reformat
Swatinem Jun 24, 2021
61693db
Merge branch 'release/0.4.10'
Jun 24, 2021
959b81e
fix: Make Linux modulefinder/unwinder safer (#559)
Swatinem Jun 29, 2021
05db566
docs: Try to better explain unwind API (#564)
Swatinem Jun 30, 2021
c3b7b07
fix: Make Crashpad Backend respect max_breadcrumbs setting (#566)
Swatinem Jul 1, 2021
ad2e142
fix: Cancel slow winhttp requests on shutdown (#570)
Swatinem Jul 6, 2021
5648480
fix: Properly close the background worker thread on timeout (#571)
Swatinem Jul 6, 2021
b35eb96
fix: Possible race conditions in init/close and sessions (#545)
Jul 6, 2021
8b9a43d
meta: Draft Changelog (#572)
Swatinem Jul 7, 2021
5afac54
release: 0.4.11
getsentry-bot Jul 7, 2021
c4bc734
Merge branch 'release/0.4.11'
Jul 7, 2021
290fa46
feat: Make shutdown timeout customizable (#577)
andrei-mu Jul 15, 2021
c882275
CMake: Link to the CURL::libcurl target when available (#579)
past-due Jul 20, 2021
c3d490f
meta: Update crashpad to 2021-07-14 (#580)
past-due Jul 20, 2021
46a16b4
fix: Properly use `SENTRY_BUILD_RUNTIMESTATIC` for `sentry_fuzz_json`…
rpadaki Jul 30, 2021
f90f594
meta: Update break/crashpad to 2021-07-28 (#584)
Swatinem Aug 3, 2021
3436a29
release: 0.4.12
getsentry-bot Aug 3, 2021
5218603
Merge branch 'release/0.4.12'
Aug 3, 2021
90966cc
fix: Increment CXX standard to 14 to allow crashpad build (#585)
mjvankampen Aug 24, 2021
04c7a76
meta: Bump python dependencies (#600)
Oct 15, 2021
179ee2b
fix: Ensure that a valid DSN has a public_key (#598)
Swatinem Oct 15, 2021
779da12
feat: AIX support (#593)
NattyNarwhal Oct 21, 2021
491ea58
CMake: Check whether libcurl was already found (#602)
ladislavmacoun Oct 22, 2021
6641475
CMake: fix `SENTRY_BACKEND` defined in outer scope (#603)
Mixaill Oct 28, 2021
0e17d7c
CMake: add ability to set solution folder name (#604)
Mixaill Oct 28, 2021
f86afdd
[pull] master from getsentry:master (#14)
pull[bot] Dec 24, 2021
089f19d
Merge branch 'master' into nluz-upstreamupdate
nunomluz Dec 24, 2021
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
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,31 @@
# Changelog

## 0.4.13

**Features**

- Add client-side stackwalking on Linux, Windows, and macOS (disabled by default).
- CMake: add ability to set solution folder name.
- Add AIX support.

**Fixes**

- CMake: check whether libcurl was already found.
- Increment CXX standard version to 14 to allow crashpad to build.

**Internal**:

- Update Crashpad and Breakpad submodules to 2021-12-03.

**Thank you**:

Features, fixes and improvements in this release have been contributed by:

- [@Mixaill](https://github.com/Mixaill)
- [@ladislavmacoun](https://github.com/ladislavmacoun)
- [@NattyNarwhal](https://github.com/NattyNarwhal)
- [@mjvankampen](https://github.com/mjvankampen)

## 0.4.12

**Features**:
Expand Down
51 changes: 47 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ set(CMAKE_INSTALL_CMAKEDIR "${CMAKE_INSTALL_LIBDIR}/cmake/sentry")

if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(LINUX TRUE)
elseif(CMAKE_SYSTEM_NAME STREQUAL "AIX" OR CMAKE_SYSTEM_NAME STREQUAL "OS400")
set(AIX TRUE)
endif()

#setup sentry library type
Expand Down Expand Up @@ -93,7 +95,7 @@ endif()

if(WIN32)
set(SENTRY_DEFAULT_TRANSPORT "winhttp")
elseif((APPLE AND NOT IOS) OR LINUX)
elseif((APPLE AND NOT IOS) OR LINUX OR AIX)
set(SENTRY_DEFAULT_TRANSPORT "curl")
else()
set(SENTRY_DEFAULT_TRANSPORT "none")
Expand Down Expand Up @@ -137,8 +139,10 @@ else()
set(SENTRY_DEFAULT_BACKEND "inproc")
endif()

set(SENTRY_BACKEND ${SENTRY_DEFAULT_BACKEND} CACHE STRING
"The sentry backend responsible for reporting crashes, can be either 'none', 'inproc', 'breakpad' or 'crashpad'.")
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'.")
endif()

if(SENTRY_BACKEND STREQUAL "crashpad")
set(SENTRY_BACKEND_CRASHPAD TRUE)
Expand Down Expand Up @@ -236,6 +240,10 @@ endif()

set_target_properties(sentry PROPERTIES PUBLIC_HEADER "include/sentry.h")

if(DEFINED SENTRY_FOLDER)
set_target_properties(sentry PROPERTIES FOLDER ${SENTRY_FOLDER})
endif()

# check size type
include(CheckTypeSize)
check_type_size("long" CMAKE_SIZEOF_LONG)
Expand All @@ -257,8 +265,20 @@ else()
endif()
target_compile_definitions(sentry PRIVATE SIZEOF_LONG=${CMAKE_SIZEOF_LONG})

# AIX needs libm for isnan used in test suite
if(CMAKE_SYSTEM_NAME STREQUAL "AIX" OR CMAKE_SYSTEM_NAME STREQUAL "OS400")
target_link_libraries(sentry PRIVATE m)
endif()
# On IBM i PASE, flock is in libutil. Here because "sentry" exists now.
if(CMAKE_SYSTEM_NAME STREQUAL "OS400")
target_link_libraries(sentry PRIVATE util)
endif()

if(SENTRY_TRANSPORT_CURL)
find_package(CURL REQUIRED)
if(NOT CURL_FOUND) # Some other lib might bring libcurl already
find_package(CURL REQUIRED)
endif()

if(TARGET CURL::libcurl) # Only available in cmake 3.12+
target_link_libraries(sentry PRIVATE CURL::libcurl)
else()
Expand Down Expand Up @@ -434,6 +454,20 @@ if(SENTRY_BACKEND_CRASHPAD)
set_property(TARGET mini_chromium PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
endif()

if(DEFINED SENTRY_FOLDER)
set_target_properties(crashpad_client PROPERTIES FOLDER ${SENTRY_FOLDER})
set_target_properties(crashpad_compat PROPERTIES FOLDER ${SENTRY_FOLDER})
set_target_properties(crashpad_getopt PROPERTIES FOLDER ${SENTRY_FOLDER})
set_target_properties(crashpad_handler PROPERTIES FOLDER ${SENTRY_FOLDER})
set_target_properties(crashpad_handler_lib PROPERTIES FOLDER ${SENTRY_FOLDER})
set_target_properties(crashpad_minidump PROPERTIES FOLDER ${SENTRY_FOLDER})
set_target_properties(crashpad_snapshot PROPERTIES FOLDER ${SENTRY_FOLDER})
set_target_properties(crashpad_tools PROPERTIES FOLDER ${SENTRY_FOLDER})
set_target_properties(crashpad_util PROPERTIES FOLDER ${SENTRY_FOLDER})
set_target_properties(crashpad_zlib PROPERTIES FOLDER ${SENTRY_FOLDER})
set_target_properties(mini_chromium PROPERTIES FOLDER ${SENTRY_FOLDER})
endif()

target_link_libraries(sentry PRIVATE
$<BUILD_INTERFACE:crashpad::client>
$<INSTALL_INTERFACE:sentry_crashpad::client>
Expand Down Expand Up @@ -462,6 +496,11 @@ elseif(SENTRY_BACKEND_BREAKPAD)
target_link_libraries(sentry PRIVATE
breakpad_client
)

if(DEFINED SENTRY_FOLDER)
set_target_properties(breakpad_client PROPERTIES FOLDER ${SENTRY_FOLDER})
endif()

if(NOT SENTRY_BUILD_SHARED_LIBS)
sentry_install(TARGETS breakpad_client EXPORT sentry
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
Expand Down Expand Up @@ -538,5 +577,9 @@ if(SENTRY_BUILD_EXAMPLES)
set_property(TARGET sentry_example PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
endif()

if(DEFINED SENTRY_FOLDER)
set_target_properties(sentry_example PROPERTIES FOLDER ${SENTRY_FOLDER})
endif()

add_test(NAME sentry_example COMMAND sentry_example)
endif()
13 changes: 10 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ be done manually.

Creates a python virtualenv, and runs all the tests through `pytest`.

**Running integration-tests manually**:
**Running integration tests manually**:

$ pytest --verbose --maxfail=1 --capture=no tests/

Expand All @@ -47,13 +47,20 @@ can also be invoked directly.
The `maxfail` parameter will abort after the first failure, and `capture=no`
will print the complete compiler output, and test log.

**Running unit-tests manually**:
**Running unit tests**:

$ make test-unit

Unit tests also have a dedicated `make` target, if they need to be run separately
from the integration tests.

**Running unit tests manually**:

$ cmake -B build -D CMAKE_RUNTIME_OUTPUT_DIRECTORY=$(pwd)/build
$ cmake --build build --target sentry_test_unit
$ ./build/sentry_test_unit

The unit-tests are a separate executable target and can be built and run on
The unit tests are a separate executable target and can be built and run on
their own.

## How to interpret CI failures
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ build/sentry_test_unit: build
test: update-test-discovery test-integration
.PHONY: test

test-unit: update-test-discovery build/sentry_test_unit
./build/sentry_test_unit
.PHONY: test-unit

test-integration: setup-venv
.venv/bin/pytest tests --verbose
.PHONY: test-integration
Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ The SDK supports different features on the target platform:
have the `curl` library available. On other platforms, library users need to
implement their own transport, based on the `function transport` API.
- **Crashpad Backend** is currently only supported on Linux, Windows and macOS.
- **Client-side stackwalking** is currently only supported on Linux, Windows, and macOS.

## Building and Installation

Expand Down Expand Up @@ -277,6 +278,15 @@ Legend:
- ✓ supported
- unsupported

- `SENTRY_FOLDER` (Default: not defined):
Sets the sentry-native projects folder name for generators which support project hierarchy (like Microsoft Visual Studio).
To use this feature you need to enable hierarchy via [`USE_FOLDERS` property](https://cmake.org/cmake/help/latest/prop_gbl/USE_FOLDERS.html)

- `CRASHPAD_ENABLE_STACKTRACE` (Default: OFF):
This enables client-side stackwalking when using the crashpad backend. Stack unwinding will happen on the client's machine
and the result will be submitted to Sentry attached to the generated minidump.
Note that this feature is still experimental.

### Build Targets

- `sentry`: This is the main library and the only default build target.
Expand Down
24 changes: 24 additions & 0 deletions examples/example.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,14 @@ has_arg(int argc, char **argv, const char *arg)
return false;
}

#ifdef SENTRY_PLATFORM_AIX
// AIX has a null page mapped to the bottom of memory, which means null derefs
// don't segfault. try dereferencing the top of memory instead; the top nibble
// seems to be unusable.
static void *invalid_mem = (void *)0xFFFFFFFFFFFFFF9B; // -100 for memset
#else
static void *invalid_mem = (void *)1;
#endif

static void
trigger_crash()
Expand Down Expand Up @@ -86,6 +93,10 @@ main(int argc, char **argv)
options, sentry_transport_new(print_envelope));
}

if (has_arg(argc, argv, "capture-transaction")) {
sentry_options_set_traces_sample_rate(options, 1.0);
}

sentry_init(options);

if (!has_arg(argc, argv, "no-setup")) {
Expand Down Expand Up @@ -201,6 +212,19 @@ main(int argc, char **argv)
sentry_capture_event(event);
}

if (has_arg(argc, argv, "capture-transaction")) {
sentry_value_t tx_ctx
= sentry_value_new_transaction_context("I'm a little teapot",
"Short and stout here is my handle and here is my spout");

if (has_arg(argc, argv, "unsample-tx")) {
sentry_transaction_context_set_sampled(tx_ctx, 0);
}

sentry_value_t tx = sentry_transaction_start(tx_ctx);
sentry_transaction_finish(tx);
}

// make sure everything flushes
sentry_close();

Expand Down
Loading