From f78f450cc73141ad79ca7139d0f7801da3b1124a Mon Sep 17 00:00:00 2001 From: Chase Colman Date: Fri, 27 Oct 2023 13:19:14 +0800 Subject: [PATCH] Disable partition alloc on all platforms to prevent crashes There are several cases we've encountered where allocs and frees don't match the correct allocator when going from Electron to LibreOfficeKit, causing crashes. Usually an allocaiton is preformed in LOK with the system default allocator but then Electron tries to free it with the partition allocator. This is already disabled on macOS by default so disabling it for Windows and Linux doesn't really change much. They only just re-enabled partition alloc on Mac last week anyway: https://github.com/electron/electron/pull/33981 --- .../chromium/build_disable_partition_alloc_on_mac.patch | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/electron/patches/chromium/build_disable_partition_alloc_on_mac.patch b/src/electron/patches/chromium/build_disable_partition_alloc_on_mac.patch index 5fd0656..b038b87 100644 --- a/src/electron/patches/chromium/build_disable_partition_alloc_on_mac.patch +++ b/src/electron/patches/chromium/build_disable_partition_alloc_on_mac.patch @@ -1,13 +1,16 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: VerteDinde Date: Tue, 1 Mar 2022 12:07:25 -0800 -Subject: build: disable partition alloc on mac +Subject: build: disable partition alloc Enabling partition alloc caused a crash when spawning a child process. This patch disables partition alloc for mac, and can be removed when the crash in fork is resolved. Related issue: https://github.com/electron/electron/issues/32718 +-- DISABLE ON ALL PLATFORMS -- +It doesn't play nicely with LOK + diff --git a/base/allocator/allocator.gni b/base/allocator/allocator.gni index 97a57dfb1626ae9a781736dd8b0b55bf201162c1..5c97441faad781b459255cb1f7d0652ec86e40c8 100644 --- a/base/allocator/allocator.gni @@ -17,7 +20,7 @@ index 97a57dfb1626ae9a781736dd8b0b55bf201162c1..5c97441faad781b459255cb1f7d0652e # - NaCl: No plans to support it. # - iOS: not done yet. -_is_partition_alloc_platform = !is_nacl && !is_ios -+_is_partition_alloc_platform = !is_nacl && !is_ios && !is_mac ++_is_partition_alloc_platform = false # Under Windows Debug the allocator shim is not compatible with CRT. # NaCl in particular does seem to link some binaries statically