Skip to content

Commit

Permalink
backport sentry fix (#6447)
Browse files Browse the repository at this point in the history
  • Loading branch information
strseb authored Mar 24, 2023
1 parent e1fe888 commit 3ed76b0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/apps/vpn/cmake/sentry.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ if( ${_SUPPORTED} GREATER -1 )
target_compile_definitions(mozillavpn PRIVATE SENTRY_ENVELOPE_ENDPOINT="${SENTRY_ENVELOPE_ENDPOINT}")
target_compile_definitions(mozillavpn PRIVATE SENTRY_DSN="${SENTRY_DSN}")
target_compile_definitions(mozillavpn PRIVATE SENTRY_ENABLED)
# Let's the app know we need to provide the upload client
target_compile_definitions(shared-sources INTERFACE SENTRY_NONE_TRANSPORT)


# Sentry support is given
target_sources(mozillavpn PRIVATE
apps/vpn/sentry/sentryadapter.cpp
Expand Down Expand Up @@ -65,7 +69,7 @@ if( ${_SUPPORTED} GREATER -1 )
target_link_libraries(mozillavpn PUBLIC breakpad_client.lib)
target_link_libraries(mozillavpn PUBLIC dbghelp.lib)
# Windows will use the winhttp transport btw
SET(SENTRY_ARGS -DSENTRY_BUILD_SHARED_LIBS=false -DSENTRY_BACKEND=breakpad -DCMAKE_BUILD_TYPE=Release)
SET(SENTRY_ARGS -DSENTRY_BUILD_SHARED_LIBS=false -DSENTRY_BACKEND=breakpad -DSENTRY_TRANSPORT=none -DCMAKE_BUILD_TYPE=Release)
endif()

if(ANDROID)
Expand Down
14 changes: 14 additions & 0 deletions src/apps/vpn/mozillavpn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1595,7 +1595,21 @@ void MozillaVPN::exitForUnrecoverableError(const QString& reason) {

void MozillaVPN::crashTest() {
logger.debug() << "Crashing Application";

#ifdef MZ_WINDOWS
// Windows does not have "signals"
// qFatal("Ready to crash!") does not work as expected.
// QT raises a debugmessage (in debugmode) - which we would handle
// in release-mode however this end's with QT just doing a clean shutdown
// so breakpad does not kick in.
int i = 1;
QString* ohno = (QString*)i--;
ohno->at(1);
#else
// On Linux/osx this generates a Sigabort, which is handled
qFatal("Ready to crash!");
#endif

}

// static
Expand Down

0 comments on commit 3ed76b0

Please sign in to comment.