[Bug] Crash on connect - openpty segfault #18

Closed
opened 2026-09-07 16:29:48 +00:00 by x3 · 0 comments
Owner

Bug: App crashes with a segfault right after "openpty..." log message during SSH connection.

Log:

[18:10:30] [INFO] requesting shell...
[18:10:30] [INFO] shell OK
[18:10:30] [INFO] openpty...
Speicherzugriffsfehler     x3-ssh

Root cause: openpty() from <pty.h> causes a segfault on this system.

Fix: Replaced openpty() with the more portable POSIX PTY functions:

pty_master_ = posix_openpt(O_RDWR | O_NOCTTY);
grantpt(pty_master_);
unlockpt(pty_master_);
pty_slave_ = open(ptsname(pty_master_), O_RDWR | O_NOCTTY);

Additional feature: Password auth failure now shows a red error message and re-opens the password dialog so the user can retry without restarting the application.

Status: Fixed in commit 69369ae

**Bug:** App crashes with a segfault right after "openpty..." log message during SSH connection. **Log:** ``` [18:10:30] [INFO] requesting shell... [18:10:30] [INFO] shell OK [18:10:30] [INFO] openpty... Speicherzugriffsfehler x3-ssh ``` **Root cause:** `openpty()` from `<pty.h>` causes a segfault on this system. **Fix:** Replaced `openpty()` with the more portable POSIX PTY functions: ```cpp pty_master_ = posix_openpt(O_RDWR | O_NOCTTY); grantpt(pty_master_); unlockpt(pty_master_); pty_slave_ = open(ptsname(pty_master_), O_RDWR | O_NOCTTY); ``` **Additional feature:** Password auth failure now shows a red error message and re-opens the password dialog so the user can retry without restarting the application. **Status:** Fixed in commit 69369ae
x3 closed this issue 2026-09-07 16:58:14 +00:00
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: x3/x3-ssh#18