-
-
Notifications
You must be signed in to change notification settings - Fork 169
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
feat: Add Breakpad support for Windows #278
Conversation
774c1d7
to
d10734c
Compare
Thanks, @Mixaill. Answering your questions first:
This is intended, yes. Since breakpad runs everything in-process after the crash, there are only limited possibilities. Particularly, it is no longer possible to run reliable network communication, much less to upload an entire minidump. This is why we only write it to disk and upload it on the next run.
Excellent question. The current backend implementations (both Crashpad and Breakpad) do create the envelope and write it into the run folder. Ideally, however, you would not create the envelope. Not setting a DSN is intended to disable most of the SDK's functionality, and as such should also skip writing an envelope. This is also something for @Swatinem to chime in on.
There is |
That sounds excellent! In case you would like to show the files contained in the envelope, you can find a reference of its structure here. If your background-uploader works well and you would like to share it, I would love to take a look at it. Uploading from a background process sounds like a useful addition to the SDK in general, even without a UI. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks awesome already!
I think changing this condition here should be enough to run the relevant breakpad tests also on windows:
sentry-native/tests/conditions.py
Line 11 in dd6ec0c
has_breakpad = sys.platform == "linux" |
btw, the CI failure in |
Enabled |
5353903
to
38289de
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you need to run make format
to make python formatter happy ;-)
39d6ebb
to
8d2c469
Compare
Well, there are two problems
|
b2d4d31
to
354378b
Compare
oh, its possible we are running into this: sentry-native/src/sentry_core.c Lines 127 to 133 in 9651561
I remember I was actually on windows when adding that comment. That may be related to this: sentry-native/src/sentry_sync.c Lines 131 to 148 in 9651561
I remember we did observe time going backwards, I think that was actually on windows @jan-auer? Maybe @mitsuhiko can also chime in, since he wrote that original thread joining code. I cant imagine why a HTTP request to localhost may take up more than 5s, so maybe our timer is jumping wildly. |
so, what should we be doing in that case anyway? In the very least, we will leak memory from the background thread. Not quite sure if we should trigger a hard assert there? |
Firewall configuration on test machine / VM? |
8d2c469
to
31904c8
Compare
f631c82
to
71824b5
Compare
Ill have to look through this pr more closely as I didnt run into any of these issues. But I'm also based off of 0.3.1 not master. also whenever I see a |
|
@Swatinem It seems like it would be a good idea to add a way for internals to add an attachment via the event, so that the the Breakpad transport would no longer be needed. |
Indeed it would! We discussed this briefly to have a more fine-grained attachment support, but we didn’t reach a conclusion there yet. The native SDK is actually the first one which has attachment support AFAIK, and one of the few that works with envelopes internally. |
…and `sentry__atomic_fetch_and_add`
71824b5
to
77803e5
Compare
@Swatinem rebased on top of master with merged monotonic time |
🎉 Amazing stuff, thanks for sticking with it this long ;-) |
sentry_path_t *dump_path = nullptr; | ||
#ifdef SENTRY_PLATFORM_WINDOWS | ||
dump_path = sentry__path_new(breakpad_dump_path); | ||
dump_path = sentry__path_join_wstr(dump_path, minidump_id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! I think you are right.
Kinda working for me. Tested on example project.
Several questions:
.envelope
even when DSN is not set? In such case.dmp
is not available until DSN will be set and envelope will be sended to the sentry..envelope
?references #170
references #190