getsentry / sentry-native Goto Github PK
View Code? Open in Web Editor NEWSentry SDK for C, C++ and native applications.
License: MIT License
Sentry SDK for C, C++ and native applications.
License: MIT License
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)
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?
How are you running Sentry?
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.
We should see the release in the event as well as user info and all extras.
Function json_serialize_string(...)
used in Value::to_json(...)
does not correctly escapes backslash (\) characters and serialization generates invalid json. Therefore, sending events fails on Windows because event contains debug_meta key containing list of modules including backslash characters.
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
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.
./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), ¬e_info)) {
return Result::kError;
}
--
2.11.0
Thanks
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
Refer to Capturing Events in Sentry Doc, I send the event to sentry server, and I see 2 error while processing this event.
The capture event in sentry server:
My example code follow the sentry Doc,
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);
}
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
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?
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.
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 ?
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
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")
Is sentry-native supported with 32 bit applications on Linux? I did not find instructions on building for sentry-native as a 32-bit binary in the documentation and hence posting here.
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?
If you try to simply build using the cmake commands described in README.MD, it's complains about missing resources in theese third party srcs.
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.
it would be awesome to be able to pass an install prefix to premake and have all the includes, libs and binaries installed there
https://github.com/premake/premake-core/wiki/Command-Line-Arguments#creating-new-actions
I'm try to build Breakpad with sentrypad for arm target in qemu with Debian buster
[Add march]
I try to add "march=armv5t" in premake5.sentry.lua, but still the same error
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 ?
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?
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?
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?
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?
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 :
Thanks for helping.
Regards.
We want to produce for now the following matrix:
WITH_SENTRY_BREAKPAD_BACKEND
)WITH_SENTRY_CRASHPAD_BACKEND
)WITH_SENTRY_TESTS
) + tests/**.cppAnd 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.
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.
cmake . -DBUILD_SHARED_LIBS=OFF
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();
}
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).
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
The API documentation in sentry.h
, as well as the Sentry Configuration documentation imply that sentry_options_set_ca_certs
takes the path to a CA bundle file. However, the libcurl transport code uses CURLOPT_CAPATH
, which is the option to specify the path to a directory containing CA certificates. The option to specify the path to a CA bundle is CURLOPT_CAINFO
.
I see the Breakpad backend had been removed and is being bring back.
breakpad-backend
to be merged in master
? How can I help?Any update on supporting 32-bit binaries?
Currently trying to utilize sentry with a 32-bit project but seem unable to continue.
https://github.com/nlohmann/crow appears to be the alternative.
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
I had to bump android to 21 for now to make some progress. We should look into what we need to do to support android-16.
refs #59
I notice there is a CMakeLists.txt in project, but it seems only support for android.
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...
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!
I found CJK characters does not handle correctly on Windows.
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);
I'm suspecting this issue because of the below code.
https://github.com/getsentry/sentry-native/blob/master/src/json.hpp#L117
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]]
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.
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
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 ?
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:
Anyway, a solution to build as static lib is appreciated at this point; the rest... no further comments.
Thanks
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
add sentry_logger_function_t
Thanks!
On Windows with 0.1.2 version when the path contains /
and \\
, filename_matches
always returns false therefore the current run folder is erased when cleaning up old folders at startup.
Therefore, it crashes when trying to flush.
Hey @jan-auer ,
as discussed today here is an conan recipe for sentry-native https://github.com/tonka3000/conan-sentry_native .
It's not finished (see travis and appveyor), but I think you get the point 😄
Greetings
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.
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.
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 !
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]
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.
Maybe related to #84 ? Many thanks in advance for your help !
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.
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)
sentry_shutdown()
cannot be reached after the error, even if I try to :
std::set_terminate
callback.sentry-native\reports
, containing expected data.sentry-native\attachments\xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx
‰¨contexts€«environmentªProduction¥extra€¥level¥error¨platform¦native§release[email protected]£sdkƒ¤namesentry-native¨packages‘‚¤name¾github:getsentry/sentry-native§version¥0.1.4§version¥0.1.4¤tags€¤userÀ
.sentry-native\sentry-runs\1576118808-1100518007
:
__sentry-event
, same content as above.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!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.