Opened 11 months ago

Closed 6 months ago

#24360 closed defect (worksforme)

When I open nyx and then Immediately click "qq" it will get in a state where nix disappears

Reported by: Dbryrtfbcbhgf Owned by: atagar
Priority: Medium Milestone:
Component: Core Tor/Nyx Version:
Severity: Normal Keywords:
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

When I open nyx and then Immediately click "qq" it will get in a state where nix disappears but I can not enter any thing in terminal without clicking "command z".

Child Tickets

Change History (11)

comment:1 Changed 11 months ago by Dbryrtfbcbhgf

*Correction clicking "control z".
I'm using Ubuntu 16.04.3 LTS

comment:2 Changed 11 months ago by atagar

Status: newneeds_information

Thanks Dbryrtfbcbhgf, definitely sounds funky. Just tried several times to reproduce this but couldn't. Please run 'nyx --debug', reproduce the issue, and attach the debug log with anything you consider sensitive stripped out. Not sure if it'll help, but the next step to see if I can spot what's up.

comment:3 in reply to:  2 Changed 11 months ago by Dbryrtfbcbhgf

Replying to atagar:

Thanks Dbryrtfbcbhgf, definitely sounds funky. Just tried several times to reproduce this but couldn't. Please run 'nyx --debug', reproduce the issue, and attach the debug log with anything you consider sensitive stripped out. Not sure if it'll help, but the next step to see if I can spot what's up.

When I run the command I keep getting this error.
nyx --debug
option --debug requires argument (for usage provide --help)
I installed nyx using "pip install nyx"

comment:4 Changed 11 months ago by atagar

Hi Dbryrtfbcbhgf. The --debug argument requires a path or filename to write to. In the --help it's described as...

-d, --debug LOG_PATH            writes all nyx logs to the given location

Please run 'nyx --debug debug_log.txt'.

comment:5 Changed 11 months ago by Dbryrtfbcbhgf

Thank you. I captured a debug log after the bug occurred.

11/21/2017 12:54:46 [DEBUG] GETINFO info/names (runtime: 0.0163)

11/21/2017 12:54:46 [TRACE] Sent to tor: GETINFO accounting/enabled

11/21/2017 12:54:46 [TRACE] Received from tor: 250-accounting/enabled=0\n250 OK

11/21/2017 12:54:46 [DEBUG] GETINFO accounting/enabled (runtime: 0.0154)

11/21/2017 12:54:46 [TRACE] Sent to tor: GETINFO features/names

11/21/2017 12:54:46 [TRACE] Received from tor: 250-features/names=VERBOSE_NAMES EXTENDED_EVENTS\n250 OK

11/21/2017 12:54:46 [DEBUG] GETINFO features/names (runtime: 0.0134)

11/21/2017 12:54:46 [TRACE] Sent to tor: GETINFO net/listeners/dir

11/21/2017 12:54:46 [TRACE] Received from tor: 250-net/listeners/dir=\n250 OK

11/21/2017 12:54:46 [DEBUG] GETINFO net/listeners/dir (runtime: 0.0023)

11/21/2017 12:54:46 [DEBUG] proc call (process command): /proc/15307/stat (runtime: 0.0002)

11/21/2017 12:54:46 [TRACE] Received from tor: 250-signal/names=RELOAD HUP SHUTDOWN DUMP USR1 DEBUG USR2 HALT TERM INT NEWNYM CLEARDNSCACHE HEARTBEAT\n250 OK

11/21/2017 12:54:46 [TRACE] Sent to tor: GETINFO signal/names

11/21/2017 12:54:46 [DEBUG] GETINFO signal/names (runtime: 0.0023)

11/21/2017 12:54:46 [TRACE] Sent to tor: GETCONF disabledebuggerattachment

11/21/2017 12:54:46 [TRACE] Received from tor: 250 DisableDebuggerAttachment=1

11/21/2017 12:54:46 [INFO] Terminal color support detected and enabled

11/21/2017 12:54:46 [DEBUG] GETCONF disabledebuggerattachment (runtime: 0.0038)

11/21/2017 12:54:46 [INFO] Operating System: Linux, Connection Resolvers: by inference

11/21/2017 12:54:46 [TRACE] Sent to tor: GETCONF bandwidthrate

11/21/2017 12:54:46 [TRACE] Received from tor: 250 BandwidthRate=1572864000

11/21/2017 12:54:46 [DEBUG] GETCONF bandwidthrate (runtime: 0.0052)

11/21/2017 12:54:46 [TRACE] Sent to tor: GETCONF relaybandwidthrate

11/21/2017 12:54:46 [TRACE] Received from tor: 250 RelayBandwidthRate=1572864000

11/21/2017 12:54:46 [DEBUG] GETCONF relaybandwidthrate (runtime: 0.0016)

11/21/2017 12:54:46 [TRACE] Sent to tor: GETCONF maxadvertisedbandwidth

11/21/2017 12:54:46 [TRACE] Received from tor: 250 MaxAdvertisedBandwidth=1073741824

11/21/2017 12:54:46 [DEBUG] GETCONF maxadvertisedbandwidth (runtime: 0.0007)

