Giter Site home page Giter Site logo

getsentry / sentry-native Goto Github PK

View Code? Open in Web Editor NEW
365.0 56.0 157.0 3.16 MB

Sentry SDK for C, C++ and native applications.

License: MIT License

C++ 4.18% C 80.23% Shell 0.22% Python 10.24% Makefile 0.31% CMake 3.72% NASL 0.42% PowerShell 0.69%
breakpad crashpad crash-reporting hacktoberfest tag-production

sentry-native's Introduction

Conan Center nixpkgs unstable vcpkg

Sentry

Official Sentry SDK for C/C++

The Sentry Native SDK is an error and crash reporting client for native applications, optimized for C and C++. Sentry allows to add tags, breadcrumbs and arbitrary custom context to enrich error reports. Supports Sentry 20.6.0 and later.

Note

Using the sentry-native SDK in a standalone use case is currently an experimental feature. The SDK’s primary function is to fuel our other SDKs, like sentry-java or sentry-unreal. Support from our side is best effort and we do what we can to respond to issues in a timely fashion, but please understand if we won’t be able to address your issues or feature suggestions.

Resources

Table of Contents

Downloads

The SDK can be downloaded from the Releases page, which also lists the changelog of every version.

What is Inside

The SDK bundle contains the following folders:

  • external: These are external projects which are consumed via git submodules.
  • include: Contains the Sentry header file. Set the include path to this directory or copy the header file to your source tree so that it is available during the build.
  • src: Sources of the Sentry SDK required for building.

Platform and Feature Support

The SDK currently supports and is tested on the following OS/Compiler variations:

  • 64bit Linux with GCC 9
  • 64bit Linux with clang 9
  • 32bit Linux with GCC 7 (cross compiled from 64bit host)
  • 32bit Windows with MSVC 2019
  • 64bit Windows with MSVC 2022
  • macOS Catalina with most recent Compiler toolchain
  • Android API29 built by NDK21 toolchain
  • Android API16 built by NDK19 toolchain

Additionally, the SDK should support the following platforms, although they are not automatically tested, so breakage may occur:

  • Windows Versions lower than Windows 10 / Windows Server 2016
  • Windows builds with the MSYS2 + MinGW + Clang toolchain

The SDK supports different features on the target platform:

  • HTTP Transport is currently only supported on Windows and platforms that 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

The SDK is developed and shipped as a CMake project. CMake will pick an appropriate compiler and buildsystem toolchain automatically per platform, and can also be configured for cross-compilation. System-wide installation of the resulting sentry library is also possible via CMake.

Building the Crashpad Backend requires a C++14 compatible compiler.

Build example:

# configure the cmake build into the `build` directory, with crashpad (on macOS)
$ cmake -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo
# build the project
$ cmake --build build --parallel
# install the resulting artifacts into a specific prefix (use the correct config on windows)
$ cmake --install build --prefix install --config RelWithDebInfo
# which will result in the following (on macOS):
$ exa --tree install
install
├── bin
│  └── crashpad_handler
├── include
│  └── sentry.h
└── lib
   ├── cmake
   │  └── sentry
   ├── libsentry.dylib
   └── libsentry.dylib.dSYM

Please refer to the CMake Manual for more details.

Android:

The CMake project can also be configured to correctly work with the Android NDK, see the dedicated CMake Guide for details on how to integrate it with gradle or use it on the command line.

MinGW:

64-bits is the only platform supported for now. LLVM + Clang are mandatory here : they are required to generate .pdb files, used by Crashpad for the report generation.

For your application to generate the appropriate .pdb output, you need to activate CodeView file format generation on your application target. To do so, update your own CMakeLists.txt with something like target_compile_options(${yourApplicationTarget} PRIVATE -gcodeview).

If you use a MSYS2 environement to compile with MinGW, make sure to :

  • Create an environement variable MINGW_ROOT (ex : C:/msys64/mingw64)
  • Run from mingw64.exe : pacman -S --needed - < ./toolchains/msys2-mingw64-pkglist.txt
  • Build as :
# Configure with Ninja as generator and use the MSYS2 toolchain file
$ cmake -GNinja -Bbuild -H. -DCMAKE_TOOLCHAIN_FILE=toolchains/msys2.cmake
# build with Ninja
$ ninja -C build

MacOS:

Building universal binaries/libraries is possible out of the box when using the CMAKE_OSX_ARCHITECTURES define, both with the Xcode generator as well as the default generator:

# using xcode generator:
$ cmake -B xcodebuild -GXcode -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64"
$ xcodebuild build -project xcodebuild/Sentry-Native.xcodeproj
$ lipo -info xcodebuild/Debug/libsentry.dylib
Architectures in the fat file: xcodebuild/Debug/libsentry.dylib are: x86_64 arm64

# using default generator:
$ cmake -B defaultbuild -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64"
$ cmake --build defaultbuild --parallel
$ lipo -info defaultbuild/libsentry.dylib
Architectures in the fat file: defaultbuild/libsentry.dylib are: x86_64 arm64

Make sure that MacOSX SDK 11 or later is used. It is possible that this requires manually overriding the SDKROOT:

$ export SDKROOT=$(xcrun --sdk macosx --show-sdk-path)

Compile-Time Options

The following options can be set when running the cmake generator, for example using cmake -D BUILD_SHARED_LIBS=OFF ...

  • SENTRY_BUILD_SHARED_LIBS (Default: ON): By default, sentry is built as a shared library. Setting this option to OFF will build sentry as a static library instead. If sentry is used as a subdirectory of another project, the value BUILD_SHARED_LIBS will be inherited by default.

    When using sentry as a static library, make sure to #define SENTRY_BUILD_STATIC 1 before including the sentry header.

  • SENTRY_PIC (Default: ON): By default, sentry is built as a position independent library.

  • SENTRY_EXPORT_SYMBOLS (Default: ON): By default, sentry exposes all symbols in the dynamic symbol table. You might want to disable it in case the program intends to dlopen third-party shared libraries and avoid symbol collisions.

  • SENTRY_BUILD_RUNTIMESTATIC (Default: OFF): Enables linking with the static MSVC runtime. Has no effect if the compiler is not MSVC.

  • SENTRY_LINK_PTHREAD (Default: ON): Links platform threads library like pthread on unix targets.

  • SENTRY_BUILD_FORCE32 (Default: OFF): Forces cross-compilation from 64-bit host to 32-bit target. Only has an effect on Linux.

  • CMAKE_SYSTEM_VERSION (Default: depending on Windows SDK version): Sets up a minimal version of Windows where sentry-native can be guaranteed to run. Possible values:

    • 5.1 (Windows XP)
    • 5.2 (Windows XP 64-bit / Server 2003 / Server 2003 R2)
    • 6.0 (Windows Vista / Server 2008)
    • 6.1 (Windows 7 / Server 2008 R2)
    • 6.2 (Windows 8.0 / Server 2012)
    • 6.3 (Windows 8.1 / Server 2012 R2)
    • 10 (Windows 10 / Server 2016 / Server 2019)

    For Windows versions below than 6.0 it is also necessary to use XP toolchain in case of MSVC compiler (pass -T v141_xp to CMake command line).

  • SENTRY_TRANSPORT (Default: depending on platform): Sentry can use different http libraries to send reports to the server.

    • curl: This uses the curl library for HTTP handling. This requires that the development version of the package is available.
    • winhttp: This uses the winhttp system library, is only supported on Windows and is the default there.
    • none: Do not build any http transport. This should be used if users want to handle uploads themselves
  • SENTRY_BACKEND (Default: depending on platform): Sentry can use different backends depending on platform.

    • crashpad: This uses the out-of-process crashpad handler. It is currently only supported on Desktop OSs, and used as the default on Windows, Linux and macOS.
    • breakpad: This uses the in-process breakpad handler. It is currently only supported on Desktop OSs.
    • inproc: A small in-process handler which is supported on all platforms, and is used as default on Android.
    • none: This builds sentry-native without a backend, so it does not handle crashes at all. It is primarily used for tests.
  • SENTRY_INTEGRATION_QT (Default: OFF): Builds the Qt integration, which turns Qt log messages into breadcrumbs.

  • SENTRY_BREAKPAD_SYSTEM (Default: OFF): This instructs the build system to use system-installed breakpad libraries instead of using the in-tree version.

  • SENTRY_TRANSPORT_COMPRESSION (Default: OFF): Adds Gzip transport compression. Requires zlib.

