Skip to content

[Bug]: Renderer Crash (SIGSEGV / SEGV_PKUERR) in 26.0.0, 26.1.0 and 26.2.0 #39775

Closed

Description

@threema-danilo

Preflight Checklist

Electron Version

26.2.0

What operating system are you using?

Other Linux

Operating System Version

Arch Linux

What arch are you using?

x64

Last Known Working Electron version

25.8.0

Expected Behavior

The renderer should not crash.

Actual Behavior

An application I'm working on (which isn't open source yet) crashes on start when using Electron 26.0.0, 26.1.0 or 26.2.0.

The crash dump is always identical. The crashing thread crashed in the function electron!partition_alloc::internal::PartitionBucket::MaintainActiveList().

Here are the top 4 calls in the stack trace:

Operating system: Linux
                  6.4.12 -arch1-1 #1 SMP PREEMPT_DYNAMIC Thu, 24 Aug 2023 00:38:14 +0000 x86_64
CPU: amd64
     family 25 model 33 stepping 0
     32 CPUs

Crash reason:  SIGSEGV / SEGV_PKUERR
Crash address: 0x2c0a30001048
Process uptime: 4 seconds

Thread 0 electron (crashed)
 0  electron!partition_alloc::internal::PartitionBucket::MaintainActiveList() [partition_bucket.cc : 1163 + 0x0]
     rax = 0x00002c0a30001040    rdx = 0x00002c0a30001040
     rcx = 0x0000000000000000    rbx = 0x00005629523020b0
     rsi = 0x0000000010600002    rdi = 0x00002c0a30008020
     rbp = 0x00007ffcda1f5c30    rsp = 0x00007ffcda1f5c20
      r8 = 0x0000000010600002     r9 = 0xf08f0100dc070000
     r10 = 0x0000000000000000    r11 = 0x0000000000000001
     r12 = 0x0000000000000000    r13 = 0x0000562952250008
     r14 = 0x0000000000000000    r15 = 0x00005629523020b0
     rip = 0x000056294dbd18c3
    Found by: given as instruction pointer in context
 1  electron!partition_alloc::PartitionRoot::PurgeMemory(int) [partition_root.cc : 1380 + 0x7]
     rbx = 0x0000000000000003    rbp = 0x00007ffcda1f60c0
     rsp = 0x00007ffcda1f5c40    r12 = 0x0000000000000000
     r13 = 0x0000562952250008    r14 = 0x0000562952303488
     r15 = 0x00005629523020b0    rip = 0x000056294dbd671c
    Found by: call frame info
 2  electron!partition_alloc::MemoryReclaimer::Reclaim(int) [memory_reclaimer.cc : 89 + 0x7]
     rbx = 0x0000562952250008    rbp = 0x00007ffcda1f60f0
     rsp = 0x00007ffcda1f60d0    r12 = 0x00000234002c34e0
     r13 = 0x0000562952250008    r14 = 0x0000000000000003
     r15 = 0x0000562952250018    rip = 0x000056294dbd01f4
    Found by: call frame info
 3  electron!base::allocator::(anonymous namespace)::RunMemoryReclaimer(scoped_refptr<base::SequencedTaskRunner>) [partition_alloc_support.cc : 227 + 0x7]
     rbx = 0x0000023400239740    rbp = 0x00007ffcda1f6160
     rsp = 0x00007ffcda1f6100    r12 = 0x0000000436d8d651
     r13 = 0x0000562952250008    r14 = 0xaaaaaaaaaaaaaaaa
     r15 = 0x00007ffcda1f6200    rip = 0x000056294daeb5d8
    Found by: call frame info

Here are two symbolicated crash dumps for 26.0.0 and 26.2.0:

With 25.8.0, everything works fine. Let me know if there's any additional information I can provide!

Testcase Gist URL

No response

Additional Information

No response

Activity

  1. indutny-signal commented on Sep 8, 2023

    @indutny-signal
    Contributor

    Just to add a data point: all of our internal Linux users experienced the very same crash (with the same stack trace)

  2. moved this to 👀 Unsorted Items in 26-x-yon Sep 9, 2023
  3. deepak1556 commented on Sep 11, 2023

    @deepak1556
    Member

    Does it crash when you launch with the following flag --disable-features=PartitionAllocBackupRefPtr

  4. deepak1556 commented on Sep 11, 2023

    @deepak1556
    Member

    If the above does not crash, then please also check if the crash is avoided with --enable-features=PartitionAllocBackupRefPtr:brp-mode/enabled which will disable the memory reclaimer feature enabled via https://chromium-review.googlesource.com/c/chromium/src/+/4597058.

  5. ayumi-signal commented on Sep 11, 2023

    @ayumi-signal

    @deepak1556 Thank you for the suggestion of flags to try. I tried to launch electron using --disable-features=PartitionAllocBackupRefPtr and separately with --enable-features=PartitionAllocBackupRefPtr:brp-mode/enabled and in both cases electron crashes with the same error and location. The traces look the same as the trace from running without any flags. This is on Debian 12.

    Operating system: Linux
                      6.1.0 -11-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.38-4 (2023-08-08) x86_64
    CPU: amd64
         family 6 model 186 stepping 2
         20 CPUs
    
    Crash reason:  SIGSEGV / SEGV_PKUERR
    Crash address: 0x000002f1d0001048
    Process uptime: 5 seconds
    
    Thread 0 electron (crashed)
     0  electron!partition_alloc::internal::PartitionBucket::MaintainActiveList() [partition_bucket.c
    c : 1163 + 0x0]
         rax = 0x000002f1d0001040    rdx = 0x000002f1d0001040
         rcx = 0x0000000000000000    rbx = 0x0000562fbb9e90b0
         rsi = 0x0000000010600002    rdi = 0x000002f1d0008020
         rbp = 0x00007ffe21d7dfa0    rsp = 0x00007ffe21d7df90
          r8 = 0x0000000010600002     r9 = 0xc00f0100c81e0000
         r10 = 0x0000000000000000    r11 = 0x0000000000000001
         r12 = 0x0000000000000000    r13 = 0x0000562fbb937008
         r14 = 0x0000000000000000    r15 = 0x0000562fbb9e90b0
         rip = 0x0000562fb72a7e03
        Found by: given as instruction pointer in context
     1  electron!partition_alloc::PartitionRoot::PurgeMemory(int) [partition_root.cc : 1380 + 0x7]
         rbx = 0x0000000000000003    rbp = 0x00007ffe21d7e430
         rsp = 0x00007ffe21d7dfb0    r12 = 0x0000000000000000
         r13 = 0x0000562fbb937008    r14 = 0x0000562fbb9ea488
         r15 = 0x0000562fbb9e90b0    rip = 0x0000562fb72acd4c
        Found by: call frame info
     2  electron!partition_alloc::MemoryReclaimer::Reclaim(int) [memory_reclaimer.cc : 89 + 0x7]
         rbx = 0x0000562fbb937008    rbp = 0x00007ffe21d7e460
         rsp = 0x00007ffe21d7e440    r12 = 0x00001adc002d1b00
         r13 = 0x0000562fbb937008    r14 = 0x0000000000000003
         r15 = 0x0000562fbb937018    rip = 0x0000562fb72a6734
        Found by: call frame info
     3  electron!base::allocator::(anonymous namespace)::RunMemoryReclaimer(scoped_refptr<base::Seque
    ncedTaskRunner>) [partition_alloc_support.cc : 227 + 0x7]
         rbx = 0x00001adc00221950    rbp = 0x00007ffe21d7e4d0
         rsp = 0x00007ffe21d7e470    r12 = 0x0000004999c79119
         r13 = 0x0000562fbb937008    r14 = 0xaaaaaaaaaaaaaaaa
         r15 = 0x00007ffe21d7e500    rip = 0x0000562fb71c2058
        Found by: call frame info
    
  6. deepak1556 commented on Sep 12, 2023

    @deepak1556
    Member

    @ayumi-signal to clarify, is the above crash from your application or from a sample electron app ? If it is from your application, add the feature flag to this callsite https://github.com/signalapp/Signal-Desktop/blob/4d2910d696fc22fd74dd36c3fa3749fb855e184a/app/main.ts#L1677

    app.commandLine.appendSwitch('disable-features', 'HardwareMediaKeyHandling,PartitionAllocBackupRefPtr');
    
  7. ayumi-signal commented on Sep 12, 2023

    @ayumi-signal

    @deepak1556 Ah thank you for the tip on how to use the feature flag correctly! However, after following the steps I'm still getting the same crash and stacktrace in electron!partition_alloc::internal::PartitionBucket::MaintainActiveList().

    To confirm the flag was passed to electron I used ps aux and observed electron was running with --disable-features=HardwareMediaKeyHandling,PartitionAllocBackupRefPtr,SpareRendererForSitePerProcess.

    Regarding the other flag --enable-features=PartitionAllocBackupRefPtr:brp-mode/enabled I wasn't sure how to use it. When adding app.commandLine.appendSwitch('enable-features', 'PartitionAllocBackupRefPtr:brp-mode/enabled') the switch seems to be discarded as observed with ps aux. (But using just 'enable-features', 'PartitionAllocBackupRefPtr works correctly.)

  8. deepak1556 commented on Sep 12, 2023

    @deepak1556
    Member

    Thanks for confirming, I wanted to confirm if the BRP feature that was enabled by default on Linux https://chromium-review.googlesource.com/c/chromium/src/+/4478673 between 114 and 116 was related to the regression. But now that I look at the brp enabled process, it is only set to kBrowserProcess on Linux and given the crash is in renderer per the issue title the feature would be unrelated.

    Regarding the other flag --enable-features=PartitionAllocBackupRefPtr:brp-mode/enabled I wasn't sure how to use it.

    You can ignore this flag, it only affects the memory reclaimer code path associated with the BRP feature. The crash you are seeing is from https://source.chromium.org/chromium/chromium/src/+/refs/tags/116.0.5845.188:base/allocator/partition_alloc_support.cc;l=1429-1430

    I would recommend the following as next steps:

  9. indutny-signal commented on Sep 14, 2023

    @indutny-signal
    Contributor

    I did a small foray into it and found out that Debug build just crashes outside of partition allocator 😂 I can reproduce the crash consistently on Fedora Linux, but if I delete everything from our preload - it doesn't seem to happen.

    I suspect that it could be our Neon rust addons that cause the trouble. Will look more into it today!

  10. bfurtonmw commented on Sep 14, 2023

    @bfurtonmw

    Adding a datapoint: our users are only running into this crash on shared Linux environments (i.e. multiple users, no root access). I also tested on a Debian 11 VM (VMWare Fusion on iMac host, macOS Ventura), and did not experience the crash. In the past, we've had to implement workarounds (--no-sandbox) on these kind of shared Debian machines due to setuid restrictions.

  11. 23 remaining items

  12. deepak1556 commented on Sep 28, 2023

    @deepak1556
    Member

    You can add the following to the fiddle before app.whenReady and minidump should be available at the path specified. If you want to change paths, update it before crashReporter.start

    console.log(app.getPath('crashDumps'))
    crashReporter.start({ submitURL: '', uploadToServer: false })
    

    should I simply attach the regular sytemd coredump instead?

    Yes you can also attach this.

  13. threema-danilo commented on Sep 28, 2023

    @threema-danilo
    Author

    Related, are you able to repro the issue using https://gist.github.com/8c61fa47716d73db04ad61fe0201c69e as fiddle test case with normal v26.2.2 builds ?

    Huh, I cannot reproduce the issue with the dcheck build. It reliably crashes with the regular 26.2.2 though.

    Here's the minidump for 26.2.2: 62b76819-9ebe-4f4c-9d33-b9486dc5f45e.dmp.zip

    Symbolicated backtrace:

    Thread 0 electron (crashed)
     0  electron!partition_alloc::internal::PartitionBucket::MaintainActiveList() [partition_bucket.cc : 1163 + 0x0]
         rax = 0x00002b5ec0001040    rdx = 0x00002b5ec0001040
         rcx = 0x0000000000000000    rbx = 0x000055b53b9720b0
         rsi = 0x0000000010600002    rdi = 0x00002b5ec0008020
         rbp = 0x00007ffec7b6af90    rsp = 0x00007ffec7b6af80
          r8 = 0x0000000010600002     r9 = 0x80cc4a00640f0000
         r10 = 0x0000000000000000    r11 = 0x0000000000000001
         r12 = 0x0000000000000000    r13 = 0x000055b53b8c0008
         r14 = 0x0000000000000000    r15 = 0x000055b53b9720b0
         rip = 0x000055b537241953
        Found by: given as instruction pointer in context
     1  electron!partition_alloc::PartitionRoot::PurgeMemory(int) [partition_root.cc : 1380 + 0x7]
         rbx = 0x0000000000000003    rbp = 0x00007ffec7b6b420
         rsp = 0x00007ffec7b6afa0    r12 = 0x0000000000000000
         r13 = 0x000055b53b8c0008    r14 = 0x000055b53b973488
         r15 = 0x000055b53b9720b0    rip = 0x000055b5372467ac
        Found by: call frame info
     2  electron!partition_alloc::MemoryReclaimer::Reclaim(int) [memory_reclaimer.cc : 89 + 0x7]
         rbx = 0x000055b53b8c0008    rbp = 0x00007ffec7b6b450
         rsp = 0x00007ffec7b6b430    r12 = 0x00000f64002c3420
         r13 = 0x000055b53b8c0008    r14 = 0x0000000000000003
         r15 = 0x000055b53b8c0018    rip = 0x000055b537240284
        Found by: call frame info
     3  electron!base::allocator::(anonymous namespace)::RunMemoryReclaimer(scoped_refptr<base::SequencedTaskRunner>) [partition_alloc_support.cc : 227 + 0x7]
         rbx = 0x00000f6400239730    rbp = 0x00007ffec7b6b4c0
         rsp = 0x00007ffec7b6b460    r12 = 0x00000000c1f115d8
         r13 = 0x000055b53b8c0008    r14 = 0xaaaaaaaaaaaaaaaa
         r15 = 0x00007ffec7b6b500    rip = 0x000055b53715b668
        Found by: call frame info
    ...
    

    My system information (in case it's useful):

    • CPU: AMD Ryzen 9 5950X
    • Arch Linux
    • Sway WM on Wayland
  14. deepak1556 commented on Sep 29, 2023

    @deepak1556
    Member

    @threema-danilo can you test with the following debug build as well, this is from our CI with latest 26-x-y. The build I created had enable_pkeys disabled which avoids creating a partition allocator pool used for V8 CFI. I had it disabled to investigate another crash but now I am curious if that also had impact on this bug or is it just debug builds generally avoid the crash.

  15. deepak1556 commented on Oct 3, 2023

    @deepak1556
    Member

    Friendly ping, if anyone else is able to reliably repro the issue please test the fiddle https://gist.github.com/8c61fa47716d73db04ad61fe0201c69e with following two debug builds and post the results. It would help move this issue forward, thanks!

    Debug build with threaded allocator disabled
    Debug build

  16. indutny-signal commented on Oct 3, 2023

    @indutny-signal
    Contributor

    Sorry for the delay. I'll give it a go tomorrow!

  17. indutny-signal commented on Oct 3, 2023

    @indutny-signal
    Contributor

    @deepak1556 the debug build with threaded allocator disabled doesn't crash, and the second debug build link has expired or otherwise unavailable!

  18. deepak1556 commented on Oct 4, 2023

    @deepak1556
    Member

    Sorry about the expired link, I have now republished the CI build here

  19. indutny-signal commented on Oct 10, 2023

    @indutny-signal
    Contributor

    @deepak1556 sorry, I only got around to it now. The build in your last comment crashes for me. Here's the stack trace: https://gist.github.com/indutny-signal/7bfdbc44dfd8fdad9513facee33cb5f5

  20. threema-danilo commented on Oct 12, 2023

    @threema-danilo
    Author

    @threema-danilo can you test with the following debug build as well, this is from our CI with latest 26-x-y.

    Sorry, I was travelling for 2 weeks.

    I just tested with the fiddle at https://gist.github.com/8c61fa47716d73db04ad61fe0201c69e. Just like @indutny-signal reported:

  21. andrewheadricke commented on Oct 12, 2023

    @andrewheadricke

    No longer an issue with the recently released 27.0.0

  22. deepak1556 commented on Oct 17, 2023

    @deepak1556
    Member

    Thanks @indutny-signal and @threema-danilo for the test results, they are helpful. I have pinged Chromium channel with the data gathered so far. I will update here once there are some next steps.

  23. deepak1556 commented on Nov 28, 2023

    @deepak1556
    Member

    Addressed in #40377, fix available with >= 26.4.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions