Repository: electron
Issue: [Bug]: Electron crashes on macOS when started with --v=4
Labels: platform/macOS,bug :beetle:,status/confirmed,29-x-y

### Preflight Checklist

- [X] I have read the [Contributing Guidelines](https://github.com/electron/electron/blob/main/CONTRIBUTING.md) for this project.
- [X] I agree to follow the [Code of Conduct](https://github.com/electron/electron/blob/main/CODE_OF_CONDUCT.md) that this project adheres to.
- [X] I have searched the [issue tracker](https://www.github.com/electron/electron/issues) for a bug report that matches the one I want to file, without success.

### Electron Version

30.0.0-nightly.20231214

### What operating system are you using?

macOS

### Operating System Version

13.5

### What arch are you using?

arm64 (including Apple Silicon)

### Last Known Working Electron version

It's present at least since 22.3.7

### Expected Behavior

1. Start Electron with `--enable-logging=stderr --v=4` i.e.:
```
./Electron.app/Contents/MacOS/Electron --enable-logging=stderr --v=4
```
2. Electron starts

### Actual Behavior

Electron crashes with following callstack:
```
Thread 0 Crashed:: CrBrowserMain Dispatch queue: com.apple.main-thread
0   Electron Framework            	       0x11f1b5224 viz::(anonymous namespace)::ProcessStack(std::__Cr::basic_ostringstream<char, std::__Cr::char_traits<char>, std::__Cr::allocator<char>>&, std::__Cr::vector<viz::(anonymous namespace)::StackFrame, std::__Cr::allocator<viz::(anonymous namespace)::StackFrame>>&, std::__Cr::vector<std::__Cr::unique_ptr<viz::CompositorRenderPass, std::__Cr::default_delete<viz::CompositorRenderPass>>, std::__Cr::allocator<std::__Cr::unique_ptr<viz::CompositorRenderPass, std::__Cr::default_delete<viz::CompositorRenderPass>>>> const&) + 708
1   Electron Framework            	       0x11f1b4b74 viz::TransitionUtils::RenderPassListToString(std::__Cr::vector<std::__Cr::unique_ptr<viz::CompositorRenderPass, std::__Cr::default_delete<viz::CompositorRenderPass>>, std::__Cr::allocator<std::__Cr::unique_ptr<viz::CompositorRenderPass, std::__Cr::default_delete<viz::CompositorRenderPass>>>> const&) + 688
2   Electron Framework            	       0x11f1c30f0 cc::LayerTreeHostImpl::DrawLayers(cc::LayerTreeHostImpl::FrameData*) + 1136
3   Electron Framework            	       0x11f23fac4 cc::SingleThreadProxy::DoComposite(cc::LayerTreeHostImpl::FrameData*) + 244
4   Electron Framework            	       0x11f241bd4 non-virtual thunk to cc::SingleThreadProxy::ScheduledActionDrawIfPossible() + 168
5   Electron Framework            	       0x11f2356d8 cc::Scheduler::DrawIfPossible() + 248
6   Electron Framework            	       0x11f2315d8 cc::Scheduler::ProcessScheduledActions() + 2240
7   Electron Framework            	       0x11f23494c cc::Scheduler::OnBeginImplFrameDeadline() + 332
8   Electron Framework            	       0x117e663d8 base::OnceCallback<void ()>::Run() && + 68
9   Electron Framework            	       0x11cffd524 base::DeadlineTimer::OnScheduledTaskInvoked() + 96
10  Electron Framework            	       0x117e663d8 base::OnceCallback<void ()>::Run() && + 68
11  Electron Framework            	       0x11cfccf14 base::DefaultDelayedTaskHandleDelegate::RunTask(base::OnceCallback<void ()>) + 48
12  Electron Framework            	       0x1197114ec base::internal::Invoker<base::internal::BindState<void (network::SharedStorageRequestHelper::*)(base::OnceCallback<void ()>), base::WeakPtr<network::SharedStorageRequestHelper>, base::OnceCallback<void ()>>, void ()>::RunOnce(base::internal::BindStateBase*) + 104
13  Electron Framework            	       0x117e663d8 base::OnceCallback<void ()>::Run() && + 68
14  Electron Framework            	       0x117e663d8 base::OnceCallback<void ()>::Run() && + 68
15  Electron Framework            	       0x11cf8f6d4 base::TaskAnnotator::RunTaskImpl(base::PendingTask&) + 272
16  Electron Framework            	       0x11cfbf388 base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWorkImpl(base::LazyNow*) + 1392
17  Electron Framework            	       0x11cfbeac0 base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWork() + 104
18  Electron Framework            	       0x11d028c0c base::MessagePumpCFRunLoopBase::RunWork() + 328
19  Electron Framework            	       0x11d027644 base::apple::CallWithEHFrame(void () block_pointer) + 16
20  Electron Framework            	       0x11d027ef8 base::MessagePumpCFRunLoopBase::RunWorkSource(void*) + 68
21  CoreFoundation                	       0x19040e63c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28
22  CoreFoundation                	       0x19040e5d0 __CFRunLoopDoSource0 + 176
23  CoreFoundation                	       0x19040e340 __CFRunLoopDoSources0 + 244
24  CoreFoundation                	       0x19040cf48 __CFRunLoopRun + 828
25  CoreFoundation                	       0x19040c4b8 CFRunLoopRunSpecific + 612
26  HIToolbox                     	       0x199c5edf0 RunCurrentEventLoopInMode + 292
27  HIToolbox                     	       0x199c5ec2c ReceiveNextEventCommon + 648
28  HIToolbox                     	       0x199c5e984 _BlockUntilNextEventMatchingListInModeWithFilter + 76
29  AppKit                        	       0x19363397c _DPSNextEvent + 636
30  AppKit                        	       0x193632b18 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 716
31  AppKit                        	       0x193626f7c -[NSApplication run] + 464
32  Electron Framework            	       0x11d029850 base::MessagePumpNSApplication::DoRun(base::MessagePump::Delegate*) + 396
33  Electron Framework            	       0x11d0276c4 base::MessagePumpCFRunLoopBase::Run(base::MessagePump::Delegate*) + 112
34  Electron Framework            	       0x11cfc0204 base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::Run(bool, base::TimeDelta) + 688
35  Electron Framework            	       0x11cf6fdac base::RunLoop::Run(base::Location const&) + 592
36  Electron Framework            	       0x11ba24d3c content::BrowserMainLoop::RunMainMessageLoop() + 180
37  Electron Framework            	       0x11ba26d70 content::BrowserMainRunnerImpl::Run() + 44
38  Electron Framework            	       0x11ba21364 content::BrowserMain(content::MainFunctionParams) + 160
39  Electron Framework            	       0x11824cb0c content::RunBrowserProcessMain(content::MainFunctionParams, content::ContentMainDelegate*) + 280
40  Electron Framework            	       0x11824f0c8 content::ContentMainRunnerImpl::RunBrowser(content::MainFunctionParams, bool) + 1924
41  Electron Framework            	       0x11824e794 content::ContentMainRunnerImpl::Run() + 1184
42  Electron Framework            	       0x11824c12c content::RunContentProcess(content::ContentMainParams, content::ContentMainRunner*) + 1216
43  Electron Framework            	       0x11824c370 content::ContentMain(content::ContentMainParams) + 100
44  Electron Framework            	       0x117e5ec88 ElectronMain + 128
45  dyld                          	       0x18ffd7f28 start + 2236
```

### Testcase Gist URL

_No response_

### Additional Information

_No response_