Open clover2123 opened 8 months ago
Please check #1300 Note: the test stops when it runs the third test even without debugger for me.
@zherczeg Thank you for the quick patch! I'll try other apps to check if there are other issues in the debugger
the test stops when it runs the third test even without debugger for me.
What did you mean above? Running web-tooling-benchmark failed even without debugger?
@zherczeg I updated a new issue about debugger (please see the second one about multple processes/threads). Would you please check it?
The debugger uses TCP/IP for communication, and the port can be set. However, the port is currently not passed: https://github.com/Samsung/escargot/blob/master/src/shell/Shell.cpp#L1090
This should be easy to change.
In the python debugger, the port can be set with --address
option:
https://github.com/Samsung/escargot/blob/master/tools/debugger/debugger_core.py#L136
In vscode extension, the port can be set in launch.json
. The readme describes this:
https://github.com/Samsung/escargot-vscode-extension/blob/master/README.md
The summary is, that as long as each process creates a different tcp/ip port for communication, multiple processes can be debugged at the same time.
Unfortunately the debugger is not created with multi-threading in mind. It uses a single channel (tcp stream) for communication. If each thread uses a different socket, this should not cause any problem, since each context has an own debugger: https://github.com/Samsung/escargot/blob/master/src/runtime/Context.h#L384
However, if we would want to use a single socket for communication, that would be a challenging task. We should interleave the messages for different threads, and we need to know which thread is running, and which one is stopped.
What do you think? How Escargot does support multithreading? Does each worker have its own escargot instance?
@zherczeg Thanks for the quick reply!
The current Escargot is essentially a single-process/thread engine, not employing multi-process/thread explicitly.
However, in reality, third-party projects such as lwnode have already adopted a multi-process architecture.
It appears that lwnode utilizes extra processes through the Worker
feature, with each process assigned one Escargot instance. I will look into this further and provide a summary at a later time.
In my opinion, we need to enhance the Escargot debugger for multi-process cases; (currently, I think that multi-thread support is unnecessary because there is no use case yet for this).
This is not an urgent issue, so I will inform you once everything becomes clear. Thank you!
No problem. I think the key issue for multi process systems is finding / enumerating available socket ports. Each process should be able to automatically find a port where they can listen, and clients should be able to enumerate these ports to find which escargot they want to connect. There are many ways to do this, and we can discuss which one is preferred.
Escargot (please complete the following information):
Describe the bug
1. ~Get crashed when running a large-scale code~ [Fixed]
Debugger get crashed when running for a large-scaled source code. To reproduce the error, run web-tooling-benchmark source as below.
A crash occurred as follow
2. Debugger for multiple processes/threads
For cases when multiple processes or threads are running (e.g. WebWorker) Could debugger and vscode-extension still support these cases? If not, what should we do more to provide debugging for multiple of Escargot instances?