Coder Social home page Coder Social logo

segmentation fault about ttyd HOT 11 CLOSED

tsl0922 avatar tsl0922 commented on July 20, 2024
segmentation fault

from ttyd.

Comments (11)

stncrn avatar stncrn commented on July 20, 2024 1

Same issue on Ubuntu 16.04x64, ttyd 1.3.3 from launchpad :

Segmentation fault in SSL server mode, with odd debug levels.
No issues in plain http, nor in mutual SSL, nor in SSL server with even debug levels.

Works :
ttyd -p 80 -c admin:admin -u 1001 bash
ttyd -d 0 -p 443 -c admin:admin -u 1001 -S -C /path/cert.cer -K /path/key.key bash
ttyd -d 2 -p 443 -c admin:admin -u 1001 -S -C /path/cert.cer -K /path/key.key bash
ttyd -d 4 -p 443 -c admin:admin -u 1001 -S -C /path/cert.cer -K /path/key.key bash
ttyd -d 6 -p 443 -c admin:admin -u 1001 -S -C /path/cert.cer -K /path/key.key bash
ttyd -p 443 -c admin:admin -u 1001 -S -C /path/cert.cer -K /path/key.key -A /path/ca.cer bash

Segmentation fault :
ttyd -d 1 -p 443 -c admin:admin -u 1001 -S -C /path/cert.cer -K /path/key.key bash
ttyd -d 3 -p 443 -c admin:admin -u 1001 -S -C /path/cert.cer -K /path/key.key bash
ttyd -d 5 -p 443 -c admin:admin -u 1001 -S -C /path/cert.cer -K /path/key.key bash
ttyd -d 7 -p 443 -c admin:admin -u 1001 -S -C /path/cert.cer -K /path/key.key bash

Complete log with -d 21 :

[1515260576:4468] NOTICE: ttyd 1.3.3 (libwebsockets 1.7.1)
[1515260576:4468] NOTICE: tty configuration:
[1515260576:4469] NOTICE:   credential: YWRtaW46YWRtaW4=
[1515260576:4469] NOTICE:   start command: bash
[1515260576:4470] NOTICE:   reconnect timeout: 10s
[1515260576:4470] NOTICE:   close signal: SIGHUP (1)
[1515260576:4472] NOTICE: Initial logging level 21
[1515260576:4472] NOTICE: Libwebsockets version: 1.7.1 unknown-build-hash
[1515260576:4473] NOTICE: IPV6 not compiled in
[1515260576:4474] NOTICE: libev support compiled in but disabled
[1515260576:4475] NOTICE:  Threads: 1 each 1024 fds
[1515260576:4476] NOTICE:  mem: platform fd map:  8192 bytes
[1515260576:4476] NOTICE:  mem: per-conn:          808 bytes + protocol rx buf
[1515260576:4477] NOTICE:  canonical_hostname = ubuntu
[1515260576:4478] NOTICE:  Compiled with OpenSSL support
[1515260576:4478] NOTICE:  SSL ciphers: 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!MD5:!PSK:!RC4:!HMAC_SHA1:!SHA1:!DHE-RSA-AES128-GCM-SHA256:!DHE-RSA-AES128-SHA256:!AES128-GCM-SHA256[1515260576:4479] NOTICE:  Using SSL mode
Segmentation fault (core dumped)

from ttyd.

tsl0922 avatar tsl0922 commented on July 20, 2024

What's your system? Is this reproducible?

from ttyd.

liudf0716 avatar liudf0716 commented on July 20, 2024

yes, it can easily reproduce. on ubuntu system.

from ttyd.

tsl0922 avatar tsl0922 commented on July 20, 2024

How? Can you give me some step.

from ttyd.

liudf0716 avatar liudf0716 commented on July 20, 2024

when I use xfrps as reverse proxy for ttyd, firstly as http service type and visit it remotely, failed, then as tcp service type and visit it, sementfault.

from ttyd.

frenck avatar frenck commented on July 20, 2024

I might have some reproductions in hassio-addons/addon-terminal#4 as well.

from ttyd.

tsl0922 avatar tsl0922 commented on July 20, 2024

@liudf0716 I've tested xfrps on osx, but can't reproduce it. I'll test it on ubuntu when I get a
proper environment. It will help me If you can give some more information like: ubuntu version, ttyd version and libwebsockets version it compiled with (full ttyd log is better).

from ttyd.

frenck avatar frenck commented on July 20, 2024

@tsl0922 I've got a log that might help?

[2017/08/25 15:37:02:1351] NOTICE: ttyd 1.3.2 (libwebsockets 2.2.0)
[2017/08/25 15:37:02:1352] NOTICE: tty configuration:
[2017/08/25 15:37:02:1352] NOTICE: start command: tmux new -A -s ttyd zsh
[2017/08/25 15:37:02:1352] NOTICE: reconnect timeout: 30s
[2017/08/25 15:37:02:1352] NOTICE: close signal: SIGHUP (1)
[2017/08/25 15:37:02:1352] NOTICE: Initial logging level 7
[2017/08/25 15:37:02:1353] NOTICE: Libwebsockets version: 2.2.0 [email protected]
[2017/08/25 15:37:02:1353] NOTICE: IPV6 not compiled in
[2017/08/25 15:37:02:1353] NOTICE: libev support not compiled in
[2017/08/25 15:37:02:1353] NOTICE: libuv support not compiled in
[2017/08/25 15:37:02:1354] NOTICE: Threads: 1 each 1048576 fds
[2017/08/25 15:37:02:1578] NOTICE: mem: platform fd map: 4194304 bytes
[2017/08/25 15:37:02:1581] NOTICE: Compiled with OpenSSL support
[2017/08/25 15:37:02:1581] NOTICE: SSL disabled: no LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT
[2017/08/25 15:37:02:1582] NOTICE: Creating Vhost 'default' port 7681, 2 protocols, IPv6 off
[2017/08/25 15:37:02:1583] NOTICE: Listening on port 7681
[2017/08/25 15:37:02:1583] NOTICE: mem: per-conn: 448 bytes + protocol rx buf
[2017/08/25 15:37:02:1583] NOTICE: canonical_hostname = a0d7b954-terminal
[2017/08/25 15:37:02:1584] NOTICE: listening on port 7681
[2017/08/25 15:37:39:7955] NOTICE: HTTP / - 172.30.32.1 (homeassistant)
[2017/08/25 15:37:39:8332] NOTICE: HTTP /auth_token.js - 172.30.32.1 (homeassistant)
[2017/08/25 15:37:39:8438] NOTICE: WS /ws - 172.30.32.1 (homeassistant), clients: 1
[2017/08/25 15:37:39:8488] NOTICE: started process, pid: 39
/run.sh: line 375: 37 Segmentation fault (core dumped) ttyd -d 7 --reconnect 30 --port 7681 tmux new -A -s ttyd zsh

This is in a Docker container based upon Alpine

from ttyd.

BlackDex avatar BlackDex commented on July 20, 2024

I have had the same problem when using SSL.
Only if i change the debug level it seems to work.
For me -d2 works, also -d10 seemed to work, but -d2 gives me less info which i do not need anyway for now.

from ttyd.

tsl0922 avatar tsl0922 commented on July 20, 2024

I've compiled a static version (linux x64) of the master branch, please test if it crashes.

ttyd-master.zip

from ttyd.

tsl0922 avatar tsl0922 commented on July 20, 2024

Should be fixed on master, please open new issue if it occurs again.

from ttyd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.