{"action":"created","issue":{"url":"https://api.github.com/repos/hackebrot/qutebrowser/issues/22","labels_url":"https://api.github.com/repos/hackebrot/qutebrowser/issues/22/labels{/name}","comments_url":"https://api.github.com/repos/hackebrot/qutebrowser/issues/22/comments","events_url":"https://api.github.com/repos/hackebrot/qutebrowser/issues/22/events","html_url":"https://github.com/hackebrot/qutebrowser/issues/22","id":68045006,"number":22,"title":"Segfaults since merging layout branch","user":{"login":"The-Compiler","id":625793,"avatar_url":"https://avatars.githubusercontent.com/u/625793?v=3","gravatar_id":"","url":"https://api.github.com/users/The-Compiler","html_url":"https://github.com/The-Compiler","followers_url":"https://api.github.com/users/The-Compiler/followers","following_url":"https://api.github.com/users/The-Compiler/following{/other_user}","gists_url":"https://api.github.com/users/The-Compiler/gists{/gist_id}","starred_url":"https://api.github.com/users/The-Compiler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/The-Compiler/subscriptions","organizations_url":"https://api.github.com/users/The-Compiler/orgs","repos_url":"https://api.github.com/users/The-Compiler/repos","events_url":"https://api.github.com/users/The-Compiler/events{/privacy}","received_events_url":"https://api.github.com/users/The-Compiler/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/hackebrot/qutebrowser/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":19,"created_at":"2015-04-13T08:53:10Z","updated_at":"2015-04-28T12:06:22Z","closed_at":null,"body":"Since merging #16 I occasionally see segfaults when the tests are finished and `pytest` is exiting.\r\n\r\nI've seen that before switching to pytest on the Windows builder, but very rarely. Now I mainly see it on the Debian/Ubuntu builders all ~10 builds or so.\r\n\r\nFrom dmesg:\r\n\r\n```\r\n[Apr11 13:24] QXcbEventReader[2682]: segfault at 7f711e8ca029 ip 00007f711e8ca029 sp 00007f711beb7ee0 error 14\r\n[Apr13 07:49] Qt bearer threa[5141]: segfault at 7fce761cfa50 ip 00007fce82c8b30c sp 00007fce76e146e0 error 4 in libQt5Network.so.5.3.2[7fce82bed000+151000]\r\n```\r\n\r\nExample output: [stdout](http://qutebrowser.org:8010/builders/debian-jessie/builds/428/steps/unittests/logs/stdio)\r\n\r\nAny idea what's going on there? I've tried to run `tox -e unittests` on that builder in an endless loop without buildbot for two hours and didn't get any segfaults...\r\n\r\nI've now reconfigured buildbot to use [catchsegv](http://man.he.net/man1/catchsegv) on any tox-command on Linux in the hope to find out more."},"comment":{"url":"https://api.github.com/repos/hackebrot/qutebrowser/issues/comments/97037728","html_url":"https://github.com/hackebrot/qutebrowser/issues/22#issuecomment-97037728","issue_url":"https://api.github.com/repos/hackebrot/qutebrowser/issues/22","id":97037728,"user":{"login":"The-Compiler","id":625793,"avatar_url":"https://avatars.githubusercontent.com/u/625793?v=3","gravatar_id":"","url":"https://api.github.com/users/The-Compiler","html_url":"https://github.com/The-Compiler","followers_url":"https://api.github.com/users/The-Compiler/followers","following_url":"https://api.github.com/users/The-Compiler/following{/other_user}","gists_url":"https://api.github.com/users/The-Compiler/gists{/gist_id}","starred_url":"https://api.github.com/users/The-Compiler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/The-Compiler/subscriptions","organizations_url":"https://api.github.com/users/The-Compiler/orgs","repos_url":"https://api.github.com/users/The-Compiler/repos","events_url":"https://api.github.com/users/The-Compiler/events{/privacy}","received_events_url":"https://api.github.com/users/The-Compiler/received_events","type":"User","site_admin":false},"created_at":"2015-04-28T12:06:22Z","updated_at":"2015-04-28T12:06:22Z","body":"> Just to be clear, that crash happened with the workaround of keeping a global `QApplication` instance applied?\r\n\r\nYep:\r\n\r\n```diff\r\ndiff --git a/tests/conftest.py b/tests/conftest.py\r\nindex 892a919..c42388f 100644\r\n--- a/tests/conftest.py\r\n+++ b/tests/conftest.py\r\n@@ -24,6 +24,10 @@ import itertools\r\n \r\n import pytest\r\n \r\n+from PyQt5.QtWidgets import QApplication\r\n+\r\n+global_qapp = QApplication([])\r\n+\r\n \r\n @pytest.fixture(scope='session', autouse=True)\r\n def app_and_logging(qapp):\r\n@@ -33,6 +37,7 @@ def app_and_logging(qapp):\r\n     \"\"\"\r\n     from log import init\r\n     init()\r\n+    assert qapp is QApplication.instance()     \r\n \r\n \r\n @pytest.fixture(scope='session')\r\n```\r\n\r\n> It is disappointing how easy is to crash PyQt. :disappointed: \r\n\r\nIndeed... I love PyQt otherwise, but this really makes me think \"damn, I should've learned C++ instead...\" sometimes.\r\n\r\n> I will build a VM myself to try join you in the testing efforts, I have a few ideas I can try.\r\n\r\nThanks! I'm testing with a more-or-less vanilla Ubuntu Trusty/Utopic.\r\n\r\nCheers, :beers:"}}