Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segmentation fault since update from 3.0.2 to 3.0.3 [Linux/Nix] #2636

Closed
caugner opened this issue Nov 13, 2020 · 20 comments
Closed

Segmentation fault since update from 3.0.2 to 3.0.3 [Linux/Nix] #2636

caugner opened this issue Nov 13, 2020 · 20 comments

Comments

@caugner
Copy link
Contributor

caugner commented Nov 13, 2020

Downstream: NixOS/nixpkgs#103680

Expected behaviour

After updating the Linux desktop client from 3.0.2 to 3.0.3, it should still run like before.

Actual behaviour

The Linux desktop client crashes with a segmentation fault immediately after startup:

$ nextcloud --logdebug --logfile nextcloud-debug.log
Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
[1]    11972 segmentation fault (core dumped)  nextcloud --logdebug --logfile nextcloud-debug.log

Steps to reproduce

  1. Install NixOS/Nix and add nixos-unstable channel.
  2. Install nextcloud-client.
  3. Run nextcloud.

Client configuration

Client version: 3.0.3

Operating system: NixOS 20.09

OS language: English

Qt version used by client package (Linux only, see also Settings dialog):

$ nextcloud --version
Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
Nextcloud version 3.0.3git
Git revision 78da725ac38e1508e5800d02fd1700a4e43b1088
Using Qt 5.14.2, built against Qt 5.14.2
Using Qt platform plugin 'xcb'
Using 'OpenSSL 1.1.1g  21 Apr 2020'
Running on NixOS 20.09 (Nightingale), x86_64

Client package (From Nextcloud or distro) (Linux only): nixos/unstable/nextcloud-client

Installation path of client: /run/current-system/sw/bin/nextcloud

Logs

  1. Client logfile:
$ tail nextcloud-debug.log 
2020-11-13 18:10:24:498 [ debug nextcloud.sync.database ]	[ OCC::SyncJournalDb::commitInternal ]:	Transaction commit  "update database structure: add e2eMangledName index" and starting new transaction
2020-11-13 18:10:24:498 [ debug nextcloud.sync.database.sql ]	[ OCC::SqlQuery::exec ]:	SQL exec "PRAGMA table_info('blacklist');"
2020-11-13 18:10:24:498 [ debug nextcloud.sync.database ]	[ OCC::SyncJournalDb::tableColumns ]:	Columns in the current journal:  QVector("path", "lastTryEtag", "lastTryModtime", "retrycount", "errorstring", "lastTryTime", "ignoreDuration", "renameTarget", "errorCategory")
2020-11-13 18:10:24:498 [ debug nextcloud.sync.database.sql ]	[ OCC::SqlQuery::exec ]:	SQL exec "CREATE INDEX IF NOT EXISTS blacklist_index ON blacklist(path collate nocase);"
2020-11-13 18:10:24:498 [ debug nextcloud.sync.database.sql ]	[ OCC::SqlQuery::exec ]:	Last exec affected 0 rows.
2020-11-13 18:10:24:498 [ debug nextcloud.sync.database ]	[ OCC::SyncJournalDb::commitInternal ]:	Transaction commit  "checkConnect End" 
2020-11-13 18:10:24:498 [ debug nextcloud.sync.database.sql ]	[ OCC::SqlQuery::exec ]:	SQL exec "SELECT COUNT(*) FROM metadata"
2020-11-13 18:10:24:498 [ debug nextcloud.sync.database.sql ]	[ OCC::SqlQuery::bindValue ]:	SQL bind 1 QVariant(int, 3)
2020-11-13 18:10:24:498 [ debug nextcloud.sync.database.sql ]	[ OCC::SqlQuery::exec ]:	SQL exec "SELECT path FROM selectivesync WHERE type=?1"
2020-11-13 18:10:24:499 [ info nextcloud.sync.clientproxy ]:	Set proxy configuration to use the preferred system proxy for http tcp connections

3.0.3 crashes here, but in 3.0.2 the next log lines would be:

