Bug 391355 - kbibtex crashes immediately after startup
Summary: kbibtex crashes immediately after startup
Status: RESOLVED WORKSFORME
Alias: None
Product: KBibTeX
Classification: Applications
Component: Compiling/packaging (show other bugs)
Version: git (master)
Platform: Other Linux
: NOR crash
Target Milestone: ---
Assignee: Thomas Fischer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-03-03 21:26 UTC by Gandalf Lechner
Modified: 2018-04-11 19:50 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
strace (882.86 KB, text/plain)
2018-03-18 17:52 UTC, Gandalf Lechner
Details
ltrace (14.25 KB, text/plain)
2018-03-18 17:52 UTC, Gandalf Lechner
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gandalf Lechner 2018-03-03 21:26:22 UTC
compiled from git, kbibtex crashes immediately after starting it:

Application: KBibTeX (kbibtex), signal: Segmentation fault
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[Current thread is 1 (Thread 0x7f3f956c2500 (LWP 6546))]

Thread 3 (Thread 0x7f3f60e94700 (LWP 6548)):
#0  0x00007f3f82062640 in g_poll () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#1  0x00007f3f82053169 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007f3f8205327c in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007f3f901dd49b in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#4  0x00007f3f90182e3a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#5  0x00007f3f8ffa23ca in QThread::exec() () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#6  0x00007f3f8e47de45 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5DBus.so.5
#7  0x00007f3f8ffa729d in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#8  0x00007f3f8315d7fc in start_thread (arg=0x7f3f60e94700) at pthread_create.c:465
#9  0x00007f3f8f8a9b5f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 2 (Thread 0x7f3f68a9f700 (LWP 6547)):
#0  0x00007f3f8f89d951 in __GI___poll (fds=0x7f3f68a9e938, nfds=1, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
#1  0x00007f3f81dec747 in ?? () from /usr/lib/x86_64-linux-gnu/libxcb.so.1
#2  0x00007f3f81dee53a in xcb_wait_for_event () from /usr/lib/x86_64-linux-gnu/libxcb.so.1
#3  0x00007f3f6a99df09 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5XcbQpa.so.5
#4  0x00007f3f8ffa729d in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#5  0x00007f3f8315d7fc in start_thread (arg=0x7f3f68a9f700) at pthread_create.c:465
#6  0x00007f3f8f8a9b5f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 1 (Thread 0x7f3f956c2500 (LWP 6546)):
[KCrash Handler]
#6  __memmove_avx_unaligned_erms () at ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:356
#7  0x00007f3f85ef6dfa in QByteArray::realloc(int) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#8  0x00007f3f943be8f8 in QDebug::~QDebug() () from /usr/lib/libqoauth.so.1
#9  0x000056001c3267f6 in main (argc=1, argv=0x7ffe4b00a238) at /home/gandalf/down/git/kbibtex/src/program/program.cpp:62
Comment 1 Thomas Fischer 2018-03-04 10:17:52 UTC
I strongly suspect the issue you encountered got introduced in commit 9f1f58bf24ee73332.

Please compile KBibTeX in a clean build directory and report back:
- Command line used to invoke cmake
- Any console output of the cmake run
(Output of make or ninja not required)
- The content of file kbibtex-version.h in the build directory
- The content of file src/parts/kbibtex-git-info.h in the build directory
Comment 2 Gandalf Lechner 2018-03-04 13:18:59 UTC
Hi Thomas, 

I used

cmake ../ -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=debug

(emptied the build dir before) which reports

-- Unity build disabled (default), use option UNITY_BUILD to enable it
-- Poppler: Qt5 requires Core
-- Found ICU 57.1.0
-- Found Qca-qt5 2.1.1 and QtOAuth
-- Found both QtWebEngine and QtWebKit, preferring to use QtWebEngine
-- The following OPTIONAL packages have been found:

 * Qt5Qml (required version >= 5.9.1)
 * Qt5Quick (required version >= 5.9.1)
 * Qt5WebChannel (required version >= 5.9.1)
 * Qt5Positioning (required version >= 5.9.1)
 * Qt5WebEngineCore (required version >= 5.9.1)
 * Qt5PrintSupport (required version >= 5.9.1)
 * Qt5WebEngineWidgets (required version >= 5.6.0)
 * Qt5WebKit (required version >= 5.9.1)
 * Qt5WebKitWidgets (required version >= 5.6.0)
 * KF5DocTools
 * PkgConfig
 * Qca-qt5 (required version >= 2.1.0)
 * QtOAuth
 * SharedMimeInfo, A database of common MIME types, <http://freedesktop.org/wiki/Software/shared-mime-info/>

-- The following REQUIRED packages have been found:

 * ECM (required version >= 5.19)
 * Qt5Core
 * Qt5Gui (required version >= 5.9.1)
 * Qt5Widgets
 * Qt5Network
 * Qt5XmlPatterns
 * Qt5 (required version >= 5.6.0)
 * Qt5Test (required version >= 5.6.0)
 * Gettext
 * PythonInterp
 * KF5I18n (required version >= 5.26.0)
 * KF5XmlGui (required version >= 5.26.0)
 * KF5KIO (required version >= 5.26.0)
 * KF5IconThemes (required version >= 5.26.0)
 * KF5ItemViews (required version >= 5.26.0)
 * KF5Completion (required version >= 5.26.0)
 * KF5Parts (required version >= 5.26.0)
 * KF5CoreAddons (required version >= 5.26.0)
 * KF5Service (required version >= 5.26.0)
 * KF5Wallet (required version >= 5.26.0)
 * KF5Crash (required version >= 5.26.0)
 * KF5 (required version >= 5.26.0)
 * Poppler, A PDF rendering library, <http://poppler.freedesktop.org>
 * ICU

-- Configuring done
-- Generating done
-- Build files have been written to: /home/gandalf/down/git/kbibtex/build

There are no errors during compiling.


kbibtex-version.h contains:

// This file was generated by ecm_setup_version(): DO NOT EDIT!

#ifndef KBIBTEX_VERSION_H
#define KBIBTEX_VERSION_H

#define KBIBTEX_VERSION_STRING "0.8.50"
#define KBIBTEX_VERSION_MAJOR 0
#define KBIBTEX_VERSION_MINOR 8
#define KBIBTEX_VERSION_PATCH 50
#define KBIBTEX_VERSION ((0<<16)|(8<<8)|(50))

#endif


and src/parts/kbibtex-git-info.h contains:


/// This file has been automatically generated by 'getgit.cmake'.
/// Do not edit or modify it.

#ifndef KBIBTEX_GIT_INFO_H
#define KBIBTEX_GIT_INFO_H
#define KBIBTEX_GIT_REV_STRING "5c09dcc4"
#define KBIBTEX_GIT_BRANCH_STRING "master"
#define KBIBTEX_GIT_INFO_STRING "5c09dcc4 (master)"
#endif // KBIBTEX_GIT_INFO_H
Comment 3 Thomas Fischer 2018-03-04 14:23:41 UTC
(In reply to Gandalf Lechner from comment #2)
> Hi Thomas, 
> 
> I used
> 
> cmake ../ -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=debug
> 
> (emptied the build dir before) which reports
> [..]

Unfortunately, this turned out to be inconclusive; everything looks fine.

More things to try:
- in files src/parts/partfactory.cpp, src/test/main.cpp, src/program/program.cpp, please replace every occurrence of function  strlen  with  qstrlen
- please report Linux distribution, used C++ compiler, and any other relevant information necessary to setup a system similar/identical to yours.
Comment 4 Gandalf Lechner 2018-03-04 15:00:26 UTC
I am using kubuntu 17.10, fully updated. On a different computer, I have kde neon ("developer edition"), and the behavior of kbibtex is identical on both systems.

The gcc versions on the two computers are (output of gcc --version)

gcc (Ubuntu 7.2.0-8ubuntu3.2) 7.2.0

and

gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609
Comment 5 Gandalf Lechner 2018-03-04 15:02:03 UTC
forgot to mention: Replacing strlen with qstrlen did not result in any noticable difference.
Comment 6 Thomas Fischer 2018-03-10 19:30:47 UTC
I set up virtual machines with both KDE Neon User Edition and Developer/Git unstable. In both cases, KBibTeX compiled and run without problems.

Given that I fail to reproduce your crash on two clean but otherwise identical systems suggests that there may be some left-over from an old KBibTeX causing problems.
You can try to uninstall and remove any KBibTeX system files (program binaries, .so files, ...) in /usr, /usr/local, ... before compiling/installing anew and then backup and move away any configuration files (search for '*kbibtex*' in ~/.config, ~/.local, and ~/.kde*).
Instead of moving configuration files, you may create a fresh user account on your system.

If KBibTeX still crashes, run KBibTeX through ltrace and strace:
strace -o /tmp/kbibtex-strace.txt /path/to/kbibtex
ltrace -o /tmp/kbibtex-ltrace.txt /path/to/kbibtex
Submit both kbibtex-*trace.txt files to this bug report.
Comment 7 Gandalf Lechner 2018-03-18 17:52:03 UTC
Created attachment 111484 [details]
strace
Comment 8 Gandalf Lechner 2018-03-18 17:52:19 UTC
Created attachment 111485 [details]
ltrace
Comment 9 Gandalf Lechner 2018-03-18 17:53:21 UTC
I hunted down and removed all files containing kbibtex in their names before compiling / installing from git again, but no luck. I now attached the outputs of strace and ltrace, hopefully they contain useful information.
Comment 10 Erik Quaeghebeur 2018-03-28 08:29:36 UTC
I have tried to get my KBibTeX to crash to help identify the underlying issue, but without success. I compiled with debug symbols, with gcc-6.4.0 (Gentoo stable). I will report back if I encounter a crash, but for now cannot help.

Perhaps build KBibTex with as few options as possible to start, to see if any of those are involved? (I compile without webkit/webengine support.) In case that works, you can add options one by one.
Comment 11 Thomas Fischer 2018-03-31 16:27:42 UTC
(In reply to Erik Quaeghebeur from comment #10)
> Perhaps build KBibTex with as few options as possible to start, to see if
> any of those are involved? (I compile without webkit/webengine support.) In
> case that works, you can add options one by one.
I tried to recreate a setup as described in the CMake output, e.g. QtWebEngine and QtWebkit installed in KDE Neon. I still try to get hold on some other KBibTeX user who can reproduce this issue.
Comment 12 Thomas Fischer 2018-04-11 19:50:10 UTC
I asked a number of people to try to reproduce this crash, but no one succeeded.

Alexander Dunlap send me an email stating: "I tried compiling with those flags but I didn't get a crash. Unfortunately I don't have much time at all to work on this right now but I will keep it in my inbox and will let you know if I have time to look at it and find anything."

So, given that no one except for the bug reporter is able to reproduce this crash and none of the provided data (traces etc.) was conclusive, I will close this bug.
Should new information turn up, please feel free to re-open this bug report.