pazz / alot

Terminal-based Mail User Agent
GNU General Public License v3.0
683 stars 163 forks source link

Crash on startup AssertionError: (0, 0, 1) #1577

Open GuillaumeSeren opened 3 years ago

GuillaumeSeren commented 3 years ago

Hey, After upgrading my system to python3.9, alot was working fine (even after a reboot), then the next day after random closing alot, it does not want to start anymore.

Software Versions

Trying to investigate, I try'd to run without config, that does not fix the issue. Also, I have try to test against a newer urwid-2.1.2 version, still crashing. While I was getting some log to create this issue (without config + -d debug), I can see alot opening for 1-2 second then crashing. I will try to migrate to python3.8 to see if that help.

To Reproduce Steps to reproduce the behaviour:

  1. Try to open alot

Error Log

Traceback (most recent call last):                                                                                                                                                                                                                                                
  File "/usr/lib/python-exec/python3.9/alot", line 33, in <module>                                                                                                                                                                                                                
    sys.exit(load_entry_point('alot==0.9.1', 'console_scripts', 'alot')())                                                                                                                                                                                                        
  File "/usr/lib/python3.9/site-packages/alot/__main__.py", line 137, in main                                                                                                                                                                                                     
    UI(dbman, cmdstring)                                                                                                                 
  File "/usr/lib/python3.9/site-packages/alot/ui.py", line 146, in __init__                                                              
    self.mainloop.run()                                                                                                                  
  File "/usr/lib/python3.9/site-packages/urwid/main_loop.py", line 287, in run                                                           
    self._run()                                                                                                                          
  File "/usr/lib/python3.9/site-packages/urwid/main_loop.py", line 385, in _run                                                          
    self.event_loop.run()                                                                                                                
  File "/usr/lib/python3.9/site-packages/urwid/main_loop.py", line 1346, in run                                                          
    reraise(*exc_info)                                                                                                                   
  File "/usr/lib/python3.9/site-packages/urwid/compat.py", line 58, in reraise                                                           
    raise value                                                                                                                          
  File "/usr/lib/python3.9/site-packages/urwid/main_loop.py", line 1360, in wrapper                                                      
    rval = f(*args,**kargs)                                                                                                              
  File "/usr/lib/python3.9/site-packages/urwid/main_loop.py", line 1319, in _twisted_idle_callback                                       
    callback()                                                                                                                           
  File "/usr/lib/python3.9/site-packages/urwid/main_loop.py", line 574, in entering_idle                                                 
    self.draw_screen()                                                                                                                   
  File "/usr/lib/python3.9/site-packages/urwid/main_loop.py", line 588, in draw_screen                                                   
    canvas = self._topmost_widget.render(self.screen_size, focus=True)                                                                   
  File "/usr/lib/python3.9/site-packages/urwid/widget.py", line 145, in cached_render                                                    
    canv = fn(self, size, focus=focus)                                                                                                   
  File "/usr/lib/python3.9/site-packages/urwid/decoration.py", line 226, in render                                                       
    canv = self._original_widget.render(size, focus=focus)                                                                               
  File "/usr/lib/python3.9/site-packages/urwid/widget.py", line 145, in cached_render                                                    
    canv = fn(self, size, focus=focus)                                                                                                   
  File "/usr/lib/python3.9/site-packages/urwid/container.py", line 1089, in render                                                       
    body = self.body.render((maxcol, maxrow-ftrim-htrim),                                                                                
  File "/usr/lib/python3.9/site-packages/alot/buffers/buffer.py", line 19, in render                                                     
    return self.body.render(size, focus)                                                                                                 
  File "/usr/lib/python3.9/site-packages/urwid/widget.py", line 145, in cached_render                                                    
    canv = fn(self, size, focus=focus)                                                                                                   
  File "/usr/lib/python3.9/site-packages/urwid/listbox.py", line 458, in render                                                          
    focus_canvas = focus_widget.render((maxcol,), focus=focus)                                                                           
  File "/usr/lib/python3.9/site-packages/urwid/widget.py", line 145, in cached_render                                                    
    canv = fn(self, size, focus=focus)                                                                                                   
  File "/usr/lib/python3.9/site-packages/alot/widgets/search.py", line 71, in render                                                     
    return urwid.AttrMap.render(self, size, focus)                                                                                       
  File "/usr/lib/python3.9/site-packages/urwid/widget.py", line 145, in cached_render                                                    
    canv = fn(self, size, focus=focus)                                                                                                   
  File "/usr/lib/python3.9/site-packages/urwid/decoration.py", line 226, in render                                                       
    canv = self._original_widget.render(size, focus=focus)                                                                               
  File "/usr/lib/python3.9/site-packages/urwid/widget.py", line 145, in cached_render                                                    
    canv = fn(self, size, focus=focus)                                                                                                   
  File "/usr/lib/python3.9/site-packages/urwid/container.py", line 2130, in render                                                       
    canv = w.render(sub_size,                                                                                                            
  File "/usr/lib/python3.9/site-packages/urwid/widget.py", line 145, in cached_render                                                    
    canv = fn(self, size, focus=focus)                                                                                                   
  File "/usr/lib/python3.9/site-packages/urwid/decoration.py", line 226, in render                                                       
    canv = self._original_widget.render(size, focus=focus)                                                                               
  File "/usr/lib/python3.9/site-packages/urwid/widget.py", line 145, in cached_render                                                    
    canv = fn(self, size, focus=focus)                                                                                                   
  File "/usr/lib/python3.9/site-packages/urwid/widget.py", line 1005, in render                                                          
    return apply_text_layout(text, attr, trans, maxcol)                                                                                  
  File "/usr/lib/python3.9/site-packages/urwid/canvas.py", line 1290, in apply_text_layout                                               
    s = LayoutSegment(seg)                                                                                                               
  File "/usr/lib/python3.9/site-packages/urwid/text_layout.py", line 288, in __init__                                                    
    assert self.sc > 0, repr(seg)                                                                                                        
AssertionError: (0, 0, 1)
pazz commented 3 years ago

urgs!

This looks like an urwid bug or change in behaviour. Could you report it there also? cheers, P

Quoting Guillaume Seren (2021-05-16 19:51:22)

Hey, After upgrading my system to python3.9, alot was working fine (even after a reboot), then the next day after random closing alot, it does not want to start anymore.

Software Versions

• Python version: 3.9 • Notmuch version: 0.31 • Alot version: 0.9.1 • urwid: 2.1.1 • urwidtrees: 1.0.3

Trying to investigate, I try'd to run without config, that does not fix the issue. Also, I have try to test against a newer urwid-2.1.2 version, still crashing. While I was getting some log to create this issue (without config + -d debug), I can see alot opening for 1-2 second then crashing.

To Reproduce Steps to reproduce the behaviour:

  1. Try to open alot

Error Log

Traceback (most recent call last): File "/usr/lib/python-exec/python3.9/alot", line 33, in sys.exit(load_entry_point('alot==0.9.1', 'console_scripts', 'alot')()) File "/usr/lib/python3.9/site-packages/alot/main.py", line 137, in main UI(dbman, cmdstring) File "/usr/lib/python3.9/site-packages/alot/ui.py", line 146, in init self.mainloop.run() File "/usr/lib/python3.9/site-packages/urwid/main_loop.py", line 287, in run self._run() File "/usr/lib/python3.9/site-packages/urwid/main_loop.py", line 385, in _run self.event_loop.run() File "/usr/lib/python3.9/site-packages/urwid/main_loop.py", line 1346, in run reraise(exc_info) File "/usr/lib/python3.9/site-packages/urwid/compat.py", line 58, in reraise raise value File "/usr/lib/python3.9/site-packages/urwid/main_loop.py", line 1360, in wrapper rval = f(args,**kargs) File "/usr/lib/python3.9/site-packages/urwid/main_loop.py", line 1319, in _twisted_idle_callback callback() File "/usr/lib/python3.9/site-packages/urwid/main_loop.py", line 574, in entering_idle self.draw_screen() File "/usr/lib/python3.9/site-packages/urwid/main_loop.py", line 588, in draw_screen canvas = self._topmost_widget.render(self.screen_size, focus=True) File "/usr/lib/python3.9/site-packages/urwid/widget.py", line 145, in cached_render canv = fn(self, size, focus=focus) File "/usr/lib/python3.9/site-packages/urwid/decoration.py", line 226, in render canv = self._original_widget.render(size, focus=focus) File "/usr/lib/python3.9/site-packages/urwid/widget.py", line 145, in cached_render canv = fn(self, size, focus=focus) File "/usr/lib/python3.9/site-packages/urwid/container.py", line 1089, in render body = self.body.render((maxcol, maxrow-ftrim-htrim),
File "/usr/lib/python3.9/site-packages/alot/buffers/buffer.py", line 19, in render
return self.body.render(size, focus)
File "/usr/lib/python3.9/site-packages/urwid/widget.py", line 145, in cached_render
canv = fn(self, size, focus=focus)
File "/usr/lib/python3.9/site-packages/urwid/listbox.py", line 458, in render
focus_canvas = focus_widget.render((maxcol,), focus=focus)
File "/usr/lib/python3.9/site-packages/urwid/widget.py", line 145, in cached_render
canv = fn(self, size, focus=focus)
File "/usr/lib/python3.9/site-packages/alot/widgets/search.py", line 71, in render
return urwid.AttrMap.render(self, size, focus)
File "/usr/lib/python3.9/site-packages/urwid/widget.py", line 145, in cached_render
canv = fn(self, size, focus=focus)
File "/usr/lib/python3.9/site-packages/urwid/decoration.py", line 226, in render
canv = self._original_widget.render(size, focus=focus)
File "/usr/lib/python3.9/site-packages/urwid/widget.py", line 145, in cached_render
canv = fn(self, size, focus=focus)
File "/usr/lib/python3.9/site-packages/urwid/container.py", line 2130, in render
canv = w.render(sub_size,
File "/usr/lib/python3.9/site-packages/urwid/widget.py", line 145, in cached_render
canv = fn(self, size, focus=focus)
File "/usr/lib/python3.9/site-packages/urwid/decoration.py", line 226, in render
canv = self._original_widget.render(size, focus=focus)
File "/usr/lib/python3.9/site-packages/urwid/widget.py", line 145, in cached_render
canv = fn(self, size, focus=focus)
File "/usr/lib/python3.9/site-packages/urwid/widget.py", line 1005, in render
return apply_text_layout(text, attr, trans, maxcol)
File "/usr/lib/python3.9/site-packages/urwid/canvas.py", line 1290, in apply_text_layout
s = LayoutSegment(seg)
File "/usr/lib/python3.9/site-packages/urwid/text_layout.py", line 288, in init
assert self.sc > 0, repr(seg)
AssertionError: (0, 0, 1)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.*

GuillaumeSeren commented 3 years ago

Hey @pazz :) Thank you for the feedback.

I have reported to urwid as well (https://github.com/urwid/urwid/issues/478) let's see where it goes.

lucc commented 3 years ago

Just to double check that is not some mail received recently that is messing up notmuch (very unlikely): Can you use the notmuch command line or do these commands also crash?

GuillaumeSeren commented 3 years ago

Hey @lucc , I was thinking about that too, but notmuch is still working.

psic commented 3 years ago

same issue here!

GuillaumeSeren commented 3 years ago

Hey, I have been testing more this issue and it is becoming more precise, I am on a python3.9 alot-0.9.1 notmuch-0.31.3 .

It seem's related to the query

If I comment the initial_command, alot run fine using the default query tag:inbox AND NOT tag:killed, and it does not crash when scroll down fast (with page down) there is some results 113553 of 729830 messages.

If I use a slightly more real query tag:unread AND NOT tag:lists, it crash alot start with the AssertionError if set in the initial_command, if I let initial_command unset (and so alot open fine), then search the query it works, but if I scroll down just 2-3 time it crash with AssertionError, also less results 7399 of 729830 messages.

Also those query run fine on my notmuch db, here some speed test:

 $ time notmuch search tag:inbox AND NOT tag:killed
notmuch search tag:inbox AND NOT tag:killed  12.71s user 4.00s system 76% cpu 21.710 total

 $ time notmuch search tag:unread AND NOT tag:lists
 notmuch search tag:unread AND NOT tag:lists  1.70s user 1.11s system 32% cpu 8.689 total

I try to set this, but doesn't solve the issue:

notify_timeout = 10
input_timeout = 10
flush_retry_timeout = 10

So I manage to live with it by closing the research buffer after I finished reading, but it worked before with more complex initial_command query so I have hope.

ghost commented 2 years ago

i get this error/crash and can't start alot when i receive an email w/ a specific subject line in my inbox.

AssertionError: (0, 0, 17)

i have to clear the problem email of the inbox tag before i can launch alot.

notmuch shows the subject line as:

Subject: ̀̀̀̀̀̀̀̀̀̀

when looking at the raw email file in a text editor, the subject line looks like:

Subject: =?UTF-8?B?zYDNgM2AzYDNgM2AzYDNgM2AzYDNgM2AzYDNgM2AzYDNgA==?= =?UTF-8?B?zYDNgM2AzYDNgM2AzYDNgM2AzYDNgM2AzYDNgM2AzYDNgM2A?= =?UTF-8?B?zYDNgM2AzYDNgM2AzYDNgM2AzYDNgM2AzYDNgM2AIHNo?= =?UTF-8?B?YXJlZCAiTWFsd2FyZUJhLi4u?=

in gmail's raw view it looks like

Subject: ̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀̀ shared "MalwareBa...

sshot:

swappy-20220720-122701

it's choking on somebody's twitter username containing some utf-8 encoded characters

not sure if this is a bug in notmuch or alot, since notmuch isn't parsing anything after the trouble utf-8