2020-11-13 20:37:50:415 [ info nextcloud.sync.clientproxy ]:    Set proxy configuration to use the preferred system proxy for http tcp connections
2020-11-13 20:37:51:533 [ debug nextcloud.gui.systray ] [ OCC::Systray::computeWindowReferencePoint ]:  screenRect: QRect(0,0 3840x2160)
2020-11-13 20:37:51:533 [ debug nextcloud.gui.systray ] [ OCC::Systray::computeWindowReferencePoint ]:  taskbarRect: QRect(0,0 32x2160)
2020-11-13 20:37:51:533 [ debug nextcloud.gui.systray ] [ OCC::Systray::computeWindowReferencePoint ]:  taskbarScreenEdge: OCC::Systray::TaskBarPosition::Right
2020-11-13 20:37:51:533 [ debug nextcloud.gui.systray ] [ OCC::Systray::computeWindowReferencePoint ]:  trayIconCenter: QPoint(3587,1561)
2020-11-13 20:37:51:534 [ debug nextcloud.gui.systray ] [ OCC::Systray::computeWindowPosition ]:        taskbarScreenEdge: OCC::Systray::TaskBarPosition::Right
2020-11-13 20:37:51:534 [ debug nextcloud.gui.systray ] [ OCC::Systray::computeWindowPosition ]:        screenRect: QRect(0,0 3840x2160)
2020-11-13 20:37:51:534 [ debug nextcloud.gui.systray ] [ OCC::Systray::computeWindowPosition ]:        windowRect (reference) QRect(3403,1561 401x511)
2020-11-13 20:37:51:534 [ debug nextcloud.gui.systray ] [ OCC::Systray::computeWindowPosition ]:        windowRect (adjusted ) QRect(3403,1561 401x511)
2020-11-13 20:37:51:562 [ info nextcloud.sync.credentials.webflow ]:    Fetch from keychain!
  1. Web server error log: (not applicable, client crashes on startup)

  2. Server logfile: nextcloud log (data/nextcloud.log): (not applicable, client crashes on startup)

@caugner
Copy link
Contributor Author

caugner commented Nov 13, 2020

3.0.2...3.0.3 has some changes related to the systray, so maybe that's the source of the error?

@hoppla20
Copy link

I have the same problem, did you manage to solve this issue?

@caugner
Copy link
Contributor Author

caugner commented Nov 15, 2020

@hoppla20 Not yet. Are you also using Nix or do you have the problem on another distro/platform?

@hoppla20
Copy link

Yes I am also using Nix Unstable, I'm currently just trying to create an overlay with the 3.0.2 Version so I can use Nextcloud again 😅

@hoppla20
Copy link

If anybody just wants a quickfix (using 3.0.2 instead of 3.0.3) you can use this overlay

self: super:
{
  nextcloud-client = super.nextcloud-client.overrideAttrs (old: {
    version = "3.0.2";

    src = super.fetchFromGitHub {
      owner = "nextcloud";
      repo = "desktop";
      rev = "v3.0.2";
      sha256 = "0qzriiaj6sjdkgh61iihvpsvhi0kvfwjz1vvjnwdlfdx2s4xmv24";
    };
  });
}

@caugner
Copy link
Contributor Author

caugner commented Nov 15, 2020

Please consider posting the solution in the Nix-related downstream issue: NixOS/nixpkgs#103680

@hoppla20
Copy link

Oh, didn't see this issue. Thanks, I will post it there.

@er-vin
Copy link
Member

er-vin commented Nov 16, 2020

Could we have a backtrace of the crash please?

@hoppla20
Copy link

I will try to upgrade again when I get home, I will give you an update later today

@hoppla20
Copy link

I can't seem to reproduce this anymore. Now it runs fine.

@er-vin
Copy link
Member

er-vin commented Nov 18, 2020

If @caugner confirms it's the same for him I'll just close this one I guess.

@caugner
Copy link
Contributor Author

caugner commented Nov 20, 2020

@er-vin We have now got a backtrace:

$ nextcloud
2020-11-20 13:53:58:001 [ debug default ]	[ unknown ]:	static bool LibSecretKeyring::findPassword(const QString&, const QString&, QKeychain::JobPrivate*)
[1]    3985 segmentation fault (core dumped)  nextcloud

@er-vin
Copy link
Member

er-vin commented Nov 23, 2020

@er-vin We have now got a backtrace:

$ nextcloud
2020-11-20 13:53:58:001 [ debug default ]	[ unknown ]:	static bool LibSecretKeyring::findPassword(const QString&, const QString&, QKeychain::JobPrivate*)
[1]    3985 segmentation fault (core dumped)  nextcloud

I might be daft, but I didn't find the backtrace on the issue you linked. Did I miss anything?

@AmandaCameron
Copy link

The sigsegv seems to be happening inside a Qt-managed thread possibly, I'm not that familiar with gdb (It's rare I program in C/C++) so I'm not sure how to trace this farther:

(gdb) bt
#0  0x00007f2ecc7cac24 in ?? () from /nix/store/ylwfpgqkfac087kn103pbrxpkamq4igf-qtdeclarative-5.14.2/lib/libQt5Qml.so.5
#1  0x00007f2ecc7cdc4a in ?? () from /nix/store/ylwfpgqkfac087kn103pbrxpkamq4igf-qtdeclarative-5.14.2/lib/libQt5Qml.so.5
#2  0x00007f2ecc7ce0bb in ?? () from /nix/store/ylwfpgqkfac087kn103pbrxpkamq4igf-qtdeclarative-5.14.2/lib/libQt5Qml.so.5
#3  0x00007f2ecc7ce0bb in ?? () from /nix/store/ylwfpgqkfac087kn103pbrxpkamq4igf-qtdeclarative-5.14.2/lib/libQt5Qml.so.5
#4  0x00007f2ecc7ce0bb in ?? () from /nix/store/ylwfpgqkfac087kn103pbrxpkamq4igf-qtdeclarative-5.14.2/lib/libQt5Qml.so.5
#5  0x00007f2ecc7ce0bb in ?? () from /nix/store/ylwfpgqkfac087kn103pbrxpkamq4igf-qtdeclarative-5.14.2/lib/libQt5Qml.so.5
#6  0x00007f2ecc7ce0bb in ?? () from /nix/store/ylwfpgqkfac087kn103pbrxpkamq4igf-qtdeclarative-5.14.2/lib/libQt5Qml.so.5
#7  0x00007f2ecc7ce0bb in ?? () from /nix/store/ylwfpgqkfac087kn103pbrxpkamq4igf-qtdeclarative-5.14.2/lib/libQt5Qml.so.5
#8  0x00007f2ecc7c9795 in ?? () from /nix/store/ylwfpgqkfac087kn103pbrxpkamq4igf-qtdeclarative-5.14.2/lib/libQt5Qml.so.5
#9  0x00007f2ecc7138f7 in ?? () from /nix/store/ylwfpgqkfac087kn103pbrxpkamq4igf-qtdeclarative-5.14.2/lib/libQt5Qml.so.5
#10 0x00007f2ecc717d99 in ?? () from /nix/store/ylwfpgqkfac087kn103pbrxpkamq4igf-qtdeclarative-5.14.2/lib/libQt5Qml.so.5
#11 0x00007f2ecc703c85 in QQmlDataBlob::tryDone() () from /nix/store/ylwfpgqkfac087kn103pbrxpkamq4igf-qtdeclarative-5.14.2/lib/libQt5Qml.so.5
#12 0x00007f2ecc764843 in QQmlTypeLoader::setData(QQmlDataBlob*, QQmlDataBlob::SourceCodeData const&) () from /nix/store/ylwfpgqkfac087kn103pbrxpkamq4igf-qtdeclarative-5.14.2/lib/libQt5Qml.so.5
#13 0x00007f2ecc764b94 in QQmlTypeLoader::setData(QQmlDataBlob*, QString const&) () from /nix/store/ylwfpgqkfac087kn103pbrxpkamq4igf-qtdeclarative-5.14.2/lib/libQt5Qml.so.5
#14 0x00007f2ecc7652f0 in QQmlTypeLoader::loadThread(QQmlDataBlob*) () from /nix/store/ylwfpgqkfac087kn103pbrxpkamq4igf-qtdeclarative-5.14.2/lib/libQt5Qml.so.5
#15 0x00007f2ecc71f95d in ?? () from /nix/store/ylwfpgqkfac087kn103pbrxpkamq4igf-qtdeclarative-5.14.2/lib/libQt5Qml.so.5
#16 0x00007f2ecc7e6ec8 in ?? () from /nix/store/ylwfpgqkfac087kn103pbrxpkamq4igf-qtdeclarative-5.14.2/lib/libQt5Qml.so.5
#17 0x00007f2ecc7e7592 in ?? () from /nix/store/ylwfpgqkfac087kn103pbrxpkamq4igf-qtdeclarative-5.14.2/lib/libQt5Qml.so.5
#18 0x00007f2ecb761ccf in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /nix/store/i0b468mmnqgi1q5nnpk52a125qvwb53n-qtbase-5.14.2/lib/libQt5Widgets.so.5
#19 0x00007f2ecb76ae00 in QApplication::notify(QObject*, QEvent*) () from /nix/store/i0b468mmnqgi1q5nnpk52a125qvwb53n-qtbase-5.14.2/lib/libQt5Widgets.so.5
#20 0x00007f2ecac97562 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /nix/store/i0b468mmnqgi1q5nnpk52a125qvwb53n-qtbase-5.14.2/lib/libQt5Core.so.5
#21 0x00007f2ecac99d84 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /nix/store/i0b468mmnqgi1q5nnpk52a125qvwb53n-qtbase-5.14.2/lib/libQt5Core.so.5
#22 0x00007f2ecacef073 in ?? () from /nix/store/i0b468mmnqgi1q5nnpk52a125qvwb53n-qtbase-5.14.2/lib/libQt5Core.so.5
#23 0x00007f2ed4c49c4d in g_main_dispatch (context=0x7f2e7c000c20) at ../glib/gmain.c:3325
#24 g_main_context_dispatch (context=context@entry=0x7f2e7c000c20) at ../glib/gmain.c:4043
#25 0x00007f2ed4c49ed0 in g_main_context_iterate (context=context@entry=0x7f2e7c000c20, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/gmain.c:4119
#26 0x00007f2ed4c49f5f in g_main_context_iteration (context=0x7f2e7c000c20, may_block=1) at ../glib/gmain.c:4184
#27 0x00007f2ecacee6ce in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /nix/store/i0b468mmnqgi1q5nnpk52a125qvwb53n-qtbase-5.14.2/lib/libQt5Core.so.5
#28 0x00007f2ecac9607b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /nix/store/i0b468mmnqgi1q5nnpk52a125qvwb53n-qtbase-5.14.2/lib/libQt5Core.so.5
#29 0x00007f2ecaab24ab in QThread::exec() () from /nix/store/i0b468mmnqgi1q5nnpk52a125qvwb53n-qtbase-5.14.2/lib/libQt5Core.so.5
#30 0x00007f2ecc7e6b85 in ?? () from /nix/store/ylwfpgqkfac087kn103pbrxpkamq4igf-qtdeclarative-5.14.2/lib/libQt5Qml.so.5
#31 0x00007f2ecaab371a in ?? () from /nix/store/i0b468mmnqgi1q5nnpk52a125qvwb53n-qtbase-5.14.2/lib/libQt5Core.so.5
#32 0x00007f2eca4c6e9e in start_thread (arg=0x7f2e9d4cb640) at pthread_create.c:463
#33 0x00007f2eca5d766f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

@AmandaCameron
Copy link

Appologies for the double-post, but I think this may be a problem with qt upstream. I noticed that there's a ~/.cache/Nextcloud/qmlcache folder, and mv'ing that to a diffeent name, now suddenly 3.0.3 works fine,with no further changes. I kept the old one around to move back if anyone has any gdb tips for better debugging this though.

@tobiasBora
Copy link

I can also confirm this same issue, and I also confirm the fix of AmandaCameron (I used a more direct solution):

mv ~/.cache/Nextcloud/ ~/.cache/Nextcloud_old

also, if it helps, running with nextcloud --logdebug --logfile nextcloud-debug.log gives me on the last line:

[...]
2020-12-12 23:28:20:282 [ info nextcloud.sync.clientproxy ]:    Set proxy configuration to use the preferred system proxy for http tcp connections

@github-actions
Copy link

This bug report did not receive an update in the last 4 weeks. Please take a look again and update the issue with new details, otherwise the issue will be automatically closed in 2 weeks. Thank you!

@karthikiyengar
Copy link

❯ nextcloud --version                                                                                                                     ─╯
Nextcloud version 3.2.1git
Git revision 5901a0f9835261a640cd8bc9397bcd3068f2acd8
Using Qt 5.15.2, built against Qt 5.15.2
Using Qt platform plugin 'xcb'
Using 'OpenSSL 1.1.1k  25 Mar 2021'
Running on NixOS 21.05 (Okapi), x86_64

~                                                                                                                                02:01:32 ─╮
❯ nextcloud                                                                                                                               ─╯
zsh: segmentation fault (core dumped)  nextcloud

Sadly, I'm still having this issue despite removing the .cache and .config files. It refuses to open on XMonad and GNOME, but it sort of works under KDE, really unsure what the issue is.

Here's a pastebin of the log: https://pastebin.com/ddeDP2BS

@caugner
Copy link
Contributor Author

caugner commented Jun 16, 2021

@karthikiyengar The segmentation fault you're experiencing could be fixed in v3.2.2.

@karthikiyengar
Copy link

@caugner - I can confirm that it works with v3.2.2. Thanks :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants