Opened 13 months ago

Closed 12 months ago

Last modified 12 months ago

#28294 closed defect (duplicate)

Nyx crashes at graph resizing

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

Description

Nyx (2.0.4 installed using python3-pip) has reproducible crash if the following is done:

  1. Press g for graph resizing.
  2. Press down arrow many times until Events sub-window will be completely hidden.
  3. Nyx crashes with the following log:
Traceback (most recent call last):
  File "/usr/local/bin/nyx", line 9, in <module>
    load_entry_point('nyx==2.0.4', 'console_scripts', 'nyx')()
  File "/usr/local/lib/python3.4/dist-packages/nyx/__init__.py", line 176, in main
    nyx.starter.main()
  File "/usr/local/lib/python3.4/dist-packages/stem/util/conf.py", line 289, in wrapped
    return func(*args, config = config, **kwargs)
  File "/usr/local/lib/python3.4/dist-packages/nyx/starter.py", line 118, in main
    nyx.curses.start(nyx.draw_loop, acs_support = config.get('acs_support', True), transparent_background = True, cursor = False)
  File "/usr/local/lib/python3.4/dist-packages/nyx/curses.py", line 217, in start
    curses.wrapper(_wrapper)
  File "/usr/lib/python3.4/curses/__init__.py", line 94, in wrapper
    return func(stdscr, *args, **kwds)
  File "/usr/local/lib/python3.4/dist-packages/nyx/curses.py", line 215, in _wrapper
    function()
  File "/usr/local/lib/python3.4/dist-packages/nyx/__init__.py", line 243, in draw_loop
    keybinding.handle(key)
  File "/usr/local/lib/python3.4/dist-packages/nyx/panel/__init__.py", line 84, in handle
    self._action()
  File "/usr/local/lib/python3.4/dist-packages/nyx/panel/graph.py", line 504, in _resize_graph
    nyx_interface().redraw()
  File "/usr/local/lib/python3.4/dist-packages/nyx/__init__.py", line 716, in redraw
    panel.redraw(force = force, top = occupied)
  File "/usr/local/lib/python3.4/dist-packages/nyx/panel/__init__.py", line 175, in redraw
    self._last_draw_size = nyx.curses.draw(self._draw, top = self._top, height = self.get_height(), draw_if_resized = draw_dimension)
  File "/usr/local/lib/python3.4/dist-packages/nyx/curses.py", line 740, in draw
    curses_subwindow = CURSES_SCREEN.subwin(subwindow_height, subwindow_width, top, left)
_curses.error: curses function returned NULL

Child Tickets

Change History (5)

comment:1 Changed 13 months ago by arma

Component: ApplicationsCore Tor/Nyx

comment:2 Changed 13 months ago by wagon

Keywords: nyx removed
Reviewer: atagar

comment:3 Changed 12 months ago by atagar

Resolution: duplicate
Status: assignedclosed

Hi wagon, thanks for the report. This is already fixed: https://trac.torproject.org/projects/tor/ticket/24382

comment:4 Changed 12 months ago by wagon

In "Tor Configuration" window if I press a and then scroll down with PageDown key up to the bottom, I get similar crash:

Traceback (most recent call last):
  File "/usr/local/bin/nyx", line 9, in <module>
    load_entry_point('nyx==2.0.4', 'console_scripts', 'nyx')()
  File "/usr/local/lib/python3.4/dist-packages/nyx/__init__.py", line 176, in main
    nyx.starter.main()
  File "/usr/local/lib/python3.4/dist-packages/stem/util/conf.py", line 289, in wrapped
    return func(*args, config = config, **kwargs)
  File "/usr/local/lib/python3.4/dist-packages/nyx/starter.py", line 118, in main
    nyx.curses.start(nyx.draw_loop, acs_support = config.get('acs_support', True), transparent_background = True, cursor = False)
  File "/usr/local/lib/python3.4/dist-packages/nyx/curses.py", line 217, in start
    curses.wrapper(_wrapper)
  File "/usr/lib/python3.4/curses/__init__.py", line 94, in wrapper
    return func(stdscr, *args, **kwds)
  File "/usr/local/lib/python3.4/dist-packages/nyx/curses.py", line 215, in _wrapper
    function()
  File "/usr/local/lib/python3.4/dist-packages/nyx/__init__.py", line 243, in draw_loop
    keybinding.handle(key)
  File "/usr/local/lib/python3.4/dist-packages/nyx/panel/__init__.py", line 82, in handle
    self._action(key)
  File "/usr/local/lib/python3.4/dist-packages/nyx/panel/config.py", line 232, in _scroll
    self.redraw()
  File "/usr/local/lib/python3.4/dist-packages/nyx/panel/__init__.py", line 175, in redraw
    self._last_draw_size = nyx.curses.draw(self._draw, top = self._top, height = self.get_height(), draw_if_resized = draw_dimension)
  File "/usr/local/lib/python3.4/dist-packages/nyx/curses.py", line 746, in draw
    func(_Subwindow(subwindow_width, subwindow_height, curses_subwindow))
  File "/usr/local/lib/python3.4/dist-packages/nyx/panel/config.py", line 315, in _draw
    _draw_line(subwindow, scroll_offset, DETAILS_HEIGHT + i, entry, entry == selected, value_width, description_width)
  File "/usr/local/lib/python3.4/dist-packages/nyx/panel/config.py", line 335, in _draw_line
    attr = [CONFIG['attr.config.category_color'].get(entry.category, WHITE)]
  File "/usr/local/lib/python3.4/dist-packages/nyx/panel/config.py", line 136, in category
    return getattr(manual(self.name), 'category')
AttributeError: 'NoneType' object has no attribute 'category'

So, the problem was general, it existed in few places. Have you solve it everywhere, or only with graph?

comment:5 Changed 12 months ago by atagar

Hi wagon. The fix was applied to all curses panels. Please give the git codebase a whirl.

Note: See TracTickets for help on using tickets.