Desktop: Client crashes with SEGFAULT since 2.5.0

Created on 26 Nov 2018  路  14Comments  路  Source: nextcloud/desktop

Expected behaviour

The client should not SEGFAULT.

Actual behaviour

Client crashes after a few minutes since update to 2.5.0. Happens on two machines running Ubuntu 18.04 with Gnome Flashback. Seems to be triggered by compilation of a large LaTeX document. I have set an ignore list for most LaTeX auxiliary files as well as the underlying .git dir.
Happens with version from ppa as well as AppImage. I have also tried daily build from 2018-11-23.
It seems to be more stable with gdb attached.

Steps to reproduce

  1. Start client
  2. Work on LaTeX document and compile
  3. Repeat 2 until client eventually crashes
    strace.txt

Client configuration

Client version:2.5.0-20181111.015125~bionic1

Operating system: Ubuntu 18.04 with Gnome Flashback Session

OS language: English

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

Client package (From Nextcloud or distro) (Linux only): ppa or AppImage

Installation path of client: /usr/bin/nextcloud

Server configuration

Operating system: Ubuntu 18.04 Server

Web server: Apache

Database: MySQL

PHP version: 7.2.10

Nextcloud version: 14.0.4

Storage backend (external storage): No

Logs

Please use Gist (https://gist.github.com/) or a similar code paster for longer
logs.

  1. Client logfile:
    strace: https://gist.github.com/HorstBort/8a08722277e6b3dd810f2e2504e0cd76
    gdb backtrace: https://gist.github.com/HorstBort/7d7edeadb36a21158f8d525cdd6e9323
    client log: https://gist.github.com/HorstBort/8a3ec9df8e8dc315c589a7b560f7952b
  2. Web server error log:

  3. Server logfile: nextcloud log (data/nextcloud.log):

0. Needs triage os Linux

Most helpful comment

Same here with 2.5.1 on Gentoo Linux.

All 14 comments

I have similar problem. Logs from kcrash: https://gist.github.com/jkolo/9f348b5b7ee3c85225a8cf6abbc64fae

Same problem with AppImage 2.5.0 on Latest Linux Mint 18, while 2.3.3 works. Also tried 2.5.1 in the download folder, but it also fails.

Same problem still with 2.5.1-20181204.111806~bionic1 from ppa.

Client crashes as well in Ubuntu Mate 18.04. Installed from the ppa

$ nextcloud --version
Nextcloud version 2.5.1git
Using Qt 5.9.5, built against Qt 5.9.5
Using 'OpenSSL 1.1.0g  2 Nov 2017'

I 've send more than 3 bug reports through the ubuntu prompt after the client crashed since last Sunday. And even more the weeks before that after the upgrade to 2.5.0

I 've also posted a comment there #838. Problems are probably related.

Same issue on OpenSUSE Tumbleweed and client 2.5.1, while using 2.3.3 from flathub/flatpak repo works fine.

When it starts connecting to my server it crashes after I enter my user and password.

alby@openSUSE-xeon:~> nextcloud
[32554:32623:0105/154445.825340:ERROR:cert_verify_proc_nss.cc(977)] CERT_PKIXVerifyCert for 192.168.1.250 failed err=-8179
Received signal 11 <unknown> 000000000000
#0 0x7f319733c0ce <unknown>
#1 0x7f319733af73 <unknown>
#2 0x7f319733c045 <unknown>
#3 0x7f3190556110 <unknown>
#4 0x7f3190d3c583 <unknown>
#5 0x7f31972f068a <unknown>
#6 0x7f31972f084f <unknown>
#7 0x7f3196c8749c <unknown>
#8 0x7f3196c875c5 <unknown>
#9 0x7f3196c87a6f <unknown>
#10 0x7f3196fbe47f <unknown>
#11 0x7f3196fcca6a <unknown>
#12 0x7f3196de9589 <unknown>
#13 0x7f3196de9751 <unknown>
#14 0x7f3196df0337 <unknown>
#15 0x7f3196df0551 <unknown>
#16 0x7f3196dd2191 <unknown>
#17 0x7f3196df4df4 <unknown>
#18 0x7f3196df4f59 <unknown>
#19 0x7f3196ec3f45 <unknown>
#20 0x7f319729ed33 <unknown>
#21 0x7f31972c52da <unknown>
#22 0x7f31972c599f <unknown>
#23 0x7f31972c5b28 <unknown>
#24 0x7f31957029a4 <unknown>
#25 0x7f31910c191b QObject::event()
#26 0x7f3191a88591 QApplicationPrivate::notify_helper()
#27 0x7f3191a8fb50 QApplication::notify()
#28 0x7f3191097359 QCoreApplication::notifyInternal2()
#29 0x7f319109a357 QCoreApplicationPrivate::sendPostedEvents()
#30 0x7f31910ec263 <unknown>
#31 0x7f319c3c6c15 g_main_context_dispatch
#32 0x7f319c3c6fd8 <unknown>
#33 0x7f319c3c706c g_main_context_iteration
#34 0x7f31910eb873 QEventDispatcherGlib::processEvents()
#35 0x7f319109602b QEventLoop::exec()
#36 0x7f319109e192 QCoreApplication::exec()
#37 0x55e4b89ea6bc main
#38 0x7f3190540feb __libc_start_main
#39 0x55e4b89eab7a _start
  r8: 0000000000000001  r9: 0000000000000003 r10: 0000000000000000 r11: 0000000000000000
 r12: 000055e4b96e6330 r13: 000055e4b98420b0 r14: 00007f319a6a1da0 r15: 00007ffd48841f28
  di: 000055e4b98420b0  si: 000055e4b96e6330  bp: 00007ffd48841eb0  bx: 000055e4b98420b0
  dx: 3ff0000000000000  ax: 3ff0000000000000  cx: 000055e4b8d4a020  sp: 00007ffd48841e98
  ip: 00007f3190d3c583 efl: 0000000000010206 cgf: 002b000000000033 erf: 0000000000000000
 trp: 000000000000000d msk: 0000000000000000 cr2: 0000000000000000
[end of stack trace]
Calling _exit(1). Core file will not be generated.

Same here with 2.5.1 on Gentoo Linux.

same here with ubuntu 18.04 using 2.5.1 from the ppa:

Stacktrace:

 #0  0x00007fa16c00a920 in  ()
 #1  0x00007fa1ae1be82c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
 #2  0x00007fa1ae1c60f4 in QApplication::notify(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
 #3  0x00007fa1ad4409a8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
 #4  0x00007fa1ad44311d in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
 #5  0x00007fa1ad49a2c3 in  () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
 #6  0x00007fa1aa060387 in g_main_context_dispatch () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
 #7  0x00007fa1aa0605c0 in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
 #8  0x00007fa1aa06064c in g_main_context_iteration () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
 #9  0x00007fa1ad4998ef in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
 #10 0x00007fa1ad43e9ea in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
 #11 0x00007fa1ad447a84 in QCoreApplication::exec() () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
 #12 0x00005614ad842abf in main ()

Hello everyone,

This message is only here to bring more clarity, and may be limit the flood of the ticket.

I looked a little bit at the backtraces and straces posted here, I must tell you that some of the errors posted here are not quite the same.
They end-up in the same result: the client crashes
But they are not all coming from the same actual error. I actually noticed that some SegFault where due to external packages (liQt5xxxx.so, libssl.so, ...). They may have been fixed already the may not.

So for example from the little look I took, the erros/SegFault posted from the following users do not seem to be located in the source code of NextCloudApp:

  • @jkolo (it seems that Qt failed trying to grow a text String)
  • Iolaum the error you refer to #838 is due to the libcrypto.so which is part of the ssl lib, about your error I can not tell yet.
  • @Thorsten42 it seem the error was located in Qt5

The following errors need more information to clarify it is the Nextcloud source code that is impacted or not:

  • @Iolaum you error might be located in Nextcloud, might be not, but your traces shows some help to start investigating.
  • @maxidorius please attach some traces, like debug output of NextCloud app, or even better a gdb backtrace if you can, without it impossible to tell if it is due to the project or some external libs
  • @bobafetthotmail same here some traces are needed to help reproducing the bug to be able to fix it. If you can a gdb batcktrace when the error has occurred is so much faster I believe.
  • @tkurbad It is the same issue. Your client crashes but nothing tells us if it is for the same reason or not.

In fact the only error that is a segfault is coming for sure from Nextcloud source code is the original ticket error from @HorstBort , which I thanks for the gdb backtrace that tell exactly the right function to look for in the sources code.

@lavigne958 You are right that it could well be a dependency.

Thinking along those lines, I compiled the desktop client locally to test it. I describe the process in #1146 because I encountered another issue. I don't think that this disproves your point, especially since I didn't run unit tests before compiling. I compiled (only seeing warnings with default gcc7 compiler) and installed the client on my system to see if that would make the crashes go away. They did not. I haven't taken an log of the client crashing, I thought there are more than enough posted here already. I will try to look into it again at some point.

In any case, thank you for taking a look into this.

Nice, Once you have fix the issue with the location of libsync, it would be great if you can let you nextcloud client app run in gdb to obtain a backtrace or find what specific patern makes your client crash, like you said, move files around.

Tested 2.5.1 as packaged in Ubuntu Mate 19.10 and 2.5.2 AppImage, both crashed.
2.5.1 AppImage worked.

I've seen another segfault cause and found a workaround.

In my case it's a machine running Ubuntu Server 18.04.2 LTS (bionic). The key to this is that the machine is running remote-X11 and NoMachine and acting as a kind of single-user terminal server.

The other key to this is that the machine is fitted with an nVidia graphics card (a GeForce 210) in a PCIe slot, along with the nVidia drivers.

nVidia's drivers override the Mesa GL libraries:

philpem@syrys:~$ dpkg -S /usr/lib/x86_64-linux-gnu/libGL.so.1*
diversion by nvidia-340 from: /usr/lib/x86_64-linux-gnu/libGL.so.1
diversion by nvidia-340 to: /usr/lib/x86_64-linux-gnu/libGL.so.1.distrib
libgl1:amd64, nvidia-340: /usr/lib/x86_64-linux-gnu/libGL.so.1
libgl1:amd64: /usr/lib/x86_64-linux-gnu/libGL.so.1.0.0
diversion by nvidia-340 from: /usr/lib/x86_64-linux-gnu/libGL.so.1
diversion by nvidia-340 to: /usr/lib/x86_64-linux-gnu/libGL.so.1.distrib

Now I've set the scene -- here's where Nextcloud falls down.

  1. Install Nextcloud from the PPA
  2. Run Nextcloud on the remote X session. After you enter the Nextcloud site URL, you'll get a segmentation fault.
  3. Run Nextcloud on the physical console. It'll work fine. You'll enter the URL, click next, then get a web browser window.

The issue is that Nextcloud loads the system default libGL.so.1, which happens to be the nVidia one. nVidia's libGL can't handle terminal server setups (at least at version 340).

There's a very easy workaround for this:

$ LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libGL.so.1.0.0 nextcloud

This forces the dynamic linker to preload Mesa OpenGL, which works fine on the remote terminal.

Please provide information about further segfault occurences in #241 , thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nilsbecker picture nilsbecker  路  3Comments

dkebler picture dkebler  路  3Comments

AndreyNazarchuk picture AndreyNazarchuk  路  4Comments

Engineer-of-Stuff picture Engineer-of-Stuff  路  3Comments

linucksrox picture linucksrox  路  3Comments