Skip to content
Merged
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

**Fixes**:

- Drop the outdated 1 GiB size limit for TUS attachment uploads. ([#2352](https://github.com/getsentry/sentry-native/pull/2352))
- Native: detect daemon startup failure to avoid a 10s stall in `sentry_init` on Windows and Linux. ([#2349](https://github.com/getsentry/sentry-native/pull/2349))

## 1.0.0-beta.2
Expand Down
3 changes: 0 additions & 3 deletions include/sentry.h
Original file line number Diff line number Diff line change
Expand Up @@ -3268,9 +3268,6 @@ SENTRY_EXPERIMENTAL_API int sentry_options_get_attach_stacktrace(
* attachments are embedded in the envelope and oversized uploads are rejected
* by Sentry.
*
* Note: Requires the `projects:relay-upload-endpoint` server feature. See
* https://develop.sentry.dev/sdk/telemetry/attachments/#attachment-placeholders
*
* Disabled by default.
*/
SENTRY_EXPERIMENTAL_API void sentry_options_set_enable_large_attachments(
Expand Down
7 changes: 0 additions & 7 deletions src/sentry_attachment.c
Original file line number Diff line number Diff line change
Expand Up @@ -456,14 +456,7 @@ sentry__attachment_validate(sentry_value_t attachment)
if (sentry_value_get_type(attachment) != SENTRY_VALUE_TYPE_OBJECT) {
return false;
}
size_t size = sentry__attachment_get_size(attachment);
const char *filename = sentry__attachment_get_filename(attachment);
if (size > SENTRY_MAX_ATTACHMENT_SIZE) {
SENTRY_WARNF("rejected oversized attachment \"%s\" (%zu > %d MiB)",
filename ? filename : "<unknown>", size / (1024 * 1024),
SENTRY_MAX_ATTACHMENT_SIZE / (1024 * 1024));
return false;
}
sentry_uuid_t attachment_id = sentry__attachment_get_id(attachment);
return !sentry_uuid_is_nil(&attachment_id)
&& (sentry__attachment_get_path(attachment)
Expand Down
1 change: 0 additions & 1 deletion src/sentry_attachment.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include "sentry_value.h"

#define SENTRY_LARGE_ATTACHMENT_SIZE (100 * 1024 * 1024) // 100 MiB
#define SENTRY_MAX_ATTACHMENT_SIZE (1024 * 1024 * 1024) // 1 GiB

/*
* Attachments are object values with two data representations:
Expand Down
23 changes: 9 additions & 14 deletions tests/unit/test_envelopes.c
Original file line number Diff line number Diff line change
Expand Up @@ -1174,7 +1174,7 @@ SENTRY_TEST(attachment_ref_roundtrip)
}

static void
check_oversized_minidump(sentry_envelope_t *envelope, void *data)
check_large_minidump(sentry_envelope_t *envelope, void *data)
{
size_t *called = data;
(*called)++;
Expand All @@ -1184,43 +1184,38 @@ check_oversized_minidump(sentry_envelope_t *envelope, void *data)
char filename[41];
sentry_uuid_as_string(&event_id, filename);
memcpy(filename + 36, ".dmp", 5);
check_attachment_ref_item(envelope, 1, "sentry_test_oversized_minidump.dmp",
check_attachment_ref_item(envelope, 1, "sentry_test_large_minidump.dmp",
"application/octet-stream", SENTRY_ATTACHMENT_TYPE_MINIDUMP,
SENTRY_MAX_ATTACHMENT_SIZE + 1, filename);
SENTRY_LARGE_ATTACHMENT_SIZE + 1, filename);

SENTRY_WITH_OPTIONS (options) {
sentry_path_t *cached
= sentry__path_join_str(options->run->cache_path, filename);
TEST_CHECK_INT_EQUAL(
sentry__path_get_size(cached), SENTRY_MAX_ATTACHMENT_SIZE + 1);
sentry__path_get_size(cached), SENTRY_LARGE_ATTACHMENT_SIZE + 1);
sentry__path_remove(cached);
sentry__path_free(cached);
}
sentry_envelope_free(envelope);
}

SENTRY_TEST(capture_minidump_oversized)
SENTRY_TEST(capture_minidump_large)
{
#if defined(SENTRY_PLATFORM_ANDROID) || defined(SENTRY_PLATFORM_NX) \
|| defined(SENTRY_PLATFORM_PS) || defined(SENTRY_PLATFORM_XBOX)
SKIP_TEST();
#else
const char *filename
= SENTRY_TEST_PATH_PREFIX "sentry_test_oversized_minidump.dmp";
= SENTRY_TEST_PATH_PREFIX "sentry_test_large_minidump.dmp";
sentry_path_t *path = sentry__path_from_str(filename);
FILE *f = fopen(filename, "wb");
TEST_ASSERT(!!f);
TEST_ASSERT_INT_EQUAL(fseek(f, SENTRY_MAX_ATTACHMENT_SIZE, SEEK_SET), 0);
TEST_ASSERT_INT_EQUAL(fseek(f, SENTRY_LARGE_ATTACHMENT_SIZE, SEEK_SET), 0);
TEST_ASSERT_INT_EQUAL(fputc('x', f), 'x');
TEST_ASSERT_INT_EQUAL(fclose(f), 0);

sentry_value_t attachment = sentry_attachment_from_file(filename);
TEST_CHECK(sentry_value_is_null(attachment));
sentry_value_decref(attachment);

size_t called = 0;
sentry_transport_t *transport
= sentry_transport_new(check_oversized_minidump);
sentry_transport_t *transport = sentry_transport_new(check_large_minidump);
sentry_transport_set_state(transport, &called);
SENTRY_TEST_OPTIONS_NEW(options);
sentry_options_set_dsn(options, "https://foo@sentry.invalid/42");
Expand All @@ -1231,7 +1226,7 @@ SENTRY_TEST(capture_minidump_oversized)
sentry_uuid_t event_id = sentry_capture_minidump(filename);
TEST_CHECK(!sentry_uuid_is_nil(&event_id));
TEST_CHECK_INT_EQUAL(
sentry__path_get_size(path), SENTRY_MAX_ATTACHMENT_SIZE + 1);
sentry__path_get_size(path), SENTRY_LARGE_ATTACHMENT_SIZE + 1);
sentry_close();
sentry__path_remove(path);
sentry__path_free(path);
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/tests.inc
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ XX(capture_hint_cleanup)
XX(capture_minidump_basic)
XX(capture_minidump_discard)
XX(capture_minidump_invalid_path)
XX(capture_minidump_large)
XX(capture_minidump_null_path)
XX(capture_minidump_oversized)
XX(capture_minidump_wide)
XX(capture_minidump_without_sentry_init)
XX(check_version)
Expand Down
Loading