Feature Windows macOS Linux Android iOS
Transports
- curl (✓)
- winhttp
- none
Backends
- inproc
- crashpad
- breakpad (✓) (✓)
- none

Legend:

  • ☑ default

  • ✓ 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

  • 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.

  • SENTRY_SDK_NAME (Default: sentry.native or sentry.native.android): Sets the SDK name that should be included in the reported events. If you're overriding this, make sure to also define the same value using target_compile_definitions() on your own targets that include sentry.h.

Build Targets

  • sentry: This is the main library and the only default build target.
  • crashpad_handler: When configured with the crashpad backend, this is the out of process crash handler, which will need to be installed along with the projects executable.
  • sentry_test_unit: These are the main unit-tests, which are conveniently built also by the toplevel makefile.
  • sentry_example: This is a small example program highlighting the API, which can be controlled via command-line parameters, and is also used for integration tests.

Runtime Configuration

A minimal working example looks like this. For a more elaborate example see the example.c file which is also used to run sentries integration tests.

sentry_options_t *options = sentry_options_new();
sentry_options_set_dsn(options, "https://YOUR_KEY@oORG_ID.ingest.sentry.io/PROJECT_ID");
sentry_init(options);

// your application code …

sentry_close();

Other important configuration options include:

  • sentry_options_set_database_path: Sentry needs to persist some cache data across application restarts, especially for proper handling of release health sessions. It is recommended to set an explicit absolute path corresponding to the applications cache directory (equivalent to AppData/Local on Windows, and XDG_CACHE_HOME on Linux). Sentry should be given its own directory which is not shared with other application data, as the SDK will enumerate and possibly delete files in that directory. An example might be $XDG_CACHE_HOME/your-app/sentry. When not set explicitly, sentry will create and use the .sentry-native directory inside of the current working directory.
  • sentry_options_set_handler_path: When using the crashpad backend, sentry will look for a crashpad_handler executable in the same directory as the running executable. It is recommended to set this as an explicit absolute path based on the applications install location.
  • sentry_options_set_release: Some features in sentry, including release health, need to have a release version set. This corresponds to the application’s version and needs to be set explicitly. See Releases for more information.

Known Limitations

  • The crashpad backend on macOS currently has no support for notifying the crashing process, and can thus not properly terminate sessions or call the registered before_send or on_crash hook. It will also lose any events that have been queued for sending at time of crash.
  • The Crashpad backend on Windows supports fast-fail crashes, which bypass SEH (Structured Exception Handling) primarily for security reasons. sentry-native registers a WER (Windows Error Reporting) module, which signals the crashpad_handler to send a minidump when a fast-fail crash occurs But since this process bypasses SEH, the application local exception handler is no longer invoked, which also means that for these kinds of crashes, before_send and on_crash will not be invoked before sending the minidump and thus have no effect.

Development

Please see the contribution guide.

sentry-native's People

Contributors

4diekmann avatar aenbleidd avatar amphaal avatar blinkov avatar bruno-garcia avatar cammm avatar cnicolaescu avatar detwiler avatar eakoli avatar getsentry-bot avatar icedtoast avatar jan-auer avatar janisozaur avatar loewenheim avatar m1keall1son avatar madebr avatar markushi avatar martindelille avatar mattjohnsonpint avatar mitsuhiko avatar mixaill avatar ndmanvar avatar past-due avatar relaxolotl avatar stima avatar supervacuus avatar swatinem avatar tonyo avatar torarnv avatar vaind avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sentry-native's Issues

PHP SDK Integration

Hello, i have installed sentry/sdk via:

composer require sentry/sdk:2.1.0

then i have added this line to my project

