-
Notifications
You must be signed in to change notification settings - Fork 82
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
Incompatible with JNI on Windows: use unique handle for SymInitialize #204 #206
Conversation
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.
Thanks for putting this together! Some commends below
src/unwind/unwind_with_dbghelp.cpp
Outdated
} else { | ||
if(!SymInitialize(proc, NULL, TRUE)) { | ||
if (!DuplicateHandle(proc, proc, proc, &duplicatedHandle, 0, FALSE, DUPLICATE_SAME_ACCESS)) { |
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 logic appears in a couple places and having grown I'm thinking it would be good to refactor out. That's something I can do after merging if you'd like to not delay this pr.
I tested locally and was able to reproduce the failing tests, I think I fixed it |
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 LGTM, thanks so much! Happy to follow up on this PR with the few items we talked about above
I'm going to merge into |
WinDbg: Duplicate the process handle before using it in SymInitialize, because other libraries may have already called SymInitialize for the process (https://learn.microsoft.com/en-us/windows/win32/debug/initializing-the-symbol-handler)
Fixes #204