Bug 1639901 - clementine 1.3.1-28 core dumps on start
Summary: clementine 1.3.1-28 core dumps on start
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: clementine
Version: 28
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
Assignee: Orphan Owner
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-10-16 21:22 UTC by Henrique Martins
Modified: 2018-11-07 06:19 UTC (History)
3 users (show)

Fixed In Version: clementine-1.3.1-30.20181020gitfb00835.fc29 clementine-1.3.1-29.fc28 clementine-1.3.1-29.fc27
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-10-30 17:30:57 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Henrique Martins 2018-10-16 21:22:10 UTC
Description of problem:

Clementine updated today to 1.3.1-28/
New release core dumps on startup.
Re-installed previous version (1.3.1-27) and it runs fine.

Version-Release number of selected component (if applicable):

clementine-1.3.1-27.fc28.x86_64.rpm

How reproducible:

Always

Steps to Reproduce:

1. run clementine

Actual results:

Core dumps after outputting:
13:59:35.678 WARN  unknown libpng warning: iCCP: known incorrect sRGB profile 
13:59:35.701 WARN  unknown QxtGlobalShortcut failed to register: "Space"  
13:59:35.797 WARN  unknown QPainter::begin: Paint device returned engine == 0, type: 2 
terminate called after throwing an instance of 'std::logic_error'
  what():  basic_string::_M_construct null not valid

Expected results:

Functional clementine.

Additional info:

For the record, 1.3.1-27 outputs the suff below at startup:
13:57:33.815 WARN  unknown libpng warning: iCCP: known incorrect sRGB profile 
13:57:33.838 WARN  unknown QxtGlobalShortcut failed to register: "Space"  
13:57:33.932 WARN  unknown QPainter::begin: Paint device returned engine == 0, type: 2 
13:57:34.099 WARN  unknown Object::connect: No such signal QtSingleApplication::messageReceived(QByteArray) 
13:57:34.099 WARN  unknown Object::connect:  (sender name:   'clementine') 
13:57:34.099 WARN  unknown Object::connect:  (receiver name: 'MainWindow') 
13:57:34.176 ERROR unknown JSonScanner::yylex - error while reading from io device  
13:57:34.176 ERROR unknown json_parser - syntax error found,  forcing abort, Line 1 Column 1  
13:57:40.770 WARN  unknown QxtGlobalShortcut failed to unregister: "Space"

Comment 1 Orcan Ogetbil 2018-10-16 23:49:51 UTC
Hard to tell from the output where the issue is. It could be one of the dependencies that -28 was built with.
I just updated the system and got the official -28 build and it works fine here. I cannot do much without reproducing, a core dump file, or at least a gdb backtrace.

Can you run clementine inside gdb and provide a backtrace?

Also you can try wiping the config and cache directories

rm -rf ~/.config/Clementine
rm -rf ~/.cache/Clementine

(or alternatively rename them temporarily)

Comment 2 Henrique Martins 2018-10-17 00:25:48 UTC
With or without the config and ccache directories the code seems to crash in the same place, inside ReloadSettings.
Here's gdb's stacktrace.

#0  0x00007fffefe18eab in raise () at /lib64/libc.so.6
#1  0x00007fffefe035b9 in abort () at /lib64/libc.so.6
#2  0x00007ffff07d9a9b in __gnu_cxx::__verbose_terminate_handler() [clone .cold.1] () at /lib64/libstdc++.so.6
#3  0x00007ffff07dfefc in __cxxabiv1::__terminate(void (*)()) () at /lib64/libstdc++.so.6
#4  0x00007ffff07dff57 in  () at /lib64/libstdc++.so.6
#5  0x00007ffff07e01b8 in  () at /lib64/libstdc++.so.6
#6  0x00007ffff07db9a7 in std::__throw_logic_error(char const*) [clone .cold.0] () at /lib64/libstdc++.so.6
#7  0x00005555559d0acc in MainWindow::ReloadSettings() ()
#8  0x00005555559d606c in MainWindow::MainWindow(Application*, SystemTrayIcon*, OSD*, QWidget*) ()
#9  0x0000555555857214 in main ()

After installing clementine-debuginfo it becomes (partial backtrace)

#9  0x00005555559d0acc in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct<char const*>(char const*, char const*) (__end=0xffffffffffffffff <error: Cannot access memory at address 0xffffffffffffffff>, __beg=0x0, this=0x7fffffffd700)
    at /usr/include/c++/8/bits/basic_string.h:255