11/21/2017 12:54:46 [TRACE] Sent to tor: GETCONF bandwidthburst

11/21/2017 12:54:46 [TRACE] Received from tor: 250 BandwidthBurst=1572864000

11/21/2017 12:54:46 [DEBUG] GETCONF bandwidthburst (runtime: 0.0015)

11/21/2017 12:54:46 [TRACE] Sent to tor: GETCONF relaybandwidthburst

11/21/2017 12:54:46 [TRACE] Received from tor: 250 RelayBandwidthBurst=1572864000

11/21/2017 12:54:46 [DEBUG] GETCONF relaybandwidthburst (runtime: 0.0014)

11/21/2017 12:54:46 [DEBUG] redrawing the log panel with the corrected content height (estimate was off by 7)

11/21/2017 12:54:47 [INFO] nyx started (initialization took 2.0 seconds)

11/21/2017 12:54:47 [DEBUG] proc call (process start time): /proc/15307/stat (runtime: 0.0013)

11/21/2017 12:54:47 [TRACE] Received from tor: 650 BW 5883554 5751887

11/21/2017 12:54:48 [INFO] Error while receiving a control message (SocketClosed): received exception "read of closed file"

11/21/2017 12:54:48 [DEBUG] proc call (connections for user debian-tor): /proc/net/[tcp|udp] (runtime: 1.7174)

comment:6 Changed 11 months ago by atagar

Hmmm, frustrating. Looked into our code for a while but unfortunately this doesn't provide much information about where the deadlock might be happening. If you ctrl+c does it provide anything? How reliably does it freeze for you and are you sure this is specific to during startup or does it happen other times too?

comment:7 Changed 10 months ago by Dbryrtfbcbhgf

Replying to atagar:

Hmmm, frustrating. Looked into our code for a while but unfortunately this doesn't provide much information about where the deadlock might be happening. If you ctrl+c does it provide anything? How reliably does it freeze for you and are you sure this is specific to during startup or does it happen other times too?

I had the issue happen again when I clicked "qq", sorry for the late reply my email provider is spamming app email coming from blackhole@torproject.org. This issue happens almost every time when I close nyx by using "qq", it does occur with ctrl+c also.
This stack trace occurred after I clicked "qq"

File "/usr/local/bin/nyx", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.5/dist-packages/nyx/__init__.py", line 176, in main
    nyx.starter.main()
  File "/usr/local/lib/python3.5/dist-packages/stem/util/conf.py", line 289, in wrapped
    return func(*args, config = config, **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/nyx/starter.py", line 123, in main
    _shutdown_daemons(controller)
  File "/usr/local/lib/python3.5/dist-packages/nyx/starter.py", line 239, in _shutdown_daemons
    controller.close()
  File "/usr/local/lib/python3.5/dist-packages/stem/control.py", line 1083, in close
    super(Controller, self).close()
  File "/usr/local/lib/python3.5/dist-packages/stem/control.py", line 746, in close
    t.join()
  File "/usr/lib/python3.5/threading.py", line 1054, in join
    self._wait_for_tstate_lock()
  File "/usr/lib/python3.5/threading.py", line 1070, in _wait_for_tstate_lock
    elif lock.acquire(block, timeout):
KeyboardInterrupt
Last edited 10 months ago by Dbryrtfbcbhgf (previous) (diff)

comment:8 Changed 10 months ago by Dbryrtfbcbhgf

Status: needs_informationnew

comment:9 Changed 10 months ago by Dbryrtfbcbhgf

Priority: HighVery High

comment:10 Changed 6 months ago by atagar

Priority: Very HighMedium
Severity: MajorNormal
Status: newneeds_information

Hi Dbryrtfbcbhgf, sorry about the long delay. Other things bumped this off my radar.

Unfortunately without a local repro my hands are pretty tied on troubleshooting this, but the stacktrace does provide a hint. Evidently a status change callback is hanging. Nyx has only four of those so next steps for troubleshooting this would be to comment those out one by one to determine which listener is at fault. After that we'll be able to troubleshoot why it's acting up.

Since you have a repro but I don't I'll need for you to do this. For each of the following lines please add a '#' to the start. Nyx doesn't need any of these listeners (they're mostly to detect when tor restarts) so you can kill them all and quitting should work...

https://gitweb.torproject.org/nyx.git/tree/nyx/panel/header.py#n56
https://gitweb.torproject.org/nyx.git/tree/nyx/panel/graph.py#n443
https://gitweb.torproject.org/nyx.git/tree/nyx/panel/torrc.py#n52
https://gitweb.torproject.org/nyx.git/tree/nyx/tracker.py#n384

Once we have a better idea of which listener is acting up we'll be able to narrow down why.

comment:11 Changed 6 months ago by Dbryrtfbcbhgf

Resolution: worksforme
Status: needs_informationclosed

ataga, I have not been able to reproduce the bug running 16.04.4 LTS (GNU/Linux 4.4.0-122-generic x86_64), I will reopen this ticket if the bug occurs again.

Note: See TracTickets for help on using tickets.