FS#57540 - [anki][qt5-webengine] anki cards don't always display themselves

Attached to Project: Community Packages
Opened by michael Lojkovic (zerophase) - Saturday, 17 February 2018, 08:02 GMT
Last edited by Johannes Löthberg (demize) - Friday, 06 April 2018, 18:17 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Antonio Rojas (arojas)
Felix Yan (felixonmars)
Johannes Löthberg (demize)
Architecture All
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 9
Private No

Details

Description:
Something about one of the QT updates on the 16th of February breaks Anki on occasion. Can't figure out which package exactly triggered the issue, I thought it was the qt5-webengine update, but rolling back didn't fix the problem. I have a feeling it's one of the python hooks.

Stack Trace:
../../../../qtwebengine-everywhere-src-5.10.1/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.cc:**CRASHING**:seccomp-bpf failure in syscall 0332
Received signal 11 SEGV_MAPERR 00000d89c14c
#0 0x7fec5a00ee76 <unknown>
#1 0x7fec58c8c88c <unknown>
#2 0x7fec5a00f1ec <unknown>
#3 0x7fec57b238e0 <unknown>
#4 0x7fec5acc8fd4 <unknown>
#5 0x7fec5acd0fd9 <unknown>
#6 0x7fec57b238e0 <unknown>
#7 0x7fec57bdf879 syscall
#8 0x7fec580cdee0 <unknown>
#9 0x7fec5805882d QFileInfo::isFile()
#10 0x7fec580839ed QStandardPaths::locate()
#11 0x7fec580b9171 <unknown>
#12 0x7fec580ba8d2 <unknown>
#13 0x7fec580b66ea QLoggingCategory::init()
#14 0x7fec580b68cc QLoggingCategory::defaultCategory()
#15 0x7fec57f3d83e <unknown>
#16 0x7fec57f3e794 QMessageLogger::warning()
#17 0x7fec58cff3fd <unknown>
#18 0x7fec58cffbe1 <unknown>
#19 0x7fec5bc10523 <unknown>
#20 0x7fec5ae4bfa4 <unknown>
#21 0x7fec5a93de03 <unknown>
#22 0x7fec5a094c32 <unknown>
#23 0x7fec5afae2bf <unknown>
#24 0x7fec5afaf0c6 <unknown>
#25 0x7fec5a094c32 <unknown>
#26 0x7fec5a02c288 <unknown>
#27 0x7fec5a02d268 <unknown>
#28 0x7fec5a02d6d3 <unknown>
#29 0x7fec5a02ea31 <unknown>
#30 0x7fec5a04cf6b <unknown>
#31 0x7fec5bc2d7fb <unknown>
#32 0x7fec59fd776a <unknown>
#33 0x7fec59fd7a60 <unknown>
#34 0x7fec5acd9b2e <unknown>
#35 0x7fec59fd6814 <unknown>
#36 0x7fec58ced29d QtWebEngine::processMain()
#37 0x5582f49c4985 <unknown>
#38 0x7fec57b0ff4a __libc_start_main
#39 0x5582f49c49da <unknown>
r8: 00007ffc3315aea0 r9: 00007ffc3315ae80 r10: 00007ffc3315ae60 r11: 00007ffc3315ae40
r12: 00007ffc3315af04 r13: 00007ffc3315b000 r14: 00007ffc3315af40 r15: 00005582f6a2ded0
di: 0000000000000001 si: 00007ffc3315adc0 bp: 00007ffc3315af40 bx: 000000000000014c
dx: 000000000d800000 ax: 000000000d89c14c cx: 0000000000000010 sp: 00007ffc3315af00
ip: 00007fec5acc8fd4 efl: 0000000000010202 cgf: 002b000000000033 erf: 0000000000000006
trp: 000000000000000e msk: 0000000000000000 cr2: 000000000d89c14c
[end of stack trace]
Calling _exit(1). Core file will not be generated.


Steps to reproduce:
1. Open Anki
2. Load up a deck.
3. Keep loading decks till the card area stops updating. (Might have to close and reenter anki a couple times to trigger the issue)
This task depends upon

Closed by  Johannes Löthberg (demize)
Friday, 06 April 2018, 18:17 GMT
Reason for closing:  Fixed
Additional comments about closing:  2.1.0beta37-2
Comment by Joël Schaerer (lardon) - Saturday, 17 February 2018, 08:52 GMT
Can confirm this. In my case this prevents me from using Anki entirely.
Comment by michael Lojkovic (zerophase) - Saturday, 17 February 2018, 09:02 GMT
@lardon If you launch anki in a terminal, and keep closing and reopening it'll work eventually.
Comment by Joël Schaerer (lardon) - Saturday, 17 February 2018, 10:42 GMT
Just tried it 5 times, always got the same stack trace, cards never displayed.

I can use ankiweb in the meantime, so it's not too bad.
Comment by Johannes Löthberg (demize) - Saturday, 17 February 2018, 19:17 GMT
Googling the error message it seems that similar things have happened multiple times in the past with other packages, seemingly due to glibc incompatibilities? Not really sure how to proceed with this.

As a work-around you can set the QTWEBENGINE_DISABLE_SANDBOX environment variable to 1 to disable the seccomp sandbox for now.
Comment by michael Lojkovic (zerophase) - Saturday, 17 February 2018, 20:27 GMT
I just dropped QTWEBENGINE_DISBALE_SANDBOX into the desktop file, and that fixed the issue.

I think we'll have to track and fix the bug ourselves, as Damien won't fix until he upgrades the static libraries used. https://anki.tenderapp.com/discussions/beta-testing/1024-cards-dont-always-load-on-qt5-webengine-5101
Comment by Sid S. (cnte) - Wednesday, 21 February 2018, 08:37 GMT
Can confirm this bug too, but it happens even when setting QTWEBENGINE_DISBALE_SANDBOX.
Comment by loqs (loqs) - Wednesday, 21 February 2018, 19:51 GMT
can you run anki through strace and find the systemcall that triggers libseccomp?
https://bugs.archlinux.org/task/57585#comment166808 has a debug backtrace but the system call lacks debug info.
Comment by michael Lojkovic (zerophase) - Wednesday, 21 February 2018, 20:18 GMT
I don't see libseccomp getting called in the strace, but here's the output I was able to generate. All I did was start Anki, open a deck, (first deck opened triggered the bug) and close Anki.
Comment by loqs (loqs) - Wednesday, 21 February 2018, 20:34 GMT
https://bugs.archlinux.org/task/57585#comment166808
../../../../qtwebengine-everywhere-src-5.10.1/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.cc:**CRASHING**:seccomp-bpf failure in syscall 0332
I believe syscall 0332 on x86_64 is statx
Comment by Eli Schwartz (eschwartz) - Wednesday, 21 February 2018, 21:28 GMT
Then that would imply this is a duplicate of  FS#57254 

Are you running anki inside a docker container by any chance?
Comment by michael Lojkovic (zerophase) - Wednesday, 21 February 2018, 21:33 GMT
Nope. Just running it how it comes configured from Arch, on my Arch box.
Comment by loqs (loqs) - Wednesday, 21 February 2018, 21:36 GMT Comment by loqs (loqs) - Wednesday, 21 February 2018, 23:32 GMT
Proof of concept patch allows 10 runs of anki with deck opening without triggering the issue.
Does this make it a qt5-webengine bug?
Comment by Antonio Rojas (arojas) - Monday, 05 March 2018, 16:21 GMT
anki explicitely forbids running with Qt 5.10 precisely because of this. Since our anki package is overriding this, we can't expect any support from upstream regarding this issue. I suggest to patch anki to enforce QTWEBENGINE_DISBALE_SANDBOX.
Comment by Eli Schwartz (eschwartz) - Monday, 05 March 2018, 17:20 GMT
But this does sound like something that should be ultimately fixed in qt5-webengine anyways, so is there a qt.io bug tracking qtwebengine statx support?
Comment by Antonio Rojas (arojas) - Monday, 05 March 2018, 17:32 GMT
Not that I know of. This is chromium code, statx is not supported in current chromium git, and even if support were added today it won't make it to Qt at least until 5.12. And given that so far this only seems to affect anki, and upstream clearly doesn't care about distro packaging, I'm personally not very interested in debugging this from the Qt side, or carrying a non-upstreamed patch for months.
Comment by loqs (loqs) - Monday, 05 March 2018, 17:40 GMT
Does qt5-webengine have any other security mechanisms to protect anki's internet use with QTWEBENGINE_DISBALE_SANDBOX=1 ?
Comment by Eli Schwartz (eschwartz) - Monday, 05 March 2018, 17:59 GMT
Hmm, fair enough I suppose.
Comment by Mohammed Yaseen Mowzer (moyamo) - Monday, 19 March 2018, 12:57 GMT
@cnte You misspelled QTWEBENGINE_DISABLE_SANDBOX , could that be the reason it doesn't work for you?
Comment by Sid S. (cnte) - Monday, 19 March 2018, 13:28 GMT
@moyamo Hm. Maybe, but it was too long ago to check again. I've downgraded to the AUR version of 2.0.47 for now, though.
Comment by Martin Roth (Captain_Rage) - Monday, 02 April 2018, 17:27 GMT
Having the same issue as of anki 2.1.0beta37-1.

Loading...