question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Mac OS is crashing when debugger stops on a breakpoint

See original GitHub issue

I’ve encountered an issue with multiple Mac laptops running the latest Catalina OS.

The scenario is running 2 processes with Feathers services & feathers-distributed and stopping the first process on a debug breakpoint. when it happens, the second process keeps sending hello messages on the channels. this is causing “socket stress” and leads to TCP Zero-Window issue. a short while after that, the OS is crashing and reboots (sort of Apple bug).

The solution that I’ve come with is to run the second process as a fork of the first process, send it heartbeat messages every second. when the fork detects the absent of the heartbeat messages for more than 2 seconds, it will stop all channels opened by feathers-distributed and will resume them when heartbeat is received again.

I’m wondering if this a known issue, because it is reproduced easily locally with Redis or broadcast, though the workaround applies only to Redis. with broadcast, the process will fail after resuming the channels due to closed socket.

This is the gist of stopping/resuming all channels:

const stopChannels = app => {
  stop(app.serviceSubscriber);
  stop(app.servicePublisher);

  for (const service of Object.values(app.services)) {
    stop(service.requester);
    stop(service.responder);
    stop(service.serviceEventsSubscriber);
    stop(service.serviceEventsPublisher);
  }
};

const startChannels = app => {
  start(app.serviceSubscriber);
  start(app.servicePublisher);

  for (const service of Object.values(app.services)) {
    start(service.requester);
    start(service.responder);
    start(service.serviceEventsSubscriber);
    start(service.serviceEventsPublisher);
  }
};

const stop = channel => {
  if (channel)
    channel.discovery.stop();
};

const start = channel => {
  if (channel)
    channel.discovery.start();
};

We can integrate this into the library, since the project should not manage the list of opened channels.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
claustrescommented, Jan 15, 2020
0reactions
dekelevcommented, Jan 13, 2020

Thanks. It usually takes a minute or two to crash the OS with ~150 services (without Feathers events publishing) and for a developer, holding on a breakpoint for more than a minute is not a rare use-case.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Debugger crashes if breakpoint set…
Message from debugger: The LLDB RPC server has crashed. You may need to manually terminate your process. The crash log is located in...
Read more >
Xcode. Unable to stop at breakpoint
When the app reaches the breakpoint it stops there for a second and then the debugger crashes. (The app doesn't crash, only the...
Read more >
lldb-mi freezes on MacOS when breaking near uninitialised ...
I am on MacOS Monterey, v12.3.1, Intel CPU. I was able to hit breakpoints, but then realized my debugger controls (Continue, Step Over,...
Read more >
Visual studio for mac debugger crashes
As a workaround, in Visual Studio's settings, in the Projects -> Debugger panel, you can disable the option “Debug project code only”, and...
Read more >
Troubleshooting common PHP debugging issues
Using the Run | View Breakpoints menu command Ctrl+Shift+F8 , check that breakpoints are enabled. Select the checkbox next to a breakpoint to ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found