#10 0x00005555559d0acc in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&) (__a=..., __s=<optimized out>, this=0x7fffffffd700)
    at /usr/include/c++/8/bits/basic_string.h:516
#11 0x00005555559d0acc in MainWindow::ReloadSettings() (this=0x7fffffffdb30)
    at /usr/src/debug/clementine-1.3.1-28.fc28.x86_64/src/ui/mainwindow.cpp:1029
#12 0x00005555559d606c in MainWindow::MainWindow(Application*, SystemTrayIcon*, OSD*, QWidget*) (this=0x7fffffffdb30, app=<optimized out>, tray_icon=<optimized out>, osd=<optimized out>, parent=<optimized out>)
    at /usr/src/debug/clementine-1.3.1-28.fc28.x86_64/src/ui/mainwindow.cpp:964
#13 0x0000555555857214 in main (argc=<optimized out>, argv=<optimized out>)
    at /usr/src/debug/clementine-1.3.1-28.fc28.x86_64/src/main.cpp:473
#14 0x00007fffefe0511b in __libc_start_main () at /lib64/libc.so.6
#15 0x000055555585f04a in _start () at /usr/include/QtCore/qstring.h:880

Comment 3 Henrique Martins 2018-10-17 00:40:40 UTC
Seems that ReloadSettings doesn't account for the case where the XDG_CURRENT_DESKTOP doesn't exist.  Rebuilding with that check

Comment 4 Henrique Martins 2018-10-17 00:54:52 UTC
This package doesn't build on my system.

  Package dependency requirement 'libmygpo-qt >= 1.0.9' could not be satisfied.
  Package 'libmygpo-qt' has version '1.0.8', required version is '>= 1.0.9'

Can't find 1.0.9 for Fedora. Would have to build from source.

  CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
  Please set them or make sure they are set and tested correctly in the CMake files: PROTOBUF_STATIC_LIBRARY
  linked by target "clementine-spotifyblob" in directory /home/henrique/rpmbuild/BUILD/Clementine-1.3.1/ext/clementine-spotifyblob

Comment 5 Henrique Martins 2018-10-17 01:08:33 UTC
After installing libproto-lite and cheating to bypass the error above, cmake complains about a bunch of missing 3rdparty directories (libprojectm, qtsingleapplication and qxt).

Guessing the source package is not to be used by us mere mortals.

Comment 6 Henrique Martins 2018-10-17 01:11:03 UTC
Creating those as empty directories seems to satisfy cmake.

Comment 7 Henrique Martins 2018-10-17 19:26:05 UTC
To fix the core dump, this line of clementine-disable-systray-gnome.patch:
+  if (std::string(xdg_desktop).find(std::string("GNOME")) != std::string::npos)
should probably be (or equivalent):
+  if (xdg_desktop == (const char*) 0 || std::string(xdg_desktop).find(std::string("GNOME")) != std::string::npos)

To fix the PROTOBUF_STATIC_LIBRARY, maybe add to clementine.spec?
BuildRequires:  protobuf-static

With those two changes clementine builds from spec but the process fails to build the binary and source rpms. 
However, the clementine.exe left in BUILDROOT/usr/bin works without core dumping.

These are the rpm build errors:
    Installed (but unpackaged) file(s) found:
   /path/to/rpmbuild/BUILD/Clementine-1.3.1/x86_64-redhat-linux-gnu/spotify/version16-64bit/blob
   /usr/bin/clementine-spotifyblob
   /usr/lib/debug/usr/bin/clementine-spotifyblob-1.3.1-28.fc28.x86_64.debug

Adding:
%{_bindir}/clementine-spotifyblob
to the %files section of clementine.spec gets rid of the last two, but as of now I'm left with:

RPM build errors:
    Installed (but unpackaged) file(s) found:
   /path/to/rpmbuild/BUILD/Clementine-1.3.1/x86_64-redhat-linux-gnu/spotify/version16-64bit/blob

Closer but still not yet all cleaned up

Comment 8 Orcan Ogetbil 2018-10-18 01:49:22 UTC
The backtrace is quite useful.

Can you tell me what Desktop Environment are you using, and what is the value of your environment variable XDG_CURRENT_DESKTOP?

Comment 9 Henrique Martins 2018-10-18 02:04:23 UTC
As I said in comment #3 my environment doesn't have a XDG_CURRENT_DESKTOP variable, so it doesn't have a value, or should I say, it is undefined. std::getenv returns a null pointer which should be checked by the code.

I don't use what is commonly called a Desktop Environment.  I do have a window manager, but no DE.

It would be nice if you also fixed the spec file.

Comment 10 Orcan Ogetbil 2018-10-18 02:11:17 UTC
Sorry I didn't refresh the webpage to read the rest of the messages. I just saw the backtrace.

So your system doesn't conform to standards. That explains it (never thought about such a use case)

Can you try this scratch build from koji?
https://koji.fedoraproject.org/koji/taskinfo?taskID=30300378

The SPEC file is fine. It is what is being used in the koji right now. Not sure what is wrong with your build system. Are you trying plain rpmbuild? If so, your build might be subject to nonstandard changes in your system. You can follow the standard packaging guidelines (e.g. use mock) to have a "non-contaminated" build, but this is a different topic.

Comment 11 Henrique Martins 2018-10-18 04:45:48 UTC
Scratch build starts fine, seems to work.

Yes, tried with rpmbuild, never had a problem with it and I've built tens of packages by now.  Installed mock and mock build seems to work (though now I have over 3GB extra stuff on my system).  Guess I'll switch to it, thanks.

Standard or not, the code was not checking for a potential null pointer return, which is a bug.

I've been using xdm/fvwm since 1993 or so, even before there was a GNOME or KDE or anything one could all a DE. Pretty "standard" stuff.

Comment 12 Orcan Ogetbil 2018-10-18 10:45:58 UTC
You're correct. It's a bug. I'll push the update later today.

Comment 13 Henrique Martins 2018-10-18 15:07:30 UTC
I had a F26 libspotify in my system.  Probably came with an old clementine, as dnf erasing it also erases clementine.  Probably installing a new clementine in the past didn't get rid of it.

After dnf erasing it, building clementine with rpmbuild works fine, no need for mock (though I'll use it in the future).

Also, in comment #7 I suggested to check
  if(xdg_desktop == (const char*) 0 || ...
but your patch has
  if(xdg_desktop && ...

This has the effect of, if systray is enabled in preferences, for the code to try and use the systray on a system that doesn't have XDG_CURRENT_DESKTOP, and thus, most likely, a systray.  Code works either way.

Comment 14 Orcan Ogetbil 2018-10-18 23:48:48 UTC
Right. The patch is to workaround a Gnome bug that crashes Clementine when the systray is enabled. See RHBZ#1517748

Comment 15 Fedora Update System 2018-10-19 02:20:15 UTC
clementine-1.3.1-29.fc29 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2018-72f5029a6e

Comment 16 Fedora Update System 2018-10-19 02:20:38 UTC
clementine-1.3.1-29.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2018-b732406744

Comment 17 Fedora Update System 2018-10-19 02:21:07 UTC
clementine-1.3.1-29.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2018-bda015f1a7

Comment 18 Orcan Ogetbil 2018-10-19 02:21:54 UTC
Updates filed. Thank you for the bug report and the help provided. Much appreciated.

Comment 19 Fedora Update System 2018-10-19 16:43:48 UTC
clementine-1.3.1-29.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-bda015f1a7

Comment 20 Fedora Update System 2018-10-19 16:52:58 UTC
clementine-1.3.1-29.fc28 has been pushed to the Fedora 28 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-b732406744

Comment 21 Fedora Update System 2018-10-20 19:23:43 UTC
clementine-1.3.1-29.fc29 has been pushed to the Fedora 29 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-72f5029a6e

Comment 22 Fedora Update System 2018-10-23 17:28:59 UTC
clementine-1.3.1-30.20181020gitfb00835.fc29 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2018-e8e0b14959

Comment 23 Fedora Update System 2018-10-24 15:40:45 UTC
clementine-1.3.1-30.20181020gitfb00835.fc29 has been pushed to the Fedora 29 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-e8e0b14959

Comment 24 Fedora Update System 2018-10-30 17:30:57 UTC
clementine-1.3.1-30.20181020gitfb00835.fc29 has been pushed to the Fedora 29 stable repository. If problems still persist, please make note of it in this bug report.

Comment 25 Fedora Update System 2018-11-06 21:12:57 UTC
clementine-1.3.1-29.fc28 has been pushed to the Fedora 28 stable repository. If problems still persist, please make note of it in this bug report.

Comment 26 Fedora Update System 2018-11-07 06:19:05 UTC
clementine-1.3.1-29.fc27 has been pushed to the Fedora 27 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.