-
-
Notifications
You must be signed in to change notification settings - Fork 117
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
Crash when removing folders in sublime text #2516
Comments
See sublimelsp/LSP#2380 (comment) I think it's this: https://github.com/amphp/process/blob/v1.1.4/lib/Internal/Posix/Runner.php#L197
When there is an error, The php docs says nothing about null, but I think a null would be coerced to 0 so
phpactor is using an old version of amphp/process: v1.1.4 - the newest version is v2.0.1 so maybe it's fixed. The newer code looks a lot better. |
When `$pid` in `posix_kill($pid, $signo)` is `null` it kills other programs like Firefox, Terminal, even Gnome Shell. This patch adds a null check to avoid this. Discovered via phpactor in Sublime Text: removing several folders in quick succession causes `posix_kill` to be called with `null`, for whatever reason, which causes a bunch of programs to crash. See phpactor/phpactor#2516
This is an issue in amphp/process dependency. I've sent a patch: When it's merged, the dependency can be updated to get the patch. |
Neovim sometimes crashes when deleting folders, I wonder if it can be related. Upgrading to Amp 2.0 would be great in general, but also they switch to fibers, so not sure how much work it would be. The only place in the code I can find that directly invokes phpactor/lib/Amp/Process/ProcessUtil.php Line 23 in fa0413d
Did you identify the stack trace for when this happens in Sublime? |
I confirmed that it was the I could never discover why the pid is null. I assume there is an error somewhere, but there is no exception. I didn't get around to trying to use debugger to see what is happening. I also attempted to upgrade to Amp 2.0, but it's a little more complicated than I anticipated, so backed out of it. The issue might be fixed in v2. I seen related commits in the git log. Even if the issue is still v2, it's an easy null-check fix. |
When `$pid` in `posix_kill($pid, $signo)` is `null` it kills other programs like Firefox, Terminal, even Gnome Shell. This patch adds a null check to avoid this. Discovered via phpactor in Sublime Text: Removing several folders in quick succession causes `posix_kill` to be called with `null`, for whatever reason, which causes a bunch of programs to crash. See phpactor/phpactor#2516. Co-authored-by: Niklas Keller <me@kelunik.com>
The PR has been merged and tagged! - can you confirm the fix #2560 ? |
phpactor crashes including crashing other things like firefox, terminal, and also gnome shell itself. Obviously this is quiet a severe crash.
I'm using phpactor in Sublime Text LSP and can consistently reproduce the crash when removing several folders in quick succession. It's not the only context in which the crash occurs, but I can reproduce that one.
I reported the issue in the Sublime text LSP plugin, but I've narrowed the issue down to phpactor. There are additional details on the issue, but I'll add some here.
My Sublime Text lsp config, the configurations outside of "clients" don't seem to be relevant, but I'll show anyway:
I don't think it probably matters how I have it installed, but I have phpactor installed via composer. The
/usr/local/bin/phpactor
is symlinked tobin/phpactor
in my cloned phpactor repository which is installed, for example, like this':To reproduce the issue
I use my Sesame plugin so it's easy to remove folders quickly, but you can do it without Sesame, you just need to be quick with you mouse.
I enabled phpactor logging but there is nothing of note in the log.
Other notes
In Sublime the code to remove a folder is:
So you should be able to run the command via the console if you like:
Otherwise right click the folder in side bar and select Remove Folder from Project.
The text was updated successfully, but these errors were encountered: