-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect handling of exited threads in debugger #12112
Comments
@EvilBeaver do you happen to have additional details to consistently reproduce the bug? |
To reproduce this, you'll need to have no threads debugged (all exited), but debug session still active. I suppose it's hard to achieve in node.js, cause it's usually single threaded and all threads exit also means session exit. |
I have tried to reproduce this issue using multiple threads spawned by the following 'javascript' program, the following recording shows the execution: Any additional ideas on how to reproduce this issue are very welcome ! const { spawn } = require('child_process');
const numberOfThreads = 5;
const threadDuration = 5000;
const createInterval = 1000;
function spawnThread() {
const child = spawn('node', ['-e', `setTimeout(() => {}, ${threadDuration});`]);
child.on('spawn', () => {
console.log(`Thread ${child.pid} created`);
});
child.on('close', () => {
console.log(`Thread ${child.pid} exited`);
});
}
let threadsSpawned = 0;
const intervalId = setInterval(() => {
spawnThread();
threadsSpawned++;
if (threadsSpawned === numberOfThreads) {
clearInterval(intervalId);
}
}, createInterval); |
@alvsan09 I don't know how to reproduce this in node debugger. I'm writing a debug adapter for another language. Here's a code line with a problem: https://github.com/eclipse-theia/theia/blob/master/packages/debug/src/browser/debug-session.tsx#L912 nobody deletes a thread from In your example you need to have |
Bug Description:
If debug thread is exited it does not removed from the threads panel till next stop and Threads request to debug adapter.
This leads to incorrect display and sometimes to broken debugger behavior.
Steps to Reproduce:
Expected: no running threads shown, showing Session only, as it was at very beginning.
Things are getting worse if there's multiple stopped threads and they all continued to the exit.
On the picture Thread 24 already exited and not running.
Expected that threads panel looks like this when no debuggable threads available
Additional Information
It seems it should be fixed here https://github.com/eclipse-theia/theia/blob/master/packages/debug/src/browser/debug-session.tsx#L912, need to remove thread from
this._threads
on thread exited.The text was updated successfully, but these errors were encountered: