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
fix: work around a null scoped_ptr dereference #19366
Conversation
CI seems to have flaked due the Github downtime. |
Have you observed the log message being printed at all? I'm not sure what would cause the callback to become nulled out... |
So I just realised that I forgot to add |
OK, so a quick update on this one: I haven't been able to find an acceptable way of adding |
@richard-townsend-arm to see the logging set the ELECTRON_ENABLE_LOGGING environment variable to 1. |
@jkleinsc EDIT: oh, i see, the earlier message was saying that passing the flag wasn't easy to do. carry on. |
I'll try to replicate it on Linux (that way I can do reverse debug). |
So I think the missing piece of the puzzle is that |
fc4f1b2
to
f947ebc
Compare
Cool, so the current patch should take care of the problem. |
@richard-townsend-arm can you rebase this with the latest from 6-0-x? I just merged in the changes so that we can properly build WOA. |
This happens occasionally when running the test suite and indicates that the callback's been reset or the underlying reference has been released. To workaround, print a warning.
f947ebc
to
53286ce
Compare
I still don't understand how |
No Release Notes |
(Although it's just been merged, a quick explanation of what I think was going wrong for posterity): I think it's related to #18065: when AtomCertVerifier::OnDefaultVerificationDone gets called, it doesn't check whether AtomCertVerifier::verify_proc() is null or not. It's supposed to be set to something non-null by SetCertVerifyProcInIO, but this is is (for some reason) queued up to run asynchronously on the IO thread. I think this means that when the IO thread's congested, there's a small window of opportunity where requests can complete and verify_proc() is null. It's proving tough to prove beyond all doubt that this is what's actually happening though due to the heavy asynchronous...ness going on. |
Description of Change
For the last week or so, we've been running each Electron 6 commit through the unit tests multiple times. Sometimes, the unit test suite dies halfway through for no discernible reason. Executing under the debugger indicates that the callback passed to
base::BindRepeating
during atom's certificate verification process sometimes has a nullbind_state
, which causes the crash (this happens on x86 and on Windows on Arm). To workaround, this PR changes the callback to one which logs the result if this occurs. Since applying this fix, we haven't seen the issue in subsequent runs.The certificate verification logic has been rewritten in master (therefore this patch will not apply). The new code may suffer from the same problem, but we haven't spotted it yet because we don't have enough capacity to test master and 6-0-x to the same level.
CC @jkleinsc @MarshallOfSound
Checklist
npm test
passesRelease Notes
Notes: no-notes