Problem with Sentry Native (C++) minidumps

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?

Same issue. Stopped sending minidumps ~ week ago.
This workaround helps, but non stable.
Wireshark showed some activity with sentry.io after crash (approx 4 seconds), but issue is not appearing in dashboard.

Thanks for chiming in.

Meanwhile, I can confirm that it usually uploads when just adding lots of breadcrumbs directly after initializing the options:

for (size_t i = 0; i < 101; i++) {
    char buffer[4];
    sprintf(buffer, "%zu", i);
    sentry_add_breadcrumb(sentry_value_new_breadcrumb(0, buffer));
}

This was fixed on sentry SaaS and you should start seeing your crashes again. Thanks for reporting this issue!

I can confirm that the reports are now working again, without the workaround posted. Thanks for the fix!

I have now updated to Sentry-Native-0.2.3. The problem described has now returned in a different form: Crash reports are not registering with sentry.io, unless events or similar have been created before the application is crashing. Adding breadcrumbs before the crash also does not work.

Reproduction using example.c:
./sentry_example no-setup crash
Expected result: Issue is recorded.
Actual result: Issue is NOT recorded.

Using ./sentry_example crash works as expected.

Adding a single transaction after the sentry_init() call also makes crash reports show up on sentry.io again:

sentry_init(options);
sentry_set_transaction("init");

I can confirm this doesn’t work again since yesterday. However, the above solution still works (with the transaction after init).