\Sentry\init([‘dsn’ => ‘https://[email protected]/myprojectnumber’]);

Lastly, i added this line to test sentry

throw new Exception(“TEST sentry.”);

But nothing is happened. PHP side is not working but Javascript side is working well. This is just ruined all of my day and still working on it.

This is how i’m installed & my code block :

https://aws1.discourse-cdn.com/standard10/uploads/sentry/original/2X/8/8fa306b719242dd05eafee01abbe64ca9923a6a3.png

Thanks for helping.
Regards.

Consider per-report Consent Checking

I have some patches I would like to contribute which add basic consent prompt support to Windows with crashpad.

This patchset requires patching crashpad - how do you want me to add that to your build process?

CJK character encoding issue on Windows

I found CJK characters does not handle correctly on Windows.

  • Tested Environment: Windows x64 10.0.19041.21
  • Tested SDK version: Sentry Native 0.1.4
  • Tested IDE: Visual Studio 15.9.19
  • Tested Visual C++ Compiler Version: 19.16.27035

Sample Code:

	std::string str = std::wstring_convert<std::codecvt_utf8<wchar_t>, wchar_t>{}.to_bytes(L"한글 테스트");
	sentry_value_t event = sentry_value_new_event();
	sentry_value_set_by_key(event, "message",
		sentry_value_new_string(str.c_str()));
	sentry_capture_event(event);

Result:
image

I'm suspecting this issue because of the below code.
https://github.com/getsentry/sentry-native/blob/master/src/json.hpp#L117

sentry_set_user() crashes when called after sentry_init()

Important details

  • Saas (sentry.io)
  • mac (10.15)
  • built from release 0.1.2
  • sentry with crashpad backend

Description

Invoking sentry_set_user() before sentry_init() works fine, all following events are tagged with provided user details, but when it's called after sentry_init, it crashes on BAD_ACCESS because of NULL FILE* pointer writer->context in mpack_file_writer_flush.

I don't know whether this is an expected behaviour, but it would be nice if we could change user details after initialization.

sentry_crash_vars
sentry_crash_stack
sentry_crash_code

Sentry-native "Capturing Events" encountered 2 error show up from sentry server

Refer to Capturing Events in Sentry Doc, I send the event to sentry server, and I see 2 error while processing this event.

image

The capture event in sentry server:
image

My example code follow the sentry Doc,
image
No error happened but event still sent out because of using sentry_capture_event

Q1, why does debug_meta.images.0.debug_id and debug_meta.images.2.debug_id said it Missing value for required attribute?
Do I need to set up anything with sentry option in source code?

[Check the usage for capture event]
Q2: After some testing, the exception event looks not going to catch the error automatically, we need to catch every condition manually to sent the event like my thought below right?

[My thought]

sentry_value_t exc = sentry_value_new_object();
sentry_value_set_by_key(exc, "type", sentry_value_new_string("Exception TESTING"));
sentry_value_set_by_key(exc, "value", sentry_value_new_string("Error message TESTING."));

if ( SUCCEED)
{
   return 0;
}else{
   sentry_value_set_by_key(event, "exception", exc);
    sentry_capture_event(event);
}

Implementing a transport in C++

Hi there,

I just started playing with sentry-native (finally !) and got it hooked in a very basic way to a command line tool (building on macOS only for now). I love the simple C api and the new 'inproc' mode ; it would be great if we could use this mode on iOS/Android as it would simplify our life a bit, not having to build breakpad/crashpad. (that's a tangent).

I'd like to be able to HTTP upload the report to sentry using our own library, is there some basic doc on doing so dynamically ?

It looks like all I need is to provide a 'sentry_transport_t' (I'm looking at the curl example)

sentry_transport_t *sentry__new_libcurl_transport(void);
sentry_transport_t *
sentry__new_libcurl_transport(void)
{
    SENTRY_DEBUG("initializing curl transport");
    sentry_transport_t *transport = SENTRY_MAKE(sentry_transport_t);
    if (!transport) {
        return NULL;
    }

    struct transport_state *state = new_transport_state();
    if (!state) {
        sentry_free(transport);
        return NULL;
    }

    transport->data = state;
    transport->free_func = free_transport;
    transport->send_envelope_func = send_envelope;
    transport->startup_func = start_transport;
    transport->shutdown_func = shutdown_transport;

    return transport;
}

That thing is used here, called from sentry_options_new

    opts->transport = sentry__transport_new_default();

Is all we need to do to create a new options, and set override the opts->transport argument ?

Thanks !

Generate mini dump without crashing ?

Can I send a stack trace back without actually crashing the application ? I'd like to gracefully handle some errors but get a stack trace to show why it occurred

linux build using native SDK fails

Hi,

The linux native SDK doesn't seem to build crashpad on some Linux distribution. I'm not sure if
I should report it directly to crashpad but here is the thing.

My environment

  • Docker image ubuntu:bionic (also on debian stable)
  • clang++-6

Step to reproduce

  • Fetch latest ubuntu:bionic Docker image (or on debian stable)
  • make config=release sentry-crashpad
./crashpad/build/crashpad/snapshot/elf/elf_image_reader.cc:270:51: error: invalid use of non-static
      data member 'n_namesz'
  static_assert(sizeof(*type) >= sizeof(NhdrType::n_namesz),

This patch seems ok:

From 74e43a9d6bdf9a0ed55fd762bb688f153c33e149 Mon Sep 17 00:00:00 2001
From: Mouhamad Kebe <[email protected]>
Date: Fri, 15 Nov 2019 11:56:31 +0100
Subject: [PATCH] linux: fix build

---
 crashpad/build/crashpad/snapshot/elf/elf_image_reader.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/crashpad/build/crashpad/snapshot/elf/elf_image_reader.cc b/crashpad/build/crashpad/snapshot/elf/elf_image_reader.cc
index 7f6d7c7..1609c0e 100644
--- a/crashpad/build/crashpad/snapshot/elf/elf_image_reader.cc
+++ b/crashpad/build/crashpad/snapshot/elf/elf_image_reader.cc
@@ -267,11 +267,11 @@ ElfImageReader::NoteReader::Result ElfImageReader::NoteReader::ReadNote(
     NoteType* type,
     std::string* desc,
     VMAddress* desc_address) {
-  static_assert(sizeof(*type) >= sizeof(NhdrType::n_namesz),
+  NhdrType note_info;
+  static_assert(sizeof(*type) >= sizeof(note_info.n_namesz),
                 "Note field size mismatch");
   DCHECK_LT(current_address_, segment_end_address_);
 
-  NhdrType note_info;
   if (!segment_range_->Read(current_address_, sizeof(note_info), &note_info)) {
     return Result::kError;
   }
-- 
2.11.0

Thanks

Can't compile sentry_crashpad 0.1.0 x32 Release

crashpad_util.lib(capture_context_win.obj) : error LNK2026: module unsafe for SAFESEH image.
crashpad_util.lib(safe_terminate_process.obj) : error LNK2026: module unsafe for SAFESEH image.
bin\Release\crashpad_handler.exe : fatal error LNK1281: Unable to generate SAFESEH image.
Done building project "crashpad_handler.vcxproj" -- FAILED.

crashpad_util.lib(capture_context_win.obj) : error LNK2026: module unsafe for SAFESEH image.
crashpad_util.lib(safe_terminate_process.obj) : error LNK2026: module unsafe for SAFESEH image.
Creating library bin\Release\sentry_crashpad.lib and object bin\Release\sentry_crashpad.exp
bin\Release\sentry_crashpad.dll : fatal error LNK1281: Unable to generate SAFESEH image.
Done building project "sentry_crashpad.vcxproj" -- FAILED.

Can you release ready to use Sentry Native SDK precompiled binaries for VS2017?

Crashpad CaptureContex broken

I'm integrating the sentrypad SDK into a Win64 app. While testing different crashing scenarios i'm seeing that in some contexts, when I throw an exception in a thread somewhere I get the message:
"Don't use this! For cross builds only. See https://crbug.com/762167." printed to the console.

I see that this is in an impl of crashpad's CaptureContext in capture_contex_broken.cc which is included in the Sentrypad SDK premake files for windows builds in premake5.crashpad.lua:440

I looked in crashpad and see that there is an assembly impl of that function in the file crashpad/util/misc/capture_context_win.asm, and in crashpad's build system, this is included instead of the _broken version in you are on windows and not on ARM64, (we are not building for arm). crashpad\util\BUILD.gn:390

I tried including the .asm files instead of the _broken.cc files, which now i don't get the message but i just get a crash when CaptureContex is called which ends up with the sentry event containing not-so-useful information in the call stack.

It looks like CaptureContex is only called in certain types of crashes, but i'm not sure what to make of this situation in general. Since the issue is still open, perhaps this is current unresolved issue? I'm not familiar with crashpad to be able to tell.

Have you guys encountered this or have any suggestions? Thanks!

Crash report not associated release

The crash report (minidump) uploaded to sentry (on prem) via crashpad_handler on windows isn't associated with the release, I'm also uploading the "it works" example event inside the program and this is associated with the release.

Privacy concern of sending loaded module information

Continuing the conversation in #65 ...

My situation:
I'm developing and addon/extension/plugin.
My addon is loaded by the application with other addons.
It can be unloaded and reloaded (setup/teardown) for any number of times. (Not the issue, just mentioning)
The SENTRY_SCOPE_MODULES feature sends all the loaded module information and with this the other loaded addons' information too. This might has some problem with GDPR.

Example: A person or company uses an addon which is developed for them and only they have it. It is much easier to identify them if they using the person's / company's name as part of their addon.

Because of the previous conversation I'm kindly suggest contacting the legal department and explaining them the situation.

This module information sending should be an optional feature.

Building using VS 2019 16.3.1 fails

sentry-native\gen_windows\crashpad_zlib.vcxproj defines macro __clang__ and compilation fails with lots of similar errors

1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.23.28105\include\vcruntime_string.h(18,1): error C2059: syntax error: '['

because function declarations in vcruntime_string.h are prefaced by _NODISCARD macro which, for __clang__, is expands to [[nodiscard]]

Building arm Breakpad with sentrypad arm version query

I'm try to build Breakpad with sentrypad for arm target in qemu with Debian buster

[Build fail log]
image

[Add march]
I try to add "march=armv5t" in premake5.sentry.lua, but still the same error
image

Configuration:
Compiler
clang version 7.0.1-8 (tags/RELEASE_701/final)
Target: arm--linux-gnueabi
Thread model: posix
InstalledDir: /usr/bin

Q:
Is there any other config required for arm target ?

Linux build with native SDK and GLIBC 2.27

Hello,

Using the native SDK with GLIBC 2.27 crashpad doesn't seem to build.
I get the following error:

../crashpad/build/crashpad/compat/linux/sys/mman.cc:25:5: error: 'memfd_create' is missing exception specification 'throw()'
6669 int memfd_create(const char* name, unsigned int flags) {
6670     ^
6671                                                        throw()
6672 ../crashpad/build/crashpad/compat/linux/sys/mman.h:32:5: note: previous declaration is here
6673 int memfd_create(const char* name, unsigned int flags);
6674     ^
6675 1 error generated.
6676 make[1]: *** [obj/Release/crashpad_util/mman.o] Error 1

The thing is that there's no memfd_create() wrapper before glibc 2.27 and in "sentry-native/crashpad/build/crashpad/compat/linux/sys/mman.h" it makes the wrapper if GLIBC is defined instead of checking if GLIBC is < 2.27.

Checking if the version is < 2.27 works.

Thanks

Extras, user and release informations not showing up when using Native SDK

Important Details

How are you running Sentry?

  • On-Premise docker [Version xyz]
  • Saas (sentry.io)
  • Other [briefly describe your environment]

Description

We were successful in building the SDK for macOS with the crashpad integration and we have successfully configured it so when it crashes we do see the event in the dashboard.

Crash is generated as followed:

int* a = nullptr;
*a = 1;

However, it seems that we cannot get some information to show on the "event" such as the user, the release and some extras.

Here is how we use it :

sentry_value_t user = sentry_value_new_object();
sentry_value_set_by_key(user, "id", sentry_value_new_int32(123456789));
sentry_value_set_by_key(
    user, "username", sentry_value_new_string("John Doe"));
sentry_set_user(user);
sentry_set_extra(
    "bitrate", sentry_value_new_int32(g_StartupOption.bitrate));
sentry_options_set_release(options, "1.0.0");

However, we did manage to add attachments which are working well.
I hope you'll be able to enlighten us on what we are doing wrong or what we misunderstood.

What you expected to happen

We should see the release in the event as well as user info and all extras.

[VC++2019/CMake] __sentry-breadcrumb1 / __sentry-breadcrumb2 : No such file or directory (2)

Maybe related to #84 ? Many thanks in advance for your help !

Context

I'm trying to trigger a sentry event from a simple exception, to feed my Sentry dockerized environment. My unsecure HTTP Sentry app is based on the "onpremise Sentry" project, as of getsentry/self-hosted@9ec53c3, with no changes to the default configuration files.

I'm using

  • VC++2019 (16.4.1)
  • CMake (3.16.0)
  • sentry-native 0.1.4 from "Releases"
    • using "gen_windows" (linking crashpad_handler.vcxproj + sentry_crashpad.vcxproj)

Issue

After initiating Sentry as of :

auto options = sentry_options_new();
sentry_options_set_dsn(options, SENTRY_ENDPOINT);

QString environement = "Production";
#ifdef _DEBUG
    environement = "Debug";
#endif
sentry_options_set_environment(options, environement.toStdString().c_str());

sentry_options_set_release(options, GITHUB_VERSION_NAME);
sentry_options_set_debug(options, 1);

//crashpad integration
sentry_options_set_handler_path(options, CRASHPAD_HANDLER_NAME);
// auto dbStr = AppContext::getAppDataLocation() + "/sentry_db";
// sentry_options_set_database_path(options, dbStr.toStdString().c_str());

sentry_init(options);

...and triggering the same kind of exception as #84, my program shuts down as expected, but outputs unexpected logs :

[sentry] crash handler enabled (reporting to http://ec083db6fedc4b64b0233ddb1fb9551f:@lvwl.to2x.ovh:9000/1)
[sentry] started client handler.
[sentry] starting background worker
[11964:7372:20191212,034649.005:ERROR file_io_win.cc:161] CreateFile ./.sentry-native\sentry-runs\1576118808-1100518007\__sentry-breadcrumb1: Le fichier spécifié est introuvable. (2)
[11964:7372:20191212,034649.005:ERROR file_io_win.cc:161] CreateFile ./.sentry-native\sentry-runs\1576118808-1100518007\__sentry-breadcrumb2: Le fichier spécifié est introuvable. (2)

About the issue

  • Release and Debug executables produce this behavior
  • sentry_shutdown() cannot be reached after the error, even if I try to :
    • define a call with std::set_terminate callback
    • catch the exception with try-catch, then call it

What happened

  • a valid minidump file is created at .sentry-native\reports, containing expected data
  • 3 files are created at .sentry-native\attachments\xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx
    • __sentry-breadcrumb1, empty 0 Ko file
    • __sentry-breadcrumb2, empty 0 Ko file
    • __sentry-event, containing :
      ‰¨contexts€«environmentªProduction¥extra€¥level¥error¨platform¦native§release­[email protected]£sdkƒ¤name­sentry-native¨packages‘‚¤name¾github:getsentry/sentry-native§version¥0.1.4§version¥0.1.4¤tags€¤userÀ
  • 1 file is created at .sentry-native\sentry-runs\1576118808-1100518007 :
    • __sentry-event, same content as above.
  • my Sentry app also generated 2 events !
    • AttributeError/api/{project_id}/minidump/ - 'WSGIRequest' object has no attribute 'user'
    • UnreadablePostError/api/{project_id}/minidump/ - unable to receive chunked part

image
image

Disable sending reports to dsn, but still generate minidump on client

Crashpad has the ability to disable sending a report to the remote endpoint while still creating the report on the client if the end user opts out of crash reporting. Currently it appears there's no way to achieve this with sentrypad, it's either on or off. It would be lovely if sentrypad could expose a function to enable/disable the report sending by calling the crashpad::Settings::SetUploadsEnabled(bool); in the crashpad backend. It appears that the crashpad_handler also respects this flag and will not process the event.

I'm happy to add this to the interface but I want to check that there are not any side effects this could cause or if it breaks the design of sentrypad?

Report application hangs in addition to crashes

Hello,

we're using sentry crashpad_handler successfully to report application crashes (with minidumps). Now we've realized that there are also some "application hangs" reported in the windows eventlog which are not reported to our sentry instance. Is there a parameter/option to create a minidump on hangs too?

Thanks in advance

Problem building Crashpad with MSVC16 in 32bit mode

Hello,

I was trying to build this project under visual studio 2019 in 32-bit mode. It failed because problematic flags where passed to the assembler:

C:\PROGRA~2\MIB055~1\2019\BUILDT~1\VC\Tools\MSVC\1424~1.283\bin\Hostx64\x86\ml.exe -DCRASHPAD_ZLIB_SOURCE_EMBEDDED -DHAVE_STDARG_H -DNOMINMAX -DUNICODE -DWIN32_LEAN_AND_MEAN -DZLIB_CONST -D_CRT_SECURE_NO_WARNINGS -D_HAS_EXCEPTIONS=0 -D_UNICODE -D_WIN32_WINNT=0x0A00 -IC:\.conan\3c2f69\1\include -IC:\.conan\7dd726\1\include -IC:\.conan\bc8821\1\include -Isentry-native\external\crashpad -Isentry-native\external\crashpad\third_party\mini_chromium\mini_chromium -Isentry-native\external\crashpad\PUBLIC -Isentry-native\external\crashpad\compat\non_mac -Isentry-native\external\crashpad\compat\win -Isentry-native\external\crashpad\compat\non_elf /safeseh   /FS /W4 /WX /Zi /bigobj /wd4100 /wd4127 /wd4324 /wd4351 /wd4577 /wd4996 /wd4201 /wd4996 /wd4131 /wd4244 /wd4245 /wd4267 /wd4324 /wd4702 /c  /Fo external\crashpad\util\CMakeFiles\crashpad_util.dir\misc\capture_context_win.asm.obj sentry-native\external\crashpad\util\misc\capture_context_win.asm
Microsoft (R) Macro Assembler Version 14.24.28316.0
Copyright (C) Microsoft Corporation.  All rights reserved.

MASM : warning A4018:invalid command-line option : /FS
MASM : warning A4018:invalid command-line option : /bigobj
MASM : warning A4018:invalid command-line option : /wd4100
MASM : warning A4018:invalid command-line option : /wd4127
MASM : warning A4018:invalid command-line option : /wd4324
MASM : warning A4018:invalid command-line option : /wd4351
MASM : warning A4018:invalid command-line option : /wd4577
MASM : warning A4018:invalid command-line option : /wd4996
MASM : warning A4018:invalid command-line option : /wd4201
MASM : warning A4018:invalid command-line option : /wd4996
MASM : warning A4018:invalid command-line option : /wd4131
MASM : warning A4018:invalid command-line option : /wd4244
MASM : warning A4018:invalid command-line option : /wd4245
MASM : warning A4018:invalid command-line option : /wd4267
MASM : warning A4018:invalid command-line option : /wd4324
MASM : warning A4018:invalid command-line option : /wd4702
MASM : warning A4008:invalid command-line option value, default is used : /W
 Assembling: sentry-native\external\crashpad\util\misc\capture_context_win.asm

This can be fixed in your crashpad cmakefile.txt by adding a generator expression that only applies the flags to the C++ files: $<$<COMPILE_LANGUAGE:CXX>/wx> for example. Also it should not use target_compile_definitions but rather target_compile_options for those things.

I solved it by removing the /WX flag for now and that made it build.

Thanks for adding a CMake based build system for crashpad - I was already working on that for our applications but now that you have added it I might shift and help you with patches if I have the time.

Crash on OSX at exit

Not the whole application, but just a module uses it.
I call sentry_shutdown when they don't want to use my module.
Clearly remove_image (and add too) is still registered and causes the following crash when the application exits.

  * frame #0: 0x00007fff724622c6 libsystem_kernel.dylib`__pthread_kill + 10
    frame #1: 0x00007fff7251dbf1 libsystem_pthread.dylib`pthread_kill + 284
    frame #2: 0x00007fff723cc6a6 libsystem_c.dylib`abort + 127
    frame #3: 0x00007fff6f5a8641 libc++abi.dylib`abort_message + 231
    frame #4: 0x00007fff6f5a87c7 libc++abi.dylib`default_terminate_handler() + 243
    frame #5: 0x00007fff70b5beeb libobjc.A.dylib`_objc_terminate() + 105
    frame #6: 0x00007fff6f5b419e libc++abi.dylib`std::__terminate(void (*)()) + 8
    frame #7: 0x00007fff6f5b3f86 libc++abi.dylib`__cxxabiv1::failed_throw(__cxxabiv1::__cxa_exception*) + 27
    frame #8: 0x00007fff6f5a6f99 libc++abi.dylib`__cxa_throw + 113
    frame #9: 0x00007fff6f59a0e7 libc++.1.dylib`std::__1::__throw_system_error(int, char const*) + 77
    frame #10: 0x00007fff6f5590d3 libc++.1.dylib`std::__1::recursive_mutex::lock() + 29
    frame #11: 0x000000015302b123 aaa`std::__1::lock_guard<std::__1::recursive_mutex>::lock_guard(this=0x00007ffeeba58838, __m=0x00000001530f5c20) at __mutex_base:104:27
    frame #12: 0x000000015302770d aaa`std::__1::lock_guard<std::__1::recursive_mutex>::lock_guard(this=0x00007ffeeba58838, __m=0x00000001530f5c20) at __mutex_base:104:21
    frame #13: 0x0000000153027774 aaa`remove_image(mh=0x000000013c699000, vmaddr_slide=5308518400) at darwin_modulefinder.cpp:86:43
    frame #14: 0x00000001237ca0d0 dyld`dyld::removeImage(ImageLoader*) + 440
    frame #15: 0x00000001237d6d64 dyld`NSUnLinkModule + 329
    frame #16: 0x00007fff72328523 libdyld.dylib`NSUnLinkModule + 103
    frame #17: 0x000000010c04955f a
    frame #18: 0x00000001237e08c2 dyld`ImageLoaderMachO::doTermination(ImageLoader::LinkContext const&) + 248
    frame #19: 0x00000001237ca811 dyld`dyld::runAllStaticTerminators(void*) + 64
    frame #20: 0x00007fff723cd3cf libsystem_c.dylib`__cxa_finalize_ranges + 319
    frame #21: 0x00007fff723cd6b3 libsystem_c.dylib`exit + 55
    frame #22: 0x00007fff723273dc libdyld.dylib`start + 8

Add ignore SAFESH flags in cmake

When I run cmake the following error occurs:

PS C:\Users\rafagan\Desktop\sentry-native> cmake --build build --parallel
Microsoft (R) Build Engine version 15.5.180.51428 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

getopt.vcxproj -> C:\Users\rafagan\Desktop\sentry-native\build\getopt.lib
zlib.vcxproj -> C:\Users\rafagan\Desktop\sentry-native\build\zlib.lib
mini_chromium.vcxproj -> C:\Users\rafagan\Desktop\sentry-native\build\mini_chromium.lib
crashpad_compat.vcxproj -> C:\Users\rafagan\Desktop\sentry-native\build\crashpad_compat.lib
crashpad_tools.vcxproj -> C:\Users\rafagan\Desktop\sentry-native\build\crashpad_tools.lib
crashpad_util.vcxproj -> C:\Users\rafagan\Desktop\sentry-native\build\crashpad_util.lib
crashpad_client.vcxproj -> C:\Users\rafagan\Desktop\sentry-native\build\crashpad_client.lib
crashpad_snapshot.vcxproj -> C:\Users\rafagan\Desktop\sentry-native\build\crashpad_snapshot.lib
crashpad_minidump.vcxproj -> C:\Users\rafagan\Desktop\sentry-native\build\crashpad_minidump.lib
crashpad_util.lib(capture_context_win.obj) : error LNK2026: module unsafe for SAFESEH image. [C:\Users\rafagan\Desktop
sentry-native\build\external\crashpad\handler\crashpad_handler.vcxproj]
crashpad_util.lib(safe_terminate_process.obj) : error LNK2026: module unsafe for SAFESEH image. [C:\Users\rafagan\Deskt
op\sentry-native\build\external\crashpad\handler\crashpad_handler.vcxproj]
C:\Users\rafagan\Desktop\sentry-native\build\crashpad_handler.exe : fatal error LNK1281: Unable to generate SAFESEH ima
ge. [C:\Users\rafagan\Desktop\sentry-native\build\external\crashpad\handler\crashpad_handler.vcxproj]

Then I added the following lines and the errors had gone:

SET(CMAKE_CXX_FLAGS           "${CMAKE_CXX_FLAGS} /D \"SAFESEH:NO\"")
SET(CMAKE_EXE_LINKER_FLAGS    "${CMAKE_EXE_LINKER_FLAGS} /SAFESEH:NO")
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SAFESEH:NO")
SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /SAFESEH:NO")

Crashpad upload error (linux)

I'm going to use crashpad and sentry in Ubuntu. After building sentrypad a run sentry_example_crashpad and get:
FATAL http_transport_socket.cc:548] Check failed: scheme == “http”. Got https for scheme in ‘https://sentry.io/MY_DSN’.
It looks like crashpad_client was built without define "crashpad_use_boringssl_for_http_transport_socket=true" (i got crashpad_client by running scripts/download.sh crashpad)

Memory leak and status of master

Hello,

I'm on a Linux 64bits Ubuntu and I'have tested the current master.

As far as I can tell there are some memory leak in this branch.

For exemple the new created object in worker at line 85 is never deleted.
Looking at the code it seem it need some reworking to be cleaner.

I just came accross the branch feature/c-ver which seem more active than the master.

Is this branch the successor of the master branch?
What is the state of this branch and will it work on Ubuntu?
Should I prefer to use this new branch instead?

Regards

Breakpad support?

I see the Breakpad backend had been removed and is being bring back.

  1. Why had it been removed?
  2. What's missing in branch breakpad-backend to be merged in master? How can I help?

New Build Setup

We want to produce for now the following matrix:

  • Platforms
    • Linux (gmake2)
    • Mac (gmake2)
    • Windows (vs2017)
  • Backends
    • None
    • Breakpad (WITH_SENTRY_BREAKPAD_BACKEND)
    • Crashpad (WITH_SENTRY_CRASHPAD_BACKEND)
  • Variations
    • Gold
    • Test (WITH_SENTRY_TESTS) + tests/**.cpp

And have a make test command toplevel that runs all tests locally for linux or mac and figure out something for windows later.

All the outputs are going to be dylibs only for now.

No gen_* folder in version 0.1.1 and 0.1.2

Versions 0.1.1 and 0.1.2 does not contain any gen_* folder. I want to run test trial for Windows native application. Please let us know how these files can be generated.

Curl not found on Windows

When I try building in Windows with Visual Studio 16 2019 the following error occurs:

$ cmake -B build -DSENTRY_BACKEND=crashpad
-- Building for: Visual Studio 16 2019
-- Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.18363.
-- The C compiler identification is MSVC 19.24.28319.0
-- The CXX compiler identification is MSVC 19.24.28319.0
-- The ASM compiler identification is MSVC
-- Found assembler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/VC/Tools/MSVC/14.24.28314/bin/Hostx64/x64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/VC/Tools/MSVC/14.24.28314/bin/Hostx64/x64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/VC/Tools/MSVC/14.24.28314/bin/Hostx64/x64/cl.exe - works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/VC/Tools/MSVC/14.24.28314/bin/Hostx64/x64/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/VC/Tools/MSVC/14.24.28314/bin/Hostx64/x64/cl.exe - works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at C:/Program Files/CMake/share/cmake-3.17/Modules/FindPackageHandleStandardArgs.cmake:164 (message):
Could NOT find CURL (missing: CURL_LIBRARY CURL_INCLUDE_DIR)
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.17/Modules/FindPackageHandleStandardArgs.cmake:445 (_FPHSA_FAILURE_MESSAGE)
C:/Program Files/CMake/share/cmake-3.17/Modules/FindCURL.cmake:169 (find_package_handle_standard_args)
CMakeLists.txt:146 (find_package)

How can I solve that?

Windows C++ Project Building

Hi - was hoping to build a test project for C++ / Windows...
However, the steps to follow for configuring sentrypad (and it's dependencies) all seem to be missing from this repo.
For example: I found I first had to install the Ubuntu tool for Windows, and use it to configure the project with premise (having first downloaded and build premake5).
The next question I faced, is that it looks necessary to first to build Crashpad or Breakpad - or both (!) - which is recommended / required?
Basically: it looks like there is a lot of missing info required to actually get going - it'd make sense to me if sentrypad came pre-built and "Ready To Go" for Windows (and macOS etc.).
I hope this feedback helps...

minidump report doesn't work with uploaded sym file to render proper information

I upload the minidumps to sentry server, but it show <unknown> for the function name with the minidump report,
I know it need symbol file, how do I get the symbol file ?
Or I just need to upload the binary and library which are build with "-g" option?

The server remind me that missing 2 files, how do I upload the required file ?
There were 2 errors encountered while processing this event
use curl -x POST with any option ?

image

Provide Breakpad and inproc backends for Windows

Hi!

My remaining problem now is that I'm not seeing any crashes reported in the Browser.

NB I'm provoking a crash in response to a menu item within the app, which calls this code:

      // Force crash report for sentry.io
      int* crashPtr = nullptr;
      *std::launder(crashPtr) = 0;

The app does indeed crash as expected, but for the avoidance of doubt, I see no report about this on the sentry.io website.

I've enabled this line as requested:
sentry_options_set_debug(options, 1);

NB I don't know if this is relevant, but I've noticed that, whether or not I crash the app, or have the sentry_options_set_debug call, I'm no longer seeing anything reported on the sentry.io site sent from sentry_capture_event(...) ... unless I modify the "message" parameter in the call below.
In otherwords, only the first call is reported on the site. Subsequent calls aren't reported on the site.

sentry_capture_event(sentry_value_new_message_event(
/* level / SENTRY_LEVEL_INFO,
/
logger / "custom",
/
message */ "Prepare to crash..."
));

Hopefully you see something useful on the server! :)

Best wishes,

Pete

Crash report is not sending to sentry server

  1. With default sentry_crashpad example binary
    In x86 ubuntu, I build and run the example_crashpad with http DSN, I can see it send the report to my sentry server.

  2. I unmark the crash source code ,build it and run it with my http DSN, my sentry server doesn't get the report

I saw it POST something by using wireshark but it is showing bad request 401
image

Do I miss anything ?
Does sentry-native support sending the crash report to sentry server now ?
or user should use curl to POST minidump report in sentry-db ?

Windows 10 Store App - C++ - how to configure project to use Sentry crash reporting?

Hi!

Now that you've just released updated the Native / C++ version (thanks!), I've been able to download it, install Make for Windows 10, and start trying to integrate with one of my C++ projects for Windows 10.

  1. I've run cmake like this (please note that it wasn't clear that this is how it needs to be run for Windows 10 native - I hope it is correct!)

cmake . -DBUILD_SHARED_LIBS=OFF

  1. I've updated my C++ project to include calls as per your documentation (note use of extern "C", which I presume is correct):

extern "C" {
#include <sentry.h>
}

int main(void) {
...
sentry_options_t *options = sentry_options_new();
sentry_options_set_dsn(options, "https://blah/blah");
sentry_init(options);

/* ... */

// make sure everything flushes
sentry_shutdown();
}

  1. I've updated my project to import the same .lib files that your test project (sentry_example) uses, including sentry.lib (and all the other ones).

  2. However, I'm getting this:

1>Main.obj : error LNK2001: unresolved external symbol __imp_sentry_value_new_message_event
1>Main.obj : error LNK2001: unresolved external symbol __imp_sentry_init
1>Main.obj : error LNK2001: unresolved external symbol __imp_sentry_shutdown
1>Main.obj : error LNK2001: unresolved external symbol __imp_sentry_options_set_dsn
1>Main.obj : error LNK2001: unresolved external symbol __imp_sentry_capture_event
1>Main.obj : error LNK2001: unresolved external symbol __imp_sentry_options_new
1>C:...blah...\myapp.exe : fatal error LNK1120: 6 unresolved externals

Can you please advise?

Pete

Compile as static library ?

There is no way to integrate this as static lib ? I compiled with /MT as well (with VS) but my application still asks for sentry.dll.

This is very inconvenient, especially due to the nature of my software.

A solution would be appreciated.

Side notes:

  • Why is the code so ugly ?! I mean... it's awful. I`m not expecting it to be perfect, but it looks like it was written in a rush...
  • Why is there so much C and C++ combined ?...
  • Too many strings in plain, for security apps this is a risk and concern...
  • Plenty more to say really...

Anyway, a solution to build as static lib is appreciated at this point; the rest... no further comments.

Thanks

crashpad_handler not sending to senrty (macos)

I'm just trying out release 0.1.0 of sentry-native on MacOS. Sending events works find for me, but uploading mini dumps doesn't seem to work. I get this in the log (and nothing appears on sentry.io):

[2784:4503432:20190925,145224.159045:WARNING process_memory_mac.cc:93] mach_vm_read(0x7ffee19a1000, 0x2000): (os/kern) invalid address (1) [2784:4503432:20190925,145224.309956:WARNING system_snapshot_mac.cc:42] sysctlbyname kern.nx: No such file or directory (2) [2784:4503432:20190925,145224.322667:ERROR file_io_posix.cc:140] open /Users/***/***/Cache/Diagnostics/sentry-runs/1569444740-1901035522/sentry-breadcrumb1.mp: No such file or directory (2) [2784:4503432:20190925,145224.322832:ERROR file_io_posix.cc:140] open /Users/***/***/Cache/Diagnostics/sentry-runs/1569444740-1901035522/sentry-breadcrumb2.mp: No such file or directory (2) [2784:4503432:20190925,145224.322953:ERROR file_io_posix.cc:140] open /Users/***/***/Cache/Diagnostics/sentry-runs/1569444740-1901035522/sentry-event.mp: No such file or directory (2) [2784:4503433:20190925,145224.328424:WARNING http_transport_mac.mm:250] --- sending to url: https://sentry.io:443/api/*******/minidump/?sentry_key=******&guid=****** [2784:4503433:20190925,145227.953635:ERROR http_transport_mac.mm:299] HTTP status 500 


The "sending to url" line is just something I inserted into crashpad_handler to figure out what URL it's sending to. When I use curl to send the mini dump it works fine:

curl -vX POST --compressed 'https://sentry.io:443/api/********/minidump/?sentry_key=********&guid=***********' -F [email protected]

Does Sentry Native support frame pointers stack unwinding?

Hello,

I wish to unwind stack traces locally when a crash happen on a Android ARM{32,64} device. My binary is compiled with frame pointers.

For my project, when a crash happens, sentry-native is able to only get the first frame with libunwindstack, but fail to get all of them.

Reading libunwindstack, I see it relies on DWARF symbols to unwind a stack trace. I unfortunately cannot ship my binary with DWARF symbols as the binary would be too big.

I would expect Sentry native (with libunwindstack) to follow frame pointers to unwind a stack trace, but it doesn't work for me, and I cannot find any mention of this in libunwindstack.

Does it support frame pointer stack unwinding? If yes, is there something to enable? Or did I miss something?

Thank you for your help!

Error in crashpad when trying to build sentry native

When I build the following errors occurs:

PS C:\Users\rafagan\Desktop\sentry-native> cmake --build build --parallel
Microsoft (R) Build Engine version 15.5.180.51428 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

getopt.vcxproj -> C:\Users\rafagan\Desktop\sentry-native\build\getopt.lib
mini_chromium.vcxproj -> C:\Users\rafagan\Desktop\sentry-native\build\mini_chromium.lib
zlib.vcxproj -> C:\Users\rafagan\Desktop\sentry-native\build\zlib.lib
crashpad_compat.vcxproj -> C:\Users\rafagan\Desktop\sentry-native\build\crashpad_compat.lib
crashpad_tools.vcxproj -> C:\Users\rafagan\Desktop\sentry-native\build\crashpad_tools.lib
exception_handler_server.cc
C:\Users\rafagan\Desktop\sentry-native\external\crashpad\minidump/minidump_extensions.h(33): error C4430: missing type
specifier - int assumed. Note: C++ does not support default-int [C:\Users\rafagan\Desktop\sentry-native\build\external
crashpad\util\crashpad_util.vcxproj]
C:\Users\rafagan\Desktop\sentry-native\external\crashpad\minidump/minidump_extensions.h(42): error C2059: syntax error:
'namespace' [C:\Users\rafagan\Desktop\sentry-native\build\external\crashpad\util\crashpad_util.vcxproj]
C:\Users\rafagan\Desktop\sentry-native\external\crashpad\minidump/minidump_extensions.h(42): error C2143: syntax error:
missing ';' before '{' [C:\Users\rafagan\Desktop\sentry-native\build\external\crashpad\util\crashpad_util.vcxproj]
C:\Users\rafagan\Desktop\sentry-native\external\crashpad\minidump/minidump_extensions.h(42): error C2447: '{': missing
function header (old-style formal list?) [C:\Users\rafagan\Desktop\sentry-native\build\external\crashpad\util\crashpad_
util.vcxproj]
C:\Users\rafagan\Desktop\sentry-native\external\crashpad\minidump/minidump_stream_writer.h(40): error C3646: 'StreamTyp
e': unknown override specifier [C:\Users\rafagan\Desktop\sentry-native\build\external\crashpad\util\crashpad_util.vcxpr
oj]
C:\Users\rafagan\Desktop\sentry-native\external\crashpad\minidump/minidump_stream_writer.h(40): error C2059: syntax err
or: ')' [C:\Users\rafagan\Desktop\sentry-native\build\external\crashpad\util\crashpad_util.vcxproj]
C:\Users\rafagan\Desktop\sentry-native\external\crashpad\minidump/minidump_stream_writer.h(40): error C2238: unexpected
token(s) preceding ';' [C:\Users\rafagan\Desktop\sentry-native\build\external\crashpad\util\crashpad_util.vcxproj]
C:\Users\rafagan\Desktop\sentry-native\external\crashpad\minidump/minidump_file_writer.h(150): error C2065: 'MinidumpSt
reamType': undeclared identifier [C:\Users\rafagan\Desktop\sentry-native\build\external\crashpad\util\crashpad_util.vcx
proj]
C:\Users\rafagan\Desktop\sentry-native\external\crashpad\minidump/minidump_file_writer.h(150): error C2923: 'std::set':
'MinidumpStreamType' is not a valid template type argument for parameter '_Kty' [C:\Users\rafagan\Desktop\sentry-nativ
e\build\external\crashpad\util\crashpad_util.vcxproj]
C:\Users\rafagan\Desktop\sentry-native\external\crashpad\minidump/minidump_file_writer.h(150): error C3203: 'less': uns
pecialized class template can't be used as a template argument for template parameter '_Pr', expected a real type [C:\U
sers\rafagan\Desktop\sentry-native\build\external\crashpad\util\crashpad_util.vcxproj]
C:\Users\rafagan\Desktop\sentry-native\external\crashpad\minidump/minidump_file_writer.h(150): error C3203: 'allocator'
: unspecialized class template can't be used as a template argument for template parameter '_Alloc', expected a real ty
pe [C:\Users\rafagan\Desktop\sentry-native\build\external\crashpad\util\crashpad_util.vcxproj]

How can I solve it?

Error in sentry_sync.c file

I have the following error when building:

PS C:\Users\rafagan\Desktop\sentry-native> cmake --build build --parallel
Microsoft (R) Build Engine version 15.5.180.51428 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

zlib.vcxproj -> C:\Users\rafagan\Desktop\sentry-native\build\zlib.lib
getopt.vcxproj -> C:\Users\rafagan\Desktop\sentry-native\build\getopt.lib
mini_chromium.vcxproj -> C:\Users\rafagan\Desktop\sentry-native\build\mini_chromium.lib
crashpad_compat.vcxproj -> C:\Users\rafagan\Desktop\sentry-native\build\crashpad_compat.lib
crashpad_tools.vcxproj -> C:\Users\rafagan\Desktop\sentry-native\build\crashpad_tools.lib
crashpad_util.vcxproj -> C:\Users\rafagan\Desktop\sentry-native\build\crashpad_util.lib
crashpad_client.vcxproj -> C:\Users\rafagan\Desktop\sentry-native\build\crashpad_client.lib
crashpad_snapshot.vcxproj -> C:\Users\rafagan\Desktop\sentry-native\build\crashpad_snapshot.lib
crashpad_minidump.vcxproj -> C:\Users\rafagan\Desktop\sentry-native\build\crashpad_minidump.lib
crashpad_handler.vcxproj -> C:\Users\rafagan\Desktop\sentry-native\build\crashpad_handler.exe
sentry_sync.c
C:\Users\rafagan\Desktop\sentry-native\src\sentry_sync.c(105): error C2440: 'function': cannot convert from 'int (__cde
cl *)(void *)' to 'LPTHREAD_START_ROUTINE' [C:\Users\rafagan\Desktop\sentry-native\build\sentry.vcxproj]
C:\Users\rafagan\Desktop\sentry-native\src\sentry_sync.c(105): warning C4024: 'CreateThread': different types for forma
l and actual parameter 3 [C:\Users\rafagan\Desktop\sentry-native\build\sentry.vcxproj]

How can I solve that?

Messages are not reaching server

After following the samples available here, I could achieve the following logs in my application:

[sentry] starting transport
[sentry] starting background worker thread
[sentry] starting backend
[sentry] starting crashpad backend
[sentry] started crashpad client handler.
[sentry] capturing event
[sentry] merging scope into event
[sentry] adding attachments to envelope
[sentry] sending envelope
[sentry] submitting task to background worker thread
[sentry] shutting down transport
[sentry] shutting down background worker thread
[sentry] submitting task to background worker thread

Everything seems to work ok, but I'm not receiving the logs in sentry.io, and everything seems ok with my DSN. What could possible be happening?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.