Observed in CI: https://app.circleci.com/pipelines/github/electron/electron/30672/workflows/69ab6601-3698-411b-8906-93c9aca28870/jobs/675633

```
Received signal 11 SEGV_MAPERR 000000000048
0   Electron Framework                  0x0000000116967079 base::debug::CollectStackTrace(void**, unsigned long) + 9
1   Electron Framework                  0x0000000116861a13 base::debug::StackTrace::StackTrace() + 19
2   Electron Framework                  0x0000000116966f41 base::debug::(anonymous namespace)::StackDumpSignalHandler(int, __siginfo*, void*) + 2385
3   libsystem_platform.dylib            0x00007fff68c005fd _sigtramp + 29
4   ???                                 0x00000001026a2a00 0x0 + 4335479296
5   Electron Framework                  0x0000000111155798 base::ObserverList<content::SerialDelegate::Observer, false, true, base::internal::CheckedObserverAdapter>::RemoveObserver(content::SerialDelegate::Observer const*) + 104
6   Electron Framework                  0x0000000111158b20 electron::SerialChooserController::~SerialChooserController() + 256
7   Electron Framework                  0x00000001111535fc electron::ElectronSerialDelegate::~ElectronSerialDelegate() + 124
8   Electron Framework                  0x00000001110ed524 electron::ElectronBrowserClient::~ElectronBrowserClient() + 132
9   Electron Framework                  0x00000001110ed5ee electron::ElectronBrowserClient::~ElectronBrowserClient() + 14
10  Electron Framework                  0x0000000110fdbde7 ElectronMain + 151
```
shell/browser/serial/serial_chooser_controller.cc
std::vector<device::mojom::SerialPortInfoPtr> ports) {
  
  std::sort(ports.begin(), ports.end(),
            [](const auto& port1, const auto& port2) {
              return port1->path.BaseName() < port2->path.BaseName();
            });
  for (auto& port : ports) {
    if (FilterMatchesAny(*port))
      ports_.push_back(std::move(port));
  }
  bool prevent_default = false;
  api::Session* session = GetSession();
  if (session) {
    prevent_default =
        session->Emit("select-serial-port", ports_, web_contents(),
                      base::AdaptCallbackForRepeating(base::BindOnce(
                          &SerialChooserController::OnDeviceChosen,
                          weak_factory_.GetWeakPtr())));
  }
  if (!prevent_default) {
    RunCallback(nullptr);
  }
}
bool SerialChooserController::FilterMatchesAny(