-
Notifications
You must be signed in to change notification settings - Fork 3
Weird deadlock (livelock?) in _posix.py when trying to run /usr/bin/env #3
Copy link
Copy link
Open
Description
I've run into this on two totally different versions of sublime text (3 and 4) on two totally different platforms (macOS and Linux) and I seem to be the only one who has so it must be something real weird about my configuration buuuuuuuuut
This line hangs when I try to use an ST package which uses shellenv, such as Rust Enhanced:
https://github.com/codexns/shellenv/blob/master/all/shellenv/_posix.py#L61
The bash process itself hangs, consuming 100% CPU of one core, but not doing any I/O.
I have no idea why this happens, but my workaround was to modify _posix.py to use bash's -c flag instead of writing the command to its standard input:
if shell_name == 'bash':
args.append('-i')
args.append('-c') # <----------- added
args.append('/usr/bin/env') # <----------- added
env_proc = subprocess.Popen(
args,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT
)
if shell_name == 'bash': # <------- changed
stdout, _ = env_proc.communicate() # <------- changed
else: # <------- changed
stdout, _ = env_proc.communicate(b'/usr/bin/env\n') # <------- changedit now works flawlessly.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels