mirage icon indicating copy to clipboard operation
mirage copied to clipboard

error when quitting: ssl.SSLError: ('failed to allocate BIO',)

Open jonassmedegaard opened this issue 3 years ago • 3 comments

Description

When Mirage quits, it spews an error once for each account, hangs for a few seconds, then quite.

Here's an example:

INFO:root:Setting clients offline...
ERROR:asyncio:Exception in callback SSLProtocol.connection_made(<_SelectorSoc...e, bufsize=0>>)
handle: <Handle SSLProtocol.connection_made(<_SelectorSoc...e, bufsize=0>>)>
Traceback (most recent call last):
  File "/usr/lib/python3.8/asyncio/events.py", line 81, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/lib/python3.8/asyncio/sslproto.py", line 478, in connection_made
    self._sslpipe = _SSLPipe(self._sslcontext,
  File "/usr/lib/python3.8/asyncio/sslproto.py", line 71, in __init__
    self._incoming = ssl.MemoryBIO()
ssl.SSLError: ('failed to allocate BIO',)
ERROR:asyncio:Exception in callback SSLProtocol.connection_made(<_SelectorSoc...e, bufsize=0>>)
handle: <Handle SSLProtocol.connection_made(<_SelectorSoc...e, bufsize=0>>)>
Traceback (most recent call last):
  File "/usr/lib/python3.8/asyncio/events.py", line 81, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/lib/python3.8/asyncio/sslproto.py", line 478, in connection_made
    self._sslpipe = _SSLPipe(self._sslcontext,
  File "/usr/lib/python3.8/asyncio/sslproto.py", line 71, in __init__
    self._incoming = ssl.MemoryBIO()
ssl.SSLError: ('failed to allocate BIO',)
WARNING:root:@jonas.smedegaard:talk.puri.sm timed out
WARNING:root:@jonas:matrix.jones.dk timed out

Your environment

Debian sid, on amd64.

Window manager i3.

Steps to reproduce

Start mirage in an X11 terminal-emulator.

Quit mirage (did it from the notification icon - is there any other way?)

Expected behavior

No output on terminal, and quitting without noticable delay.

Actual behavior

Above errors, and several seconds delay.

jonassmedegaard avatar Sep 23 '20 11:09 jonassmedegaard

I can't find any info on this error, but I will see if I can reproduce it on Debian later.

If the closeMinimizesToTray setting is false (default), just closing the window from your WM or any other way will fully exit the application. Otherwise, you have to use the tray icon or send a SIGINT/SIGTERM. Having a small delay before the process fully exits is to be expected, as we need to send a presence update telling the server to mark us offline for every account.

mirukana avatar Sep 24 '20 04:09 mirukana

I still can't reliably reproduce this, neither can I find any info when searching online. Note that you can do Ctrl+\ in terminals to send a SIGTERM to mirage, unlike Ctrl+C this will terminate right then without waiting for accounts to log out.

mirukana avatar Apr 12 '21 04:04 mirukana

Steps to reproduce:

  1. disable all accounts except one, which is not in more than 10 rooms
  2. run this script:
#!/bin/bash
rm logfile
until grep 'failed to allocate BIO' logfile; do
    mirage 2>&1 | tee logfile &
    sleep 2.1
    killall mirage -SIGINT
    sleep 0.4
    killall mirage
done

Adjust the delays as needed. Ideally, the SIGINT should happen right after the background image appears. For me, the issue is reproduced within 1 minute of running the script.

MRAAGH avatar Jan 23 '22 19:01 MRAAGH