Skip to content
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

调试时无法重启 #16

Open
lyzz0612 opened this issue Dec 4, 2019 · 0 comments
Open

调试时无法重启 #16

lyzz0612 opened this issue Dec 4, 2019 · 0 comments

Comments

@lyzz0612
Copy link

lyzz0612 commented Dec 4, 2019

升级了vscode版本到1.40.11.40.2,之后调试时点击重启按钮直接关闭没反应。开发工具日志如下:

  ERR TypeError [ERR_UNKNOWN_SIGNAL]: Unknown signal: SIGUP
    at convertToValidSignal (internal/util.js:229:9)
    at ChildProcess.kill (internal/child_process.js:463:5)
    at LuaDebug.disconnectRequest (c:\Users\ASUS\.vscode\extensions\wellshsu.luaide-lite-0.2.0\out\src\debugger\LuaDebug.js:133:31)
    at LuaDebug.dispatchRequest (c:\Users\ASUS\.vscode\extensions\wellshsu.luaide-lite-0.2.0\node_modules\vscode-debugadapter\lib\debugSession.js:347:22)
    at LuaDebug._handleData (c:\Users\ASUS\.vscode\extensions\wellshsu.luaide-lite-0.2.0\node_modules\vscode-debugadapter\lib\protocol.js:97:38)
    at Socket.<anonymous> (c:\Users\ASUS\.vscode\extensions\wellshsu.luaide-lite-0.2.0\node_modules\vscode-debugadapter\lib\protocol.js:18:44)
    at Socket.emit (events.js:200:13)
    at addChunk (_stream_readable.js:294:12)
    at readableAddChunk (_stream_readable.js:275:11)
    at Socket.Readable.push (_stream_readable.js:210:10): Error: TypeError [ERR_UNKNOWN_SIGNAL]: Unknown signal: SIGUP
    at convertToValidSignal (internal/util.js:229:9)
    at ChildProcess.kill (internal/child_process.js:463:5)
    at LuaDebug.disconnectRequest (c:\Users\ASUS\.vscode\extensions\wellshsu.luaide-lite-0.2.0\out\src\debugger\LuaDebug.js:133:31)
    at LuaDebug.dispatchRequest (c:\Users\ASUS\.vscode\extensions\wellshsu.luaide-lite-0.2.0\node_modules\vscode-debugadapter\lib\debugSession.js:347:22)
    at LuaDebug._handleData (c:\Users\ASUS\.vscode\extensions\wellshsu.luaide-lite-0.2.0\node_modules\vscode-debugadapter\lib\protocol.js:97:38)
    at Socket.<anonymous> (c:\Users\ASUS\.vscode\extensions\wellshsu.luaide-lite-0.2.0\node_modules\vscode-debugadapter\lib\protocol.js:18:44)
    at Socket.emit (events.js:200:13)
    at addChunk (_stream_readable.js:294:12)
    at readableAddChunk (_stream_readable.js:275:11)
    at Socket.Readable.push (_stream_readable.js:210:10)
    at t.RawDebugSession.handleErrorResponse (file:///D:/vs_code/resources/app/out/vs/workbench/workbench.desktop.main.js:2798:1003)
    at file:///D:/vs_code/resources/app/out/vs/workbench/workbench.desktop.main.js:2798:434
    at processTicksAndRejections (internal/process/task_queues.js:89:5)
    at async t.RawDebugSession.shutdown (file:///D:/vs_code/resources/app/out/vs/workbench/workbench.desktop.main.js:2796:536)
    at async R.terminate (file:///D:/vs_code/resources/app/out/vs/workbench/workbench.desktop.main.js:5173:637)
    at async q.restartSession (file:///D:/vs_code/resources/app/out/vs/workbench/workbench.desktop.main.js:5197:851)

SIGUP的确是不存在此signal,猜测应该为SIGHUP
但改为SIGHUP后出现新的报错

ERR Error: kill ENOSYS
    at ChildProcess.kill (internal/child_process.js:476:13)
    at LuaDebug.disconnectRequest (c:\Users\ASUS\.vscode\extensions\wellshsu.luaide-lite-0.2.0\out\src\debugger\LuaDebug.js:133:31)
    at LuaDebug.dispatchRequest 

不传signal使用默认值SIGTERM则好像无法关闭子进程,尝试了另外几个signal后,发现和此issue表现一致

暂时的解决方案:

    disconnectRequest(response, args) {
        this.sendEvent(new vscode_debugadapter_1.OutputEvent("Server is shutdown.\n"));
        if (this.luaStartProc) {           
            try {
                this.luaStartProc.kill("SIGHUP");   //会报错但能关闭子进程,加catch使其不中断能正常重启
            } catch (error) {
            }
        }
        super.disconnectRequest(response, args);
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant