qTox / qTox

qTox is a chat, voice, video, and file transfer IM client using the encrypted peer-to-peer Tox protocol.
https://qtox.github.io/
GNU General Public License v3.0
4.71k stars 1.04k forks source link

segmentation fault on startup (sqlcipher packaging) #4054

Open martin21 opened 7 years ago

martin21 commented 7 years ago

Possible duplicates:

segmentation fault on startup after showing profile (main) window #4055 but there qtox crashes straight after showing profile (main) window. Its also qtox-alpha Debian package.

Segmentation fault on qTox startup in KDE #1116 but this dates back quite a while, however, I use Plasma.

Brief Description

OS: Linux qTox version: 201611180121~v1.6.0 (qtox Debian package version)

Qt: 5.7.1-1

Plasma 5.8.4 LTS + KF 5.29

Hardware: ThinkPad T520

~> phoronix-test-suite system-info
Phoronix Test Suite v5.2.1
System Information

Hardware:
Processor: Intel Core i5-2520M @ 3.20GHz (4 Cores), Motherboard: LENOVO 42433WG, Chipset: Intel 2nd Generation Core Family DRAM, Memory: 16384MB, Disk: 300GB INTEL SSDSA2CW30 + 480GB Crucial_CT480M50, Graphics: Intel 2nd Generation Core Family IGP, Audio: Conexant CX20590, Network: Intel 82579LM Gigabit Connection + Intel Centrino Advanced-N 6205

Software:
OS: Debian unstable, Kernel: 4.8.15-tp520-btrfstrim+ (x86_64), Desktop: KDE Frameworks 5, Display Server: X Server 1.19.0, Display Driver: modesetting 1.19.0, OpenGL: 3.3 Mesa 13.0.2, Compiler: GCC 6.3.0 20161229, File-System: btrfs, Screen Resolution: 3840x1080

Reproducible: Always

Steps to reproduce
  1. rm -r ~/.config/tox (make backup first!)
  2. start qtox
  3. Create new profile, I used user "test" with password "12"
Observed Behavior

qtox crashes:

~> rm -r .config/tox
~> gdb qtox         
GNU gdb (Debian 7.12-4) 7.12
[…]
Reading symbols from qtox...(no debugging symbols found)...done.
(gdb) run
Starting program: /usr/bin/qtox 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffd386b700 (LWP 29067)]
[New Thread 0x7fffc91b0700 (LWP 29068)]
[New Thread 0x7fffc89af700 (LWP 29069)]
[20:46:01.844 UTC] persistence/settings.cpp:133 : Debug: No settings file found, using defaults
[20:46:01.844 UTC] persistence/settings.cpp:137 : Debug: "Loading settings from :/conf/qtox.ini"
[20:46:01.872 UTC] ipc.cpp:59 : Debug: Our global IPC ID is  8654026102535548247
[20:46:01.872 UTC] ipc.cpp:77 : Debug: Attaching to the global shared memory
[20:46:01.873 UTC] ipc.cpp:279 : Debug: Previous owner timed out, taking ownership 15489039419219317944 -> 8654026102535548247
[20:46:01.873 UTC] main.cpp:215 : Debug: built on:  22:21:02 Nov 17 2016 ( 1481344888 )
[20:46:01.873 UTC] main.cpp:216 : Debug: commit:  5648106b34fc7dc3ad4e169651a0cbbd0139170a 

[20:46:01.873 UTC] nexus.cpp:85 : Debug: Starting up
[20:46:12.892 UTC] persistence/settings.cpp:2383 : Debug: Creating new profile settings in  "/home/martin/.config/tox//test.ini"
[New Thread 0x7fffc1db1700 (LWP 29074)]
[20:46:13.121 UTC] persistence/settings.cpp:494 : Debug: "Saving global settings at /home/martin/.config/tox/qtox.ini"

Thread 5 "qTox Database" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffc1db1700 (LWP 29074)]
0x00007ffff3c2f75d in EVP_EncryptUpdate ()
   from /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1
(gdb) bt full
#0  0x00007ffff3c2f75d in EVP_EncryptUpdate ()
    at /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1
#1  0x00007ffff3f79e3b in sqlcipher_openssl_cipher (ctx=0x7fffb801aaa8, mode=<optimized out>, key=0x7fffb801aac8 "HA\201\241\213\322\372_\026\236\004r((\360\232V\035\320cF\351\262\316?\254\232\235\365\340--", key_sz=<optimized out>, iv=0x7fffb80165c8 "\r\230\202\257\306sOj\334k\215\233\026U#\b\v\277\201\221o99\264\214d\246\231E\321\006\257\315\372\005~\202\312\002\375}N\222\361v\264ۛu", in=0x7fffb801b918 "\004", in_sz=960, out=0x7fffb8016208 "") at sqlite3.c:16517
        tmp_csz = 0
        csz = <optimized out>
        ectx = 0x7fffb801f5b0
#2  0x00007ffff3f8a47e in sqlcipher_page_cipher (ctx=ctx@entry=0x7fffb80161a8, for_ctx=<optimized out>, pgno=1, mode=1, page_sz=<optimized out>, in=0x7fffb801b918 "\004", out=0x7fffb8016208 "") at sqlite3.c:15696
        c_ctx = 0x7fffb801a998
        iv_in = 0x7fffb801bcd8 ""
        iv_out = 0x7fffb80165c8 "\r\230\202\257\306sOj\334k\215\233\026U#\b\v\277\201\221o99\264\214d\246\231E\321\006\257\315\372\005~\202\312\002\375}N\222\361v\264ۛu"
        hmac_in = <optimized out>
        hmac_out = 0x7fffb80165d8 "\v\277\201\221o99\264\214d\246\231E\321\006\257\315\372\005~\202\312\002\375}N\222\361v\264ۛu"
        out_start = 0x7fffb8016208 ""
        size = 960
#3  0x00007ffff3f9c104 in sqlite3Codec (iCtx=0x7fffb80161a8, data=0x7fffb801b908, pgno=1, mode=6) at sqlite3.c:14389
        ctx = 0x7fffb80161a8
        offset = <optimized out>
        rc = <optimized out>
        page_sz = 1024
        pData = 0x7fffb801b908 "SQLite format 3"
        buffer = 0x7fffb80161f8
        kdf_salt = 0x7fffb8014af8
#4  0x00007ffff3faa799 in pager_write_pagelist (pPager=pPager@entry=0x7fffb8003ca8, pList=0x7fffb801bd40) at sqlite3.c:48086
        offset = 0
        pData = <optimized out>
        pgno = 1
        rc = 0
#5  0x00007ffff3fb25fa in sqlite3PagerCommitPhaseOne (pPager=0x7fffb8003ca8, zMaster=zMaster@entry=0x0, noSync=noSync@entry=0) at sqlite3.c:50033
---Type <return> to continue, or q <return> to quit---
        rc = <optimized out>
#6  0x00007ffff3fb27cf in sqlite3PagerCommitPhaseOne (noSync=0, zMaster=0x0, pPager=<optimized out>) at sqlite3.c:49932
        rc = 0
        pBt = 0x7fffb80037e8
#7  0x00007ffff3fb27cf in sqlite3BtreeCommitPhaseOne (p=0x7fffb8003788, zMaster=zMaster@entry=0x0) at sqlite3.c:57764
        pBt = 0x7fffb80037e8
#8  0x00007ffff3fb6421 in sqlite3BtreeCommitPhaseOne (zMaster=0x0, p=<optimized out>) at sqlite3.c:89551
        rc = 0
        pBt = <optimized out>
        i = 0
        nTrans = <optimized out>
        rc = 0
        needXcommit = <optimized out>
        mrc = <optimized out>
        eStatementOp = <optimized out>
        isSpecialError = <optimized out>
        rc = <optimized out>
        db = 0x7fffb80031b8
#9  0x00007ffff3fb6421 in vdbeCommit (p=0x7fffb8014c18, db=0x7fffb80031b8)
    at sqlite3.c:1586
        pBt = <optimized out>
        i = 0
        nTrans = <optimized out>
        rc = 0
        needXcommit = <optimized out>
        mrc = <optimized out>
        eStatementOp = <optimized out>
        isSpecialError = <optimized out>
        rc = <optimized out>
        db = 0x7fffb80031b8
#10 0x00007ffff3fb6421 in sqlite3VdbeHalt (p=p@entry=0x7fffb8014c18)
    at sqlite3.c:1993
        mrc = <optimized out>
        eStatementOp = <optimized out>
        isSpecialError = <optimized out>
        rc = <optimized out>
        db = 0x7fffb80031b8
#11 0x00007ffff3fe5926 in sqlite3VdbeExec (p=p@entry=0x7fffb8014c18)
---Type <return> to continue, or q <return> to quit---
    at sqlite3.c:71867
        zType = <optimized out>
        zLogFmt = <optimized out>
        pc = 42
        aOp = <optimized out>
        pOp = 0x7fffb801cea8
        rc = 0
        db = <optimized out>
        resetSchemaOnFault = 0 '\000'
        encoding = <optimized out>
        iCompare = <optimized out>
        nVmStep = <optimized out>
        nProgressLimit = <optimized out>
        aMem = <optimized out>
        pIn1 = <optimized out>
        pIn2 = <optimized out>
        pIn3 = <optimized out>
        pOut = <optimized out>
        aPermute = <optimized out>
        lastRowid = 0
#12 0x00007ffff3fe68cf in sqlite3Step (p=0x7fffb8014c18) at sqlite3.c:69631
        db = 0x7fffb80031b8
        rc = <optimized out>
        db = <optimized out>
        v = <optimized out>
        pStmt = <optimized out>
        v = <optimized out>
#13 0x00007ffff3fe68cf in sqlite3_step (pStmt=<optimized out>) at sqlite3.c:4161
        db = <optimized out>
        v = <optimized out>
        pStmt = <optimized out>
        v = <optimized out>
#14 0x0000555555629bf0 in  ()
#15 0x00005555556c2695 in  ()
#16 0x00007fffef357449 in QObject::event(QEvent*) ()
    at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#17 0x00007fffefd7db2c in QApplicationPrivate::notify_helper(QObject*, QEvent*) ()
    at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#18 0x00007fffefd852e1 in QApplication::notify(QObject*, QEvent*) ()
    at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#19 0x00007fffef32a990 in QCoreApplication::notifyInternal2(QObject*, QEvent*) ()
---Type <return> to continue, or q <return> to quit---
    at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#20 0x00007fffef32d11d in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#21 0x00007fffef37ebf3 in  () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#22 0x00007ffff02d27f7 in g_main_dispatch (context=0x7fffb8000990)
    at ././glib/gmain.c:3203
        dispatch = 0x7fffef37ebe0
        prev_source = 0x0
        was_in_call = 0
        user_data = 0x0
        callback = 0x0
        cb_funcs = <optimized out>
        cb_data = <optimized out>
        need_destroy = <optimized out>
        source = 0x7fffb80012d0
        current = 0x7fffbc0023b0
        i = 0
#23 0x00007ffff02d27f7 in g_main_context_dispatch (context=context@entry=0x7fffb8000990) at ././glib/gmain.c:3856
#24 0x00007ffff02d2a60 in g_main_context_iterate (context=context@entry=0x7fffb8000990, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>)
    at ././glib/gmain.c:3929
        max_priority = 2147483647
        timeout = -1
        some_ready = 1
        nfds = 1
        allocated_nfds = 1
        fds = <optimized out>
#25 0x00007ffff02d2b0c in g_main_context_iteration (context=0x7fffb8000990, may_block=1) at ././glib/gmain.c:3990
        retval = <optimized out>
#26 0x00007fffef37efff in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#27 0x00007fffef32897a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#28 0x00007fffef1560f3 in QThread::exec() ()
    at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#29 0x00007fffef15ada8 in  () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#30 0x00007fffeec24464 in start_thread (arg=0x7fffc1db1700) at pthread_create.c:333
        __res = <optimized out>
        pd = 0x7fffc1db1700
---Type <return> to continue, or q <return> to quit---
        now = <optimized out>
        unwind_buf = 
              {cancel_jmp_buf = {{jmp_buf = {140736445748992, -2559072876665711923, 0, 140737488343263, 0, 140737354125376, 2559130291348230861, 2559035533675909837}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
        not_first_call = <optimized out>
        pagesize_m1 = <optimized out>
        sp = <optimized out>
        freesize = <optimized out>
        __PRETTY_FUNCTION__ = "start_thread"
#31 0x00007fffee0ca9df in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:105
(gdb) 
(gdb) quit
A debugging session is active.

        Inferior 1 [process 29063] will be killed.

Quit anyway? (y or n) y
Expected Behavior

qtox runs, as it did with an earlier version

Additional Info
~/.cache#1> find -iname "*tox*"
~/.cache>

libsqlcipher0:amd64 3.2.0-2

zetok commented 7 years ago

It looks like a problem with your system.

I.e. since it crashes on sqlcipher_openssl_cipher, I'd guess that openssl from your system is incompatible with sqlcipher that qTox binary was linked against.

qTox should work just fine if you compile manually against your system libs. Unless that doesn't work too?

Diadlo commented 7 years ago

Interesting. The length of the password should be greater than 6

martin21 commented 7 years ago

Okay, this works. I had to compile toxcore and remove any and all libtox packages that were still installed, which also means I had to remove utox as well. Fortunately qtox seems to have imported the tox_save.tox of uTox, so not yet another tox id.

I compiled with toxcore 0.1.2, is that still recommended or should I use a newer version?

I hope for upgraded / recompiled Debian packages.

zetok commented 7 years ago

I compiled with toxcore 0.1.2, is that still recommended or should I use a newer version?

That's the latest release as of now. In a few hours there probably will be 0.1.3 released, careful with that one though since there were some slight problems with the code on master. It will be fixed before 0.1.3 release, but still, proceed with caution.

I hope for upgraded / recompiled Debian packages.

https://github.com/abbat/tox.pkg#toxpkg ← repo with stuff that is used to build packages for distros, it could make use of some help ;-)

zetok commented 7 years ago

Okay, this works.

Since it works, closing.

martin21 commented 7 years ago

Nope, it doesn´t. The profile of uTox had no password and without password it qTox loaded it.

toxcore + qTox compiled from git, toxcore from tag v0.1.2

OS: Debian GNU/Linux Sid qTox version: v1.7.0-43-g6b513819. Commit-Hash: 6b51381980e4d742efff0905a697040efbcce049 Toxcore-Version: 0.1.2 Qt: 5.7.1-1

Yet, on setting a password it crashes

Crash on setting profile password #4056 probably another duplicate, not sure.

Also on creating a new profile with password it crashes:

~> gdb qtox         
[…]
(gdb) run
Starting program: /usr/bin/qtox 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffd321c700 (LWP 15876)]
[New Thread 0x7fffc8b4c700 (LWP 15877)]
[New Thread 0x7fffc3fff700 (LWP 15878)]
[22:27:26.832 UTC] persistence/settings.cpp:133 : Debug: No settings file found, using defaults
[22:27:26.832 UTC] persistence/settings.cpp:137 : Debug: "Loading settings from :/conf/qtox.ini"
[22:27:26.857 UTC] ipc.cpp:59 : Debug: Our global IPC ID is  8774033019212500983
[22:27:26.857 UTC] main.cpp:210 : Debug: built on:  22:47:41 Jan  5 2017 ( 1483652845 )
[22:27:26.857 UTC] main.cpp:211 : Debug: commit:  6b51381980e4d742efff0905a697040efbcce049 

[22:27:26.857 UTC] nexus.cpp:85 : Debug: Starting up
[22:27:39.524 UTC] persistence/settings.cpp:2374 : Debug: Creating new profile settings in  "/home/martin/.config/tox//test.ini"
[22:27:39.655 UTC] persistence/settings.cpp:358 : Debug: Loading personal settings from "/home/martin/.config/tox/test.ini"
[22:27:39.655 UTC] persistence/settings.cpp:493 : Debug: "Saving global settings at /home/martin/.config/tox/qtox.ini"
[New Thread 0x7fffba3dc700 (LWP 15884)]
[New Thread 0x7fffb9bdb700 (LWP 15887)]
[New Thread 0x7fffb93da700 (LWP 15888)]
[22:27:41.031 UTC] core/core.cpp:244 : Debug: Creating a new profile
[22:27:41.032 UTC] core/core.cpp:135 : Debug: Core starting with IPv6 enabled
[New Thread 0x7fffb8b33700 (LWP 15889)]
[22:27:41.035 UTC] core/core.cpp:319 : Debug: Self avatar not found, will broadcast empty avatar to friends
[22:27:41.036 UTC] persistence/profile.cpp:373 : Debug: Saving tox save to  "/home/martin/.config/tox/test.tox"
[New Thread 0x7fffabfff700 (LWP 15890)]
[22:27:41.161 UTC] widget/systemtrayicon.cpp:90 : Debug: Using the Qt backend
[22:27:41.163 UTC] widget/widget.cpp:481 : Debug: Detected buggy QIcon::hasThemeIcon. Icon overrides from theme will be ignored.

Thread 9 "qTox Database" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffabfff700 (LWP 15890)]
0x00007fffeeff675d in EVP_EncryptUpdate () from /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1
(gdb) bt full
#0  0x00007fffeeff675d in EVP_EncryptUpdate () at /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1
#1  0x00007ffff6992e3b in sqlcipher_openssl_cipher (ctx=0x7fffa001a8a8, mode=<optimized out>, key=0x7fffa001a8c8 "hgl\035\362lC\240H3\207\036r\273\262W\362\027\222\340E\n\240K+\004\305{c\373d\227", key_sz=<optimized out>, iv=0x7fffa00163c8 "\321\343\064$\346/\216\342\003j\\\022K\225\346\366/\272o\027q9\317wB:\375\026\357b\271\020\363\035\027\305g5옉\034c\233\236\024\370\327u", in=0x7fffa001b718 "\004", in_sz=960, out=0x7fffa0016008 "") at sqlite3.c:16517
        tmp_csz = 0
        csz = <optimized out>
        ectx = 0x7fffa001f3b0
#2  0x00007ffff69a347e in sqlcipher_page_cipher (ctx=ctx@entry=0x7fffa0015fa8, for_ctx=<optimized out>, pgno=1, mode=1, page_sz=<optimized out>, in=0x7fffa001b718 "\004", out=0x7fffa0016008 "") at sqlite3.c:15696
        c_ctx = 0x7fffa001a798
        iv_in = 0x7fffa001bad8 ""
        iv_out = 0x7fffa00163c8 "\321\343\064$\346/\216\342\003j\\\022K\225\346\366/\272o\027q9\317wB:\375\026\357b\271\020\363\035\027\305g5옉\034c\233\236\024\370\327u"
        hmac_in = <optimized out>
        hmac_out = 0x7fffa00163d8 "/\272o\027q9\317wB:\375\026\357b\271\020\363\035\027\305g5옉\034c\233\236\024\370\327u"
        out_start = 0x7fffa0016008 ""
        size = 960
#3  0x00007ffff69b5104 in sqlite3Codec (iCtx=0x7fffa0015fa8, data=0x7fffa001b708, pgno=1, mode=6) at sqlite3.c:14389
        ctx = 0x7fffa0015fa8
        offset = <optimized out>
        rc = <optimized out>
        page_sz = 1024
        pData = 0x7fffa001b708 "SQLite format 3"
        buffer = 0x7fffa0015ff8
        kdf_salt = 0x7fffa00148f8
#4  0x00007ffff69c3799 in pager_write_pagelist (pPager=pPager@entry=0x7fffa0003aa8, pList=0x7fffa001bb40) at sqlite3.c:48086
        offset = 0
        pData = <optimized out>
        pgno = 1
        rc = 0
#5  0x00007ffff69cb5fa in sqlite3PagerCommitPhaseOne (pPager=0x7fffa0003aa8, zMaster=zMaster@entry=0x0, noSync=noSync@entry=0) at sqlite3.c:50033
        rc = <optimized out>
#6  0x00007ffff69cb7cf in sqlite3PagerCommitPhaseOne (noSync=0, zMaster=0x0, pPager=<optimized out>) at sqlite3.c:49932
        rc = 0
        pBt = 0x7fffa00035e8
#7  0x00007ffff69cb7cf in sqlite3BtreeCommitPhaseOne (p=0x7fffa0003588, zMaster=zMaster@entry=0x0) at sqlite3.c:57764
        pBt = 0x7fffa00035e8
#8  0x00007ffff69cf421 in sqlite3BtreeCommitPhaseOne (zMaster=0x0, p=<optimized out>) at sqlite3.c:89551
        rc = 0
        pBt = <optimized out>
        i = 0
        nTrans = <optimized out>
---Type <return> to continue, or q <return> to quit---
        rc = 0
        needXcommit = <optimized out>
        mrc = <optimized out>
        eStatementOp = <optimized out>
        isSpecialError = <optimized out>
        rc = <optimized out>
        db = 0x7fffa0002fb8
#9  0x00007ffff69cf421 in vdbeCommit (p=0x7fffa0014a18, db=0x7fffa0002fb8) at sqlite3.c:1586
        pBt = <optimized out>
        i = 0
        nTrans = <optimized out>
        rc = 0
        needXcommit = <optimized out>
        mrc = <optimized out>
        eStatementOp = <optimized out>
        isSpecialError = <optimized out>
        rc = <optimized out>
        db = 0x7fffa0002fb8
#10 0x00007ffff69cf421 in sqlite3VdbeHalt (p=p@entry=0x7fffa0014a18) at sqlite3.c:1993
        mrc = <optimized out>
        eStatementOp = <optimized out>
        isSpecialError = <optimized out>
        rc = <optimized out>
        db = 0x7fffa0002fb8
#11 0x00007ffff69fe926 in sqlite3VdbeExec (p=p@entry=0x7fffa0014a18) at sqlite3.c:71867
        zType = <optimized out>
        zLogFmt = <optimized out>
        pc = 42
        aOp = <optimized out>
        pOp = 0x7fffa001cca8
        rc = 0
        db = <optimized out>
        resetSchemaOnFault = 0 '\000'
        encoding = <optimized out>
        iCompare = <optimized out>
        nVmStep = <optimized out>
        nProgressLimit = <optimized out>
        aMem = <optimized out>
        pIn1 = <optimized out>
        pIn2 = <optimized out>
        pIn3 = <optimized out>
---Type <return> to continue, or q <return> to quit---
        pOut = <optimized out>
        aPermute = <optimized out>
        lastRowid = 0
#12 0x00007ffff69ff8cf in sqlite3Step (p=0x7fffa0014a18) at sqlite3.c:69631
        db = 0x7fffa0002fb8
        rc = <optimized out>
        db = <optimized out>
        v = <optimized out>
        pStmt = <optimized out>
        v = <optimized out>
#13 0x00007ffff69ff8cf in sqlite3_step (pStmt=<optimized out>) at sqlite3.c:4161
        db = <optimized out>
        v = <optimized out>
        pStmt = <optimized out>
        v = <optimized out>
#14 0x0000555555609b10 in  ()
#15 0x00005555556de035 in  ()
#16 0x00007ffff0f08449 in QObject::event(QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#17 0x00007ffff192eb2c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#18 0x00007ffff19362e1 in QApplication::notify(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#19 0x00007ffff0edb990 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#20 0x00007ffff0ede11d in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#21 0x00007ffff0f2fbf3 in  () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#22 0x00007ffff3fd07f7 in g_main_dispatch (context=0x7fffa0000990) at ././glib/gmain.c:3203
        dispatch = 0x7ffff0f2fbe0
        prev_source = 0x0
        was_in_call = 0
        user_data = 0x0
        callback = 0x0
        cb_funcs = <optimized out>
        cb_data = <optimized out>
        need_destroy = <optimized out>
        source = 0x7fffa00012d0
        current = 0x7fffa4002770
        i = 0
#23 0x00007ffff3fd07f7 in g_main_context_dispatch (context=context@entry=0x7fffa0000990) at ././glib/gmain.c:3856
#24 0x00007ffff3fd0a60 in g_main_context_iterate (context=context@entry=0x7fffa0000990, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>)
    at ././glib/gmain.c:3929
        max_priority = 2147483647
        timeout = -1
        some_ready = 1
---Type <return> to continue, or q <return> to quit---
        nfds = 1
        allocated_nfds = 1
        fds = <optimized out>
#25 0x00007ffff3fd0b0c in g_main_context_iteration (context=0x7fffa0000990, may_block=1) at ././glib/gmain.c:3990
        retval = <optimized out>
#26 0x00007ffff0f2ffff in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#27 0x00007ffff0ed997a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#28 0x00007ffff0d070f3 in QThread::exec() () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#29 0x00007ffff0d0bda8 in  () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#30 0x00007ffff07d5464 in start_thread (arg=0x7fffabfff700) at pthread_create.c:333
        __res = <optimized out>
        pd = 0x7fffabfff700
        now = <optimized out>
        unwind_buf = 
              {cancel_jmp_buf = {{jmp_buf = {140736079066880, -1144861764976688385, 0, 140737488345423, 0, 140737354125376, 1145028890308330239, 1144832058090668799}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
        not_first_call = <optimized out>
        pagesize_m1 = <optimized out>
        sp = <optimized out>
        freesize = <optimized out>
        __PRETTY_FUNCTION__ = "start_thread"
#31 0x00007fffefc7b9df in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:105
(gdb) 
(gdb) quit
A debugging session is active.

        Inferior 1 [process 15872] will be killed.

Quit anyway? (y or n) y

I spent more than 3 hours on this one now. I am fed up for now and thus will remove all my self-compiled stuff I just reinstall utox again.

martin21 commented 7 years ago
~> dpkg -l | grep sqlcipher | cut -c1-72
ii  libsqlcipher-dev                              3.2.0-2               
ii  libsqlcipher0:amd64                           3.2.0-2               
ii  libsqlcipher0-dbg                             3.2.0-2

which depends on

Depends: libc6 (>= 2.14), libssl1.1 (>= 1.1.0)

which is:

~> dpkg -l | grep libssl1.1 | cut -c-72
ii  libssl1.1:amd64                               1.1.0c-2
martin21 commented 7 years ago

Zetok, it is a distribution issue, as downgrading libsqlcipher debian package from 3.2.0-2 to 3.2.0-1.1+b2¹ fixes the issue for me.

Reported as Debian bug report:

Debian Bug #850421: libsqlcipher0: qTox segfaults with distro provided libsqlcipher0 https://bugs.debian.org/850421

[1] http://snapshot.debian.org/archive/debian/20161011T120354Z/pool/main/s/sqlcipher/libsqlcipher0_3.2.0-1.1%2Bb2_amd64.deb

martin21 commented 7 years ago

Diadlo, I meant using test12 as a password. This works as qTox accepts a password with at least 6 characters.

TheOuterLinux commented 6 years ago

If I follow the https://bugs.debian.org/85042" link, they claim to have fixed it; however, I just now (Apr 2, 2018) had to downgrade with the http://snapshot.debian.org/archive/debian/20161011T120354Z/pool/main/s/sqlcipher/libsqlcipher0_3.2.0-1.1%2Bb2_amd64.deb link to get password protected profiles to work. Stretch repositories don't have the latest libsqlcipher, but testing does. So I tried something kind of weird. I downgraded like was suggested but then added Debian's testing repo to my /etc/apt/sources.list. I ran a "sudo apt update" and then a "sudo apt upgrade." It immediately told me to do a "sudo apt --fix-broken install," which in turn upgraded my libsqlcipher to 3.4. Rather than running "sudo apt upgrade" again to continue with the rest of testing's numerous package updates, I removed it from my sources.list. This way, I have the working latest version of libsqlcipher, but I'm still "stable." I hope that makes sense.

martin21 commented 6 years ago

@TheOuterLinux I don´t use qTox currently, but yes, the updated libsqlcipher has not been backported to Debian Stretch¹. You may request a backport on the debian-backports mailing list or by asking the package maintainer².

[1] https://tracker.debian.org/pkg/sqlcipher

[2] https://backports.debian.org/

isav83 commented 4 years ago

I have same issue (segmentation fault on startup) with sqlcipher 4.2.0. Downgrade to 4.1.0 solve it. OS: Slackware Current 32bit qTox: 1.17-dev (on this time) toxcore: 0.2.10 Qt: 5.13.1 Steps to reproduce:

  1. Start qtox
  2. Login to created profile Debug info:
    
    (gdb) run
    Starting program: /usr/bin/qtox 
    [Thread debugging using libthread_db enabled]
    Using host libthread_db library "/lib/libthread_db.so.1".
    [New Thread 0xae687b40 (LWP 10432)]
    [14:43:25.256 UTC] :0 : Warning: QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-igor'
    [New Thread 0xadb8db40 (LWP 10433)]
    [14:43:25.281 UTC] persistence/settings.cpp:120 : Debug: No settings file found, using defaults
    [14:43:25.281 UTC] persistence/settings.cpp:124 : Debug: "Loading settings from :/conf/qtox.ini"
    [14:43:25.289 UTC] ipc.cpp:61 : Debug: Our global IPC ID is  12848374570953043189
    [14:43:25.289 UTC] main.cpp:308 : Debug: commit:  build without git
    [New Thread 0xad1ffb40 (LWP 10434)]
    [New Thread 0xa886cb40 (LWP 10436)]
    [New Thread 0xa7dbeb40 (LWP 10437)]
    [14:43:32.306 UTC] persistence/profile.cpp:146 : Debug: Loading tox save  "/home/igor/.config/tox/Igor.tox"
    [14:43:32.359 UTC] persistence/settings.cpp:494 : Debug: Loading personal settings from "/home/igor/.config/tox/Igor.ini"
    [14:43:32.360 UTC] core/toxoptions.cpp:110 : Debug: Core starting with IPv6 enabled
    [New Thread 0xa7273b40 (LWP 10439)]
    [New Thread 0xa68ffb40 (LWP 10440)]
    [14:43:32.418 UTC] persistence/db/rawdatabase.cpp:285 : Debug: Setting SQLCipher 4.x parameters

Thread 8 "qTox Database" received signal SIGSEGV, Segmentation fault. [Switching to Thread 0xa68ffb40 (LWP 10440)] 0xb40a04eb in EVP_MD_CTX_clear_flags () from /usr/lib/libcrypto.so.1.1 (gdb) bt

0 0xb40a04eb in EVP_MD_CTX_clear_flags () from /usr/lib/libcrypto.so.1.1

1 0xb4090926 in EVP_DigestInit_ex () from /usr/lib/libcrypto.so.1.1

2 0xb40aa13d in HMAC_Init_ex () from /usr/lib/libcrypto.so.1.1

3 0xb5a716c7 in ?? () from /usr/lib/libsqlcipher.so.0

4 0xb5a7e99c in ?? () from /usr/lib/libsqlcipher.so.0

5 0xb5a867ce in sqlcipher_page_cipher () from /usr/lib/libsqlcipher.so.0

6 0xb5a95c5f in ?? () from /usr/lib/libsqlcipher.so.0

7 0xb5aa15f9 in ?? () from /usr/lib/libsqlcipher.so.0

8 0xb5ab18a5 in ?? () from /usr/lib/libsqlcipher.so.0

9 0xb5a6b4e8 in ?? () from /usr/lib/libsqlcipher.so.0

10 0xb5ab3170 in ?? () from /usr/lib/libsqlcipher.so.0

11 0xb5af1f01 in ?? () from /usr/lib/libsqlcipher.so.0

12 0xb5af2072 in ?? () from /usr/lib/libsqlcipher.so.0

13 0xb5af20b4 in ?? () from /usr/lib/libsqlcipher.so.0

14 0xb5af2733 in ?? () from /usr/lib/libsqlcipher.so.0

15 0xb5af2a07 in ?? () from /usr/lib/libsqlcipher.so.0

16 0xb5af2e2c in ?? () from /usr/lib/libsqlcipher.so.0

17 0xb5a798d7 in ?? () from /usr/lib/libsqlcipher.so.0

18 0xb5a7b065 in ?? () from /usr/lib/libsqlcipher.so.0

19 0xb5ac39f8 in ?? () from /usr/lib/libsqlcipher.so.0

20 0xb5ae11c3 in ?? () from /usr/lib/libsqlcipher.so.0

21 0xb5ae5884 in ?? () from /usr/lib/libsqlcipher.so.0

22 0xb5ae5ae4 in ?? () from /usr/lib/libsqlcipher.so.0

23 0x0832b9d5 in RawDatabase::process() ()

24 0x08268ec2 in ?? ()

25 0xb4ae567f in QMetaMethod::invoke(QObject*, Qt::ConnectionType, QGenericReturnArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument) const () from /usr/lib/libQt5Core.so.5

26 0xb4ae7849 in QMetaObject::invokeMethod(QObject, char const, Qt::ConnectionType, QGenericReturnArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument) () from /usr/lib/libQt5Core.so.5

27 0x0832cf65 in QMetaObject::invokeMethod(QObject, char const, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument) ()

28 0x08329cf2 in RawDatabase::execNow(QVector const&) ()

29 0x08329a91 in RawDatabase::execNow(RawDatabase::Query const&) ()

30 0x083299cd in RawDatabase::execNow(QString const&) ()

31 0x08328e25 in RawDatabase::testUsable() ()

32 0x08328c1a in RawDatabase::openEncryptedDatabaseAtLatestVersion(QString const&) ()

33 0x08328b51 in RawDatabase::open(QString const&, QString const&) ()

34 0x08268e18 in ?? ()

35 0xb4b03b33 in QMetaCallEvent::placeMetaCall(QObject*) () from /usr/lib/libQt5Core.so.5

36 0xb4b07903 in QObject::event(QEvent*) () from /usr/lib/libQt5Core.so.5

37 0xb77415f8 in QApplicationPrivate::notify_helper(QObject, QEvent) () from /usr/lib/libQt5Widgets.so.5

38 0xb774bb46 in QApplication::notify(QObject, QEvent) () from /usr/lib/libQt5Widgets.so.5

39 0xb4ad5a0d in QCoreApplication::notifyInternal2(QObject, QEvent) () from /usr/lib/libQt5Core.so.5

40 0xb4ad5c6b in QCoreApplication::sendEvent(QObject, QEvent) () from /usr/lib/libQt5Core.so.5

41 0xb4ad8cf9 in QCoreApplicationPrivate::sendPostedEvents(QObject, int, QThreadData) () from /usr/lib/libQt5Core.so.5

42 0xb4ad9253 in QCoreApplication::sendPostedEvents(QObject*, int) () from /usr/lib/libQt5Core.so.5

43 0xb4b387c2 in ?? () from /usr/lib/libQt5Core.so.5

44 0xb0d8b7ae in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0

45 0xb0d8ba48 in ?? () from /usr/lib/libglib-2.0.so.0

46 0xb0d8bae5 in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0

47 0xb4b37ba4 in QEventDispatcherGlib::processEvents(QFlags) () from /usr/lib/libQt5Core.so.5

48 0xb4ad4032 in QEventLoop::exec(QFlags) () from /usr/lib/libQt5Core.so.5

49 0xb48d7bee in QThread::exec() () from /usr/lib/libQt5Core.so.5

50 0xb48d7cab in QThread::run() () from /usr/lib/libQt5Core.so.5

51 0xb48d8ffc in ?? () from /usr/lib/libQt5Core.so.5

52 0xb42fa517 in start_thread () from /lib/libpthread.so.0

53 0xb442a146 in clone () from /lib/libc.so.6