I’m working with the example_crashpad as a basis for implementing Sentry inside of our app. When using the example code as-is, the minidump is uploaded properly. When removing the breadcrumbs - anything after sentry_init(options), the minidumps stop uploading.
Code that doesn’t work:
sentry_options_t *options = sentry_options_new();
sentry_options_set_handler_path(options, "./crashpad_handler");
sentry_options_set_dsn(options, "https://MY_DSN@sentry.io/MY_ID");
sentry_options_set_environment(options, "Production");
sentry_options_set_release(options, "5fd7a6cd");
sentry_options_set_database_path(options, "sentry-db");
sentry_options_set_debug(options, 1);
sentry_options_set_system_crash_reporter_enabled(options, true);
sentry_init(options);
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
memset((void*)0x0, 42, sizeof(int)); // CRASHCRASHCRASH
Adding this code right after the sentry_init(options), makes the minidump upload properly:
sentry_set_transaction("tran");
sentry_set_level(SENTRY_LEVEL_WARNING);
sentry_set_extra("extra stuff", sentry_value_new_string("some value"));
sentry_set_tag("expected-tag", "some value");
sentry_set_tag("not-expected-tag", "some value");
sentry_remove_tag("not-expected-tag");
sentry_set_fingerprint("foo", "bar", NULL);
sentry_value_t default_crumb =
sentry_value_new_breadcrumb(0, "default level is info");
sentry_add_breadcrumb(default_crumb);
sentry_value_t debug_crumb =
sentry_value_new_breadcrumb("http", "debug crumb");
sentry_value_set_by_key(debug_crumb, "category",
sentry_value_new_string("example!"));
sentry_value_set_by_key(debug_crumb, "level",
sentry_value_new_string("debug"));
sentry_add_breadcrumb(debug_crumb);
for (size_t i = 0; i < 101; i++) {
char buffer[4];
sprintf(buffer, "%zu", i);
sentry_add_breadcrumb(sentry_value_new_breadcrumb(0, buffer));
}
I don’t understand why it wouldn’t upload the minidump without adding the optional information in the second section of code. Any ideas?