Repository navigation
Eclipse Lock up when debugging with Jlink #619
Description
Activity
There are quite a lot of exceptions in the logs, this is probably a bug.
I'll try to investigate, but it might take some time.
Hello, Liviu Ionescu,
I am very interested in this issue and have been working to reproduce it.
Here is my setup:
- SEGGER J-Link GDB Server V7.96g
- Windows 11
- STM32F407 development board
- J-Link V9 (SWD interface)
- Debug version of Eclipse Embed-CDT built from the source code in this repository
The steps to reproduce the issue are as follows:
- Connect the J-Link to the STM32 development board.
- Create a new LED template project using Embed-CDT.
- Set up a new J-Link debugging configuration and start debugging.
- After hitting a breakpoint, unplug the J-Link (please note that this is not the same as disconnecting the power supply to the development board. Based on my testing, removing the power supply does not reproduce the issue).
Result
The IDE suddenly becomes extremely slow and eventually freezes without reporting any errors.
eclipse_error.logThe debug log I captured is almost identical to the one shared here. Strangely, even though the freeze in Eclipse is caused by J-Link, there are almost no J-Link-related exceptions in the log. Instead, there are many exceptions related to SWT handles and the UI event loop.
Solution
Since the issue seems related to the UI events, I noticed that there appears to be an anomaly in J-Link's semi-hosting mode, where there are many unrecognized characters being printed. The issue seems to stem from here! The semi-hosting thread continuously printing data likely consumes a large number of SWT handles. As a result, the UI is not actually frozen; instead, the excessive printing in semi-hosting mode consumes so many resources that Eclipse runs very slowly.
To verify my hypothesis, I modified the input/output stream part of the SemihostingProcess in the code. I added a 1-second delay each time it printed to the console. After making this change, when I repeated the steps above, the IDE no longer froze! (In fact, I also tried disabling the console output, and the result was the same.)


I am interested in the Eclipse Embed IDE and would love to fix this bug myself, though I may need some guidance along the way. This would also be my first time submitting code to an open-source project. Unfortunately, I am currently in the middle of my university's exam week, so the next couple of weeks will be quite busy. However, I hope to be able to work on it once things settle down.
If you would be open to this, I would be truly grateful for the opportunity.
Thank you for your time and consideration!
Frankly, the Eclipse Embedded GDB code is very old and I have difficulties to follow the details. We'll need someone from the Eclipse CDT project to help us.
Discussed in #618
Originally posted by trampas October 4, 2024
I have been having long term issue where Eclipse locks up when debugging with Jlink. Read here for more detail: eclipse-cdt/cdt#906 (comment)