* fix: microtasks policy in CreateEnvironment
Microtasks policy should not be updated for the renderer because
`NodeBindings::CreateEnvironment` might be entered with or without
`UvRunOnce()` on stack. One of the examples of such calls is
`window.open()` which is possible to invoke while `uv_run()` is still
running (e.g. with `setImmediate()`).
All in all, it doesn't matter that much which policy we use since
`v8::MicrotasksScope` has a check for the policy in its destructor and
no commits will be made if the policy is `kExplicit`. It is important,
however, to not change the policy in the middle of `UvRunOnce()` so we
should respect whatever we currently have and move on.
Fix: #29463
* Move test to a better place
* Update spec-main/fixtures/crash-cases/setimmediate-window-open-crash/index.html
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
* Update spec-main/fixtures/crash-cases/setimmediate-window-open-crash/index.html
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
* simplify crash-case
* comment
* fix comment
Co-authored-by: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com>
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
Co-authored-by: Fedor Indutny <indutny@signal.org>
* fix: prevent crash when error occurs during event emitter CallMethod
* wip: emit error event within trycatch
* fix: handle uncaught exceptions within node on web_contents init
* fix: create gin_helper::CallMethodCatchException
* test: add web-contents create crash to test cases
* test: clean up test data for web-contents crash
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
* fix: convert CatchException to WebContents static helper method
* fix: restore try_catch to callsite
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
* test: running child app under ASan might receive SIGKILL
* test: renderer process of webview might receive SIGKILL under ASan
* test: increase timeout for asan build
* fix: handle a nil backgroundColor in win.getBackgroundColor()
* spec: add crash case
* fix: update to fix native_views transparent color
* chore: fix lint
Closes#21666.
This PR is fixing crashes caused by referencing and attempting to modify previously destroyed views.
Before, when a view was destroyed and then the contents were referenced for modification, the system would crash as undefined memory was accessed. This fix explicitly makes the pointer to the destroyed view's contents null, so that this will not happen.
* tests: fix failing WOA tests
tests: fix startDrag for WOA
tests: fix early-in-memory-session-create crash test on WOA
ci: cleanup user app data directories on WOA
* tests: disable nativeImage.createFromBuffer tests on WOA
* disable failing nativeImage.createFromPath on WOA
* disable another nativeImage test for WOA