-
Notifications
You must be signed in to change notification settings - Fork 9
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
Failure to open pty followed by panic #18
Comments
What is the output of |
I opened a new terminal, and the strace showed |
It also fails to find |
Hi!
The reason that you can't find the file after ugdb crashes is that the
pty in question is not the one that your terminal emulator
uses/provides, but instead a second pty that is created by ugdb itself
and passed to gdb (and subsequently its child, the debuggee process) so
that we can interact with it in a separate terminal "window"/pane within
ugdb (at the bottom right). As far as I know, the slave part of the tty
(/dev/pts/...) only lives as long as the process that created the master
part, which is ugdb itself. So, when you try to stat `/dev/pts/2` (the
path from strace) the file does not exist anymore.
The pty is created here:
https://github.com/ftilde/unsegen_terminal/blob/74c1b2c9367b7f7cbd71f761ff45d450f1efc9d1/src/pty/mod.rs#L174
The call that fails here is probably `grantpt` since according to its
man page "The user ID of the slave is set to the real UID of the calling
process. The group ID is set to an unspecified value (e.g., tty)."
which sounds like it would match the failed `chown` call.
To confirm this, maybe you could try to run a short c program with
`posix_openpt` and `grantpt` and see if this fails as well.
I'm still not sure *why* this would fail for you, though. Somewhat
related to this I found the following stackoverflow post:
https://stackoverflow.com/questions/31533523/grantpt-report-error-after-unshare
Do you (try to) run ugdb in a container/user namespace?
Another thing to note is that devpts seems to be mounted with different
options on my system:
$ mount | grep devpts
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
Maybe this (mode=620 vs mode=600 or the missing gid=5) is the problem?
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, I came across ugdb while looking for a better alternative to gdb's builtin TUI, so I'm grateful that an alternative exists. Unfortunately, I cannot run ugdb, as it panics with the message "Could not create pty.". The log file saved in /tmp is empty, so I'm going to post a bit of an strace instead. Is it possible to implement a fix or workaround? Other TUI programs like vim work well in the same environment.
A quick google search suggested that it might have to do with devpts (most of it went over my head though), so here's the mount as well:
Strace:
The text was updated successfully, but these errors were encountered: