I’m trying to debug a native process crash issue on MacOS. What I’m finding is that whenever I do this, Python pegs the CPU at 100% and my battery starts rapidly draining. The only way I’m able to get this to stop is to kill Python. The process I’m trying to debug is crashing and I’m trying to narrow down the crash, so maybe this is causing some sort of race condition within the code that interfaces with gdb. This is really frustrating since whenever I’m done debugging I have to go make sure to manually kill Python to prevent excessive CPU drain.
Is this a known issue and is there anything I can do to help narrow down what’s going on here? (I’m not well versed in MacOS system tracing.)
When using the CLI I am not seeing this problem occur. I can see the process segfaulting and I can get information from gdb manually. There’s no runaway CPU usage and when I quite gdb, the pio wrapper exits cleanly.
This appears to be something specific to how VSCode is interacting with gdb behind the scenes. When looking at VSCode’s task manager I don’t see any high usage from VSCode itself or from the PlatformIO extension.
If your issue only occurs within VSCode + PlatformIO, please file an issue in Issues · platformio/platformio-vscode-ide · GitHub. Debugging a segfaulting program might be an edge case in which it goes in an infinite loop somewhere. Provide the platformio.ini and minimal program too.