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

Running out of pty devices when building workspace #46

Open
kdhansen opened this issue Jan 12, 2018 · 9 comments
Open

Running out of pty devices when building workspace #46

kdhansen opened this issue Jan 12, 2018 · 9 comments

Comments

@kdhansen
Copy link

I am installing Lunar on my Mac using Mike Purvis' OSX install script. When executing catkin build, this error pops up after a while, and with different packages. It seems like my computer is running out of pty's.

Errors     << control_msgs:install /Users/kdh/ros-install-osx/lunar_desktop_full_ws/logs/control_msgs/build.install.001.log
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/catkin_tools/execution/executor.py", line 109, in async_job
    **stage.async_execute_process_kwargs))
  File "/usr/local/lib/python2.7/site-packages/trollius/tasks.py", line 259, in _step
    result = coro.send(value)
  File "/usr/local/lib/python2.7/site-packages/osrf_pycommon/process_utils/async_execute_process_trollius.py", line 69, in _async_execute_process_pty
    stderr_master, stderr_slave = pty.openpty()
  File "/usr/local/Cellar/python/2.7.14_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pty.py", line 29, in openpty
    master_fd, slave_name = _open_terminal()
  File "/usr/local/Cellar/python/2.7.14_2/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

I would suggest to check whether there is available pty's before opening a new. I will not try and fix it my self as I have no idea what the code does :)

The problem might also be that the code is leaking pty's; that the OS is waiting for the code to close them. In the code line 65 to 69 I can see that stdout_master and stderr_master is opened but never closed. I guess that is because they would close upon termination of the process, but the process might be hanging?

@qh-huang
Copy link

I just ran into the same issue.

@nuclearsandwich
Copy link
Member

I just ran into the same issue.

@qiao-tw Did you hit this running the same configuration as the original reporter?

@qh-huang
Copy link

@nuclearsandwich Yes. I met this problem while building the ROS source following the steps provided by Mike Purvis' repo, and it happened on command catkin build --limit-status-rate 1
Eventually, I complete the installation by manually build each package separately to avoid running out of pty devices.

@wjwwood
Copy link
Member

wjwwood commented Jan 30, 2018

@qiao-tw I don't remember specifically, but you can also try the --no-color option, which might prevent it from using pty's.

@qh-huang
Copy link

@wjwwood I just tried the --no-color option but the issue is still there.
Thanks anyway.

@jonfink
Copy link

jonfink commented Mar 5, 2018

Quick note to confirm I'm also seeing this issue now...

  • OSX High Sierria (10.13.3)
  • Homebrew python 3.6.3
  • catkin_tools (0.4.4)
  • catkin (0.7.6) (did just realize there are newer versions of this, will try one later today)

@jonfink
Copy link

jonfink commented Mar 6, 2018

FWIW, a hack to fix is to preface Line 56 of async_execute_process_trollius with has_pty = False to disable the pty emulation...

I can't quite determine what I'm losing by doing this - perhaps someone can weigh in?

@wjwwood
Copy link
Member

wjwwood commented Mar 6, 2018

@jonfink the purpose of the has_pty is to use pty's to emulate a tty for the called process. This makes it appear to the called process that it is being called from a terminal, which in most programs does things like turn on colored output and sometimes some other behaviors like how the stdout is buffered. So specifically this is required for the make file generated by cmake to output colors and for catkin_tools to capture the colors.

That's why I suggested elsewhere that using without colors would workaround this as well, but apparently that's not sufficient.

Sorry, I don't have time to dig into it more just yet.

@daleworley
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants