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

Crashes on Linux? ptsname broken? #1

Open
BotoX opened this issue Oct 10, 2019 · 0 comments
Open

Crashes on Linux? ptsname broken? #1

BotoX opened this issue Oct 10, 2019 · 0 comments

Comments

@BotoX
Copy link

BotoX commented Oct 10, 2019

It seems like the syscall ptsname is broken under Linux?
The program crashes for me on Archlinux and Debian 10.
GDB backtrace:

$ gdb --args deptyr -s /tmp/test.socket top

(gdb) r
Starting program: /tmp/deptyr/deptyr -s /tmp/test.socket top
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7e8b6f5 in __strlen_avx2 () from /usr/lib/libc.so.6
(gdb) bt full
#0  0x00007ffff7e8b6f5 in __strlen_avx2 () from /usr/lib/libc.so.6
No symbol table info available.
#1  0x00007ffff7d9661e in __vfprintf_internal () from /usr/lib/libc.so.6
No symbol table info available.
#2  0x00007ffff7d8126f in printf () from /usr/lib/libc.so.6
No symbol table info available.
#3  0x0000555555556f90 in main (argc=4, argv=0x7fffffffe518) at deptyr.c:270
        ptyname = 0xfffffffff7eefcc0 <error: Cannot access memory at address 0xfffffffff7eefcc0>
        saved_termios = {c_iflag = 0, c_oflag = 0, c_cflag = 4294960248, c_lflag = 32767, 
          c_line = 200 '\310', 
          c_cc = "\375\356\367\377\177\000\000\375uUUUU", '\000' <repeats 18 times>, "\260", 
          c_ispeed = 21845, c_ospeed = 1431659296}
        pty = 4
        opt = -1
        err = <optimized out>
        act_as_proxy = 0
        socket = 3

ptsname returns an invalid address, so I replaced it with ptsname_r which seems to work:
BotoX@60fe4d1
However ptsname_r is a linux extension.

Is ptsname working for you on Linux?

Unrelated: I guess it's not possible to redirect the programs output to stdout for logging it to syslog etc? (Want to run an application with logging under systemd and also be able to attach to it)

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

No branches or pull requests

1 participant