poljar/weechat-matrix

Segfault on /quit

jmdaemon opened this issue · 15 comments

  1. Launch weechat
  2. Either, configure weechat matrix with invalid credentials
  3. Check for error "LoginError: 403 Invalid Password"
  4. Type /quit
  5. Segfault

There's also another way that involves doing something similar

  1. Launch weechat
  2. Configure no credentials and prompt for SSO instead
  3. Check for "matrix: The server requested a single sign-on ..." message
  4. Type /quit
  5. Segfault

I'm also experiencing this on every /quit. It happens both when starting weechat normally, as well as with a running weechat-headless.

For me, the steps to reproduce are:

  1. With the matrix plugin set to load on startup AND with server.matrix_org.autoconnect set to on
  2. Open weechat
  3. Type /quit and hit <ENTER>
  4. /quitzsh: segmentation fault (core dumped) weechat

Setting server.matrix_org.autoconnect to off fixes this issue, but as soon as you connect to the matrix server, quitting weechat produces a segmentation fault.

weechat freezes every time I type /quit. It doesn't segfault, but I do have to kill -KILL it every time I exit it. It's terrible.

What alternatives are there?

You mean besides element? That's what I have had to resort to for now.

What alternatives are there?

https://matrix.org/clients/

weechat freezes every time I type /quit. It doesn't segfault, but I do have to kill -KILL it every time I exit it. It's terrible.

It's probably this issue

Freezes indefinitely on quit for me as well. WeChat v3.4.1, Python v3.10.2, macOS

@poljar are you still maintain this plugin? Do you suggest to switch to rust implementation?

The Rust implementation does not have feature parity with the Python one, sadly I'm not sure when I'll get the chance to return to this.

@poljar I think this issue should be mentioned in the README, so that future users are aware of them instead of being surprised by them.

weechat-matrix.py is the only thing I have in ~/.local/share/weechat/python/autoload
I get a hang on /quit with weechat-matrix.py loaded and connected
I get a hang on /plugin unload python
Turning off matrix_org.autoconnect, with the .py in still in the autoload dir allows a successful /quit

Using python 3.10.6 on arch.

This might be related to weechat/weechat#1519

Since I rarely use matrix (although I do appreciate its features) I will probably just keep it turned off and use a different client.

I have not seen segfaults on /quit. My setup is a little different:

I'm using Debian Buster, with all the following, and the python dependencies, installed in a separate user account:

  • weechat compiled from git, version 3.6 e5a159c74f8c71483129abd013b77f0f7a9ca216
  • olm compiled fromgit, version 3.2.9 0dde38bd4f49ad1c690e60041703ff1cddd4c8de
  • weechat-matrix from git, c2d2a52
  • python dependencies installed by the above

Output of pip list:

Package                       Version  
----------------------------- ---------
asn1crypto                    0.24.0   
backports.functools-lru-cache 1.5      
beautifulsoup4                4.7.1    
certifi                       2018.8.24
chardet                       3.0.4    
configparser                  3.5.0b2  
cryptography                  2.6.1    
decorator                     4.3.0    
entrypoints                   0.3      
enum34                        1.1.6    
funcsigs                      1.0.2    
gpg                           1.12.0   
gyp                           0.1      
html5lib                      1.0.1    
idna                          2.6      
ipaddress                     1.0.17   
iso8601                       0.1.11   
Jinja2                        2.10     
keyring                       17.1.1   
keyrings.alt                  3.1.1    
linecache2                    1.0.0    
lxml                          4.3.2    
MarkupSafe                    1.1.0    
mercurial                     4.8.2    
mock                          2.0.0    
mysqlclient                   1.3.10   
numpy                         1.16.2   
olefile                       0.46     
passlib                       1.7.1    
pbr                           4.2.0    
Pillow                        5.4.1    
pip                           18.1     
psycopg2                      2.7.7    
pudb                          2018.1   
pyasn1                        0.4.2    
pyasn1-modules                0.2.1    
pycairo                       1.16.2   
pycrypto                      2.6.1    
pyflakes                      2.0.0    
Pygments                      2.3.1    
PyGObject                     3.30.4   
PyICU                         2.2      
PyMySQL                       0.9.3    
pyOpenSSL                     19.0.0   
pyserial                      3.4      
python-dateutil               2.7.3    
python-ldap                   3.1.0    
pyxdg                         0.25     
redis                         3.2.1    
requests                      2.21.0   
scour                         0.37     
SecretStorage                 2.3.1    
setuptools                    40.8.0   
six                           1.12.0   
soupsieve                     1.8      
sqlparse                      0.2.4    
suds-jurko                    0.7.dev0 
traceback2                    1.4.0    
unittest2                     1.1.0    
urllib3                       1.24.1   
urwid                         2.0.1    
virtualenv                    15.1.0   
webencodings                  0.5.1    
wheel                         0.32.3   
xlrd                          1.1.0

Every other dependency comes from Debian Buster.

python-ldap 3.1.0

I had no time to look into it yet but I think the issue is due to python3. I am running python 3.10.6 (fedora 36) and I can reproduce the issue

ilf commented

I can also confirm this bug. weechat 3.8 hangs on /script unload matrix or quit.

Even more annoying, weechat doesn't safe settings like "weechat.look.save_config_on_exit", because it doesn't exit cleanly.

The weechat issue has already been posted: weechat/weechat#1519

@poljar: Is there anything weechat-matrix can do about this? If so: what do you need?