-
Notifications
You must be signed in to change notification settings - Fork 205
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
Accidental PTY hijack #982
Comments
@janesser I think I understand the problem you are facing, but I can't reproduce it. This is what I see, each new terminal is getting a new pts, for example: Text version of above image: $ ps
PID TTY TIME CMD
1267639 pts/29 00:00:00 bash
1268175 pts/29 00:00:00 ps
$ lsof -p 1267639
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
bash 1267639 jonah cwd DIR 259,5 4096 5242882 /home/jonah
bash 1267639 jonah rtd DIR 259,5 4096 2 /
bash 1267639 jonah txt REG 259,5 1446024 7340495 /usr/bin/bash
bash 1267639 jonah mem REG 259,5 5719296 7375236 /usr/lib/locale/locale-archive
bash 1267639 jonah mem REG 259,5 2125328 7349788 /usr/lib/x86_64-linux-gnu/libc.so.6
bash 1267639 jonah mem REG 259,5 208328 7350207 /usr/lib/x86_64-linux-gnu/libtinfo.so.6.4
bash 1267639 jonah mem REG 259,5 27028 7350681 /usr/lib/x86_64-linux-gnu/gconv/gconv-modules.cache
bash 1267639 jonah mem REG 259,5 236616 7349521 /usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2
bash 1267639 jonah 0u CHR 136,29 0t0 32 /dev/pts/29
bash 1267639 jonah 1u CHR 136,29 0t0 32 /dev/pts/29
bash 1267639 jonah 2u CHR 136,29 0t0 32 /dev/pts/29
bash 1267639 jonah 255u CHR 136,29 0t0 32 /dev/pts/29
$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=24.04
DISTRIB_CODENAME=noble
DISTRIB_DESCRIPTION="Ubuntu 24.04.1 LTS"
$ My guess is that the confined snap is exposing the issue, but I am not sure how to set that up. Do you have any guidance on how you have set that part of your system up so I can try to replicate that? |
@jonahgraham hi, i guess without interference of apparmor / snap everything is working fine. to reproduce i guess "any shell within snap confinement has this behaviour". i can help create a minimalist snapcraft.yaml - what would is the smallest libpty scenario - is there something from the test harness available ? can you tell how libpty knows which is the "next free available pty". |
Great - but I don't what the smallest scenario would be. If all of eclipse committers was in a snap then I could do everything.
Not that I know of. There is the ability to compile some of the C code referenced below in standalone mode, but I have never done it since I inherited this code base.
Short version is we use getpt to open the PTY and ptsname to get the name of the slave side. Here is the step-by-step that the code opens the terminal with (some of this you may know, just documenting to ensure I understand this code)
|
Given your hints, i could figure a little better about the snapd counterpart. Look at this here: https://github.com/canonical/snapd/blob/bc60ea499205bcb9a362c60f974f08696d5649a6/cmd/snap-confine/mount-support.c#L162 Not sure what this is doing, but it looks a little 'fancy' to me.
you could try this one https://github.com/janesser/eclipse-snap. i shall raise an issue on snapd side soon. (and link here for backtracing) |
I spent a little while trying to make the snap using these instructions, after installing some missing tools (pipx) and adding myself to lxd group, I cannot get past a network error and have stopped now. If you enable issues or discussion on https://github.com/janesser/eclipse-snap I can add additional details, but I don't want to start putting logs for that project in this issue. |
Thanks for trying. Issues on eclipse-snap are now enabled. Either getting snapcraft operational or i'll dig into how to make the first release of it to install with |
I'm not familiar with snap but maybe https://github.com/eclipse-linuxtools/eclipse-ide-snap is relevant for you? |
I did |
Filed janesser/eclipse-snap#1 |
Describe the bug
eclipse-terminal accesses to pts/0 which is hold by kitty/bash in another window
ps
shows process that is surely not from eclipsethis is a eclipse-pde setup where the resulting product has terminal also
(environment is inside a confined snap; almost no host files injected)
To Reproduce
Steps to reproduce the behavior:
ps
(some process may appear here, which doesn't belong there)Expected behavior
Every terminal should acquire a distinct pts/n
Screenshots
If applicable, add screenshots to help explain your problem.
Version Information (please complete the following information):
Additional context
Add any other context about the problem here. For example the error log (in workspace/.metadata/.log) or for GDB interaction issues the GDB traces
P.S.: i can provide additional info as required.
The text was updated successfully, but these errors were encountered: