31 Commits

Author SHA1 Message Date
Arpad Borsos 079993ac26 fix: Update crashpad and suppress C5105 (#428)
This warning was newly introduced in VS 16.8, but breaks with the
Windows SDKs own `winbase.h` header. We will just suppress it for now.
2020-11-20 14:29:59 +01:00
Arpad Borsos dfc96e3fcb fix: Retain run folder on shutdown (#422) 2020-11-10 15:28:41 +01:00
Arpad Borsos 291825df4a fix: Append breadcrumbs in binary mode (#395) 2020-10-09 11:35:29 +02:00
Arpad Borsos 2fed9755d3 docs: Better document the database-path requirements (#356) 2020-08-19 18:28:31 +02:00
Arpad Borsos b1debcb178 fix: Initialize curl in the correct order and update public API (#341) 2020-07-21 17:18:01 +02:00
Arpad Borsos 6d1e0478ec feat: Stabilize sessions and enable by default (#336) 2020-07-15 16:25:14 +02:00
Arpad Borsos 62c9810094 fix: Avoid assertion when hitting shutdown_timeout (#323)
This reworks the task locking and background worker shutdown logic.
Tasks are now refcounted so they can be executed concurrently while another thread removes them from the queue. In case the background worker can’t be cleanly shut down (due to slow network), the task queue is being dumped, but the background worker itself is not freed from the main thread, to avoid potential use-after-free bugs.
Also, the background worker itself is refcounted and owns its state.

The transport state is now owned by the background worker, and passed explicitly to the task send function. The task state itself was removed in favor of providing the envelope directly.
2020-07-09 12:58:22 +02:00
Arpad Borsos 577c9f49f9 test: Add more testcases for previously untested code (#317)
# Tests added:

* Object cloning and overwriting keys.
* Serializing more msgpack values.
* Forcing captured events to have a uuid event_id.
* JSON escapes and surrogate parsing, also fixing a bug for that.
* Discarding events when missing consent.
* Test and fix recording errors on current session.
* Sessions with username did.
* Lots of abnormal sessions on startup.

# Bugs fixed:

* Wrong JSON decoding with surrogate pairs.
* Memory Leak parsing unmatched surrogate pairs.
* Never recorded error counts on sessions.
2020-07-06 19:43:54 +02:00
Arpad Borsos 4adf9c3846 ci: Run analysis using CodeChecker and fix identified issues (#304) 2020-07-06 13:57:09 +02:00
Arpad Borsos e00a0bbd31 ref: Remove name parameter from sentry_options_add_attachment (#330) 2020-07-03 15:53:13 +02:00
Arpad Borsos b85641b084 fix: Run through clang-analyzer and fail on warnings (#277)
* correct some issues found by clang-analyzer (dead stores, one of them a bug in the page allocator)
* fix other warnings on clang
* turn of warnings-as-errors on CI for clang and msvc
2020-06-10 18:01:53 +02:00
Arpad Borsos c6dd1f97bb feat: Symbolize Stacktraces in-process (#261) 2020-05-28 23:11:49 +02:00
Arpad Borsos f52bf3a752 ref: Make transport opaque (#256) 2020-05-13 15:01:39 +02:00
Arpad Borsos 001b2d42b7 fix: Correctly handle unicode in windows paths (#252) 2020-05-12 17:32:50 +02:00
Arpad Borsos 029594607d release: 0.2.5 2020-04-27 16:46:36 +02:00
Arpad Borsos 2368456042 fix: Send sessions as envelopes to the correct endpoint (#241) 2020-04-23 11:07:24 +02:00
Arpad Borsos 6a6e42fcd8 fix(init): Correctly lock run directories (#209)
fixes #220
fixes #223
2020-04-06 22:59:39 +02:00
Arpad Borsos 0edaef639c feat: Dump in-flight requests in case of a crash (#191)
The inproc and breakpad backends will invoke the default transports dump method,
that method will first check that it is actually the transport responsible,
and will then dump all the envelopes in matching tasks.
The bg worker is changed in a way that it only pops tasks *after* they are completed.
That way, in case of a race, we end up with duplicate events rather than dropped events.
2020-03-25 09:33:25 +01:00
Arpad Borsos 2dd17da61c fix: Avoid some compile warnings (#186) 2020-03-19 13:16:30 +01:00
Arpad Borsos f4612e26a2 ci: Run CI on a wider range of compiler versions (#176) 2020-03-12 15:17:19 +01:00
Arpad Borsos 099ce5d0a0 feat: Create a Breakpad Backend (#169) 2020-03-12 12:25:17 +01:00
Arpad Borsos 99c1159a1a tests: Refactor tests and fix minor issues (#166)
* tests: Move integration tests to use the example

fixes #138 (proper json serialization of unicode)

* move staticlib test from azure to pytest

* integration requirements was moved

* make ldd test properly run in python

* use an explicit values key for threads
2020-03-10 16:23:14 +01:00
Arpad Borsos 82760c5172 feat: Set some options based on ENV (#154) 2020-02-28 09:11:43 +01:00
Arpad Borsos e4bed02184 feat: Add Crashpad Integration (#147)
* feat: Build Crashpad via a CMake submodule

* feat: Integrate the Crashpad Client

* get crashpad handler working

* build handler with tests

* integrate msgpack, and finish crashpad backend

* add path handling methods for windows

* make crashpad work on windows

* add options when applying scope to event, avoid redundant callbacks,
and correctly add breadcrumbs in non-crashpad mode as well.

* use a different msgpack library and vendor it

* rm gitattributes; windows should use native line endings

* update crashpad submodule

* review feedback and leak fixes

* clean up current_exe and path_dir handling, add a test
* fix some leaks in the crashpad backend and
  around raw envelopes and breadcrumbs

* correctly clone in path_dir on windows as well

* move handler path handling into crashpad backend
2020-02-24 13:46:50 +01:00
Arpad Borsos 32cff04b1a feat(transport): Implement a disk transport (#126)
* feat: implement a disk transport

… and enforce it inside the signal handler to write crashes to disk

* rename sentry__string_dup method per review

* introduce an internal MUST_USE macro
2020-01-20 15:22:59 +01:00