catkin / catkin_tools

Command line tools for working with catkin
Apache License 2.0
163 stars 146 forks source link

out of pty devices error on OSX High Sierra #501

Open fmina opened 6 years ago

fmina commented 6 years ago

System Info

I just upgraded my OS to High Sierra, now I am facing a strange problem when I compile the catkin workspace. After compiling around 35 packages, I get the following error:

Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/catkin_tools/execution/executor.py", line 109, in async_job
    **stage.async_execute_process_kwargs))
  File "/Library/Python/2.7/site-packages/trollius/tasks.py", line 259, in _step
    result = coro.send(value)
  File "/Library/Python/2.7/site-packages/osrf_pycommon/process_utils/async_execute_process_trollius.py", line 65, in _async_execute_process_pty
    stdout_master, stdout_slave = pty.openpty()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pty.py", line 29, in openpty
    master_fd, slave_name = _open_terminal()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pty.py", line 70, in _open_terminal
    raise os.error, 'out of pty devices'
OSError: out of pty devices

which simply means the system is running out of pty terminals.

I checked the maximum number of possible pty using the following command:

sysctl -a | grep kern.tty

and it returns 255. If I change this value to something large like 999, the compilation stops with the same error after around 150 packages.

Any idea how to fix this issue?

wjwwood commented 6 years ago

I would have thought increasing the pty's on the system would have helped, but perhaps you need to set it in the system files and reboot (assuming that's not what you did already)?

Otherwise, it's related to https://github.com/osrf/osrf_pycommon/issues/46 (likely the root cause, not something in this repository).

I don't have time to dig in myself, but I'd also suggest trying catkin_tools with Python3, perhaps their openpty implementation is more up-to-date (assuming it's something that changed in high sierra).

daleworley commented 5 years ago

You likely ran into the same problem I had on High Sierra with Emacs shell windows (https://stackoverflow.com/questions/53531777/cannot-open-pty-under-mac-os-high-sierra/53581958#53581958) -- High Sierra uses a different mechanism for allocating pty's than earlier Mac OS X releases, so if your code isn't reconfigured for it, it will fail to allocate a pty.