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

Error: Out of pty's #87

Open
DanielJonesEB opened this issue Nov 22, 2017 · 11 comments
Open

Error: Out of pty's #87

DanielJonesEB opened this issue Nov 22, 2017 · 11 comments

Comments

@DanielJonesEB
Copy link

iTerm 2 Build 3.1.5.beta.2
macOS High Sierra 10.13.1 (17B48)

$ ttyrec myrecording
Out of pty's
Terminated: 15

Any suggestions?

@icholy
Copy link
Owner

icholy commented Nov 22, 2017

Did you build ttyrec yourself?

@DanielJonesEB
Copy link
Author

Thanks for the prompt response. No, I used brew:

$ brew info ttyrec
ttyrec: stable 1.0.8 (bottled)
Terminal interaction recorder and player
http://0xcc.net/ttyrec/
/usr/local/Cellar/ttyrec/1.0.8 (9 files, 45.2KB) *
  Poured from bottle on 2017-11-22 at 14:11:31
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/ttyrec.rb

@icholy
Copy link
Owner

icholy commented Nov 22, 2017

Not too sure what's happening, but here's some stuff to try:

Build ttyrec with -DSVR4

wget http://0xcc.net/ttyrec/ttyrec-1.0.8.tar.gz
tar -xf ttyrec-1.0.8.tar.gz
cd ttyrec-1.0.8

# Add -DSVR4 to line 2 of the Makefile
# CFLAGS = -O2 -DSVR4

make
./ttyrec myrecoding

If that doesn't work, post the output to the following.

# strace
strace ttyrec myrecording

# open pty's
ls /dev/pts

# max ptys
cat /proc/sys/kernel/pty/max

@berndtj
Copy link

berndtj commented Nov 22, 2017

I just hit this as well, installed via brew

@Dids
Copy link

Dids commented Nov 29, 2017

Same and via brew. Using Hyper terminal though.

@icholy
Copy link
Owner

icholy commented Nov 29, 2017

I don't have a mac to debug this on. The problem is here somewhere https://github.com/mjording/ttyrec/blob/c4fd0f2bc69dba852526df3610f98d867ba5ab24/ttyrec.c#L404-L435
I think we should be using https://linux.die.net/man/3/posix_openpt

@Dids
Copy link

Dids commented Nov 30, 2017

Since wget doesn't exist on macOS by default, I had to install it with brew install wget.

Just for reference, here's the build output without the -DSVR4 flag:

> make
gcc -O2   -c -o ttyrec.o ttyrec.c
ttyrec.c:363:9: warning: implicit declaration of function 'kill' is invalid in C99
      [-Wimplicit-function-declaration]
        (void) kill(0, SIGTERM);
               ^
1 warning generated.
gcc -O2   -c -o io.o io.c
io.c:161:1: warning: control may reach end of non-void function [-Wreturn-type]
}
^
1 warning generated.
gcc -O2 -o ttyrec ttyrec.o io.o
gcc -O2   -c -o ttyplay.o ttyplay.c
ttyplay.c:271:5: warning: implicit declaration of function 'set_progname' is invalid in C99
      [-Wimplicit-function-declaration]
    set_progname(argv[0]);
    ^
1 warning generated.
gcc -O2 -o ttyplay ttyplay.o io.o
gcc -O2   -c -o ttytime.o ttytime.c
ttytime.c:64:5: warning: implicit declaration of function 'set_progname' is invalid in C99
      [-Wimplicit-function-declaration]
    set_progname(argv[0]);
    ^
1 warning generated.
gcc -O2 -o ttytime ttytime.o io.o

After changing the build flags and attempting to build, I got the following error:

> make
gcc -O2 -DSVR4   -c -o ttyrec.o ttyrec.c
ttyrec.c:60:10: fatal error: 'stropts.h' file not found
#include <stropts.h>
         ^~~~~~~~~~~
1 error generated.
make: *** [ttyrec.o] Error 1

You can see here that stropts.h isn't supposed on macOS, so that's definitely a no go.

Additionally, strace, /dev/pts and /proc/sys/kernel/pty/max don't exist on macOS either.

@icholy
Copy link
Owner

icholy commented Dec 12, 2017

Ugh ... hopefully someone will better osx knowledge stumbles onto this.

@berndtj
Copy link

berndtj commented Dec 12, 2017

If I have some time, I'll see if I can investigate myself.

@yugandhar-pathi
Copy link

Me too get this issue on Mac.

@kwrobel
Copy link

kwrobel commented Mar 5, 2020

Same issue here. Installed via Macports.

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