Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

chore(deps): bump rexml from 3.2.6 to 3.2.8 #2

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,8 @@ GEM
mime-types (>= 1.16, < 4.0)
netrc (~> 0.8)
retriable (3.1.2)
rexml (3.2.6)
rexml (3.2.8)
strscan (>= 3.0.9)
rouge (2.0.7)
ruby-macho (2.5.1)
ruby2_keywords (0.0.5)
Expand All @@ -273,6 +274,7 @@ GEM
clamp (~> 1.3)
nokogiri (>= 1.14.3)
xcodeproj (~> 1.21)
strscan (3.1.0)
terminal-notifier (2.0.0)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
Expand Down
19 changes: 19 additions & 0 deletions Sources/SentryCrash/Recording/SentryCrashC.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@
#include <stdlib.h>
#include <string.h>

// Used by our relaunch mechanism
#include <libproc.h>
#include <unistd.h>

// ============================================================================
#pragma mark - Globals -
// ============================================================================
Expand All @@ -59,6 +63,9 @@ static char g_lastCrashReportFilePath[SentryCrashFU_MAX_PATH_LENGTH];
static void (*g_saveScreenShot)(const char *) = 0;
static void (*g_saveViewHierarchy)(const char *) = 0;

static bool _relaunchCommandAvailable = false;
static char _relaunchCommand[1024];

// ============================================================================
#pragma mark - Utility -
// ============================================================================
Expand Down Expand Up @@ -86,6 +93,10 @@ onCrash(struct SentryCrash_MonitorContext *monitorContext)
sentrycrashreport_writeStandardReport(monitorContext, crashReportFilePath);
}

if (_relaunchCommandAvailable) {
system(_relaunchCommand);
}

// Report is saved to disk, now we try to take screenshots
// and view hierarchies.
// Depending on the state of the crash this may not work
Expand Down Expand Up @@ -136,6 +147,14 @@ sentrycrash_install(const char *appName, const char *const installPath)

sentrycrashccd_init(60);

char appBinaryPath[PROC_PIDPATHINFO_MAXSIZE];
if (proc_pidpath(getpid(), appBinaryPath, sizeof(appBinaryPath)) > 0
&& strnstr(appBinaryPath, "TimingHelper", sizeof(appBinaryPath)) != NULL
&& strnstr(appBinaryPath, "InfoExtractor", sizeof(appBinaryPath)) == NULL) {
snprintf(_relaunchCommand, sizeof(_relaunchCommand), "'%s' --fromCrashRecovery &", appBinaryPath);
_relaunchCommandAvailable = true;
}

sentrycrashcm_setEventCallback(onCrash);
SentryCrashMonitorType monitors = sentrycrash_setMonitoring(g_monitoring);

Expand Down