Bug 398416 - Crash on startup via Panel icon
Summary: Crash on startup via Panel icon
Status: RESOLVED FIXED
Alias: None
Product: palapeli
Classification: Applications
Component: general (other bugs)
Version First Reported In: 2.0
Platform: Debian testing Linux
: NOR crash
Target Milestone: ---
Assignee: Stefan Majewsky
URL:
Keywords:
: 411407 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-09-09 10:21 UTC by Peter Hillier-Brook
Modified: 2021-12-09 16:27 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Screenshot of bug assistant output. (1.40 MB, image/png)
2018-09-09 17:17 UTC, Peter Hillier-Brook
Details
Output of valgrind as requested (2.33 KB, text/plain)
2018-09-20 22:00 UTC, Peter Hillier-Brook
Details
Requested output of gdb (1.91 KB, text/plain)
2018-09-21 15:45 UTC, Peter Hillier-Brook
Details
Corrected gdb output (3.01 KB, text/plain)
2018-09-22 09:55 UTC, Peter Hillier-Brook
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Hillier-Brook 2018-09-09 10:21:40 UTC
Every startup attempt crashes with a seg fault. Nearly every second attempt works.

Version is 2.1 on Debian Buster
Comment 1 Christoph Feck 2018-09-09 12:53:46 UTC
If the crash is reproducible, please add the backtrace for the crash. For more information, please see https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
Comment 2 Peter Hillier-Brook 2018-09-09 17:17:10 UTC
Created attachment 114862 [details]
Screenshot of bug assistant output.

Debug symbols installed, but still no useful crash information. Dialogue box attached.
Comment 3 Albert Astals Cid 2018-09-09 18:05:15 UTC
Are you sure about that screenshot? I don't see anything palapeli related there
Comment 4 Peter Hillier-Brook 2018-09-09 21:40:49 UTC
Sorry about the duff screenshot. It showed that there was no useful backtrace and I'm presently unable to reproduce the crash since installing the debug package. Also, all my completed puzzles are no longer available, just boxes with "Loading puzzle..." in lieu of the images.
Comment 5 Albert Astals Cid 2018-09-19 20:10:37 UTC
Can you run the program thorugh valgrind in a terminnal
 valgrind palapeli
and attach the output?
Comment 6 Peter Hillier-Brook 2018-09-20 22:00:57 UTC
Created attachment 115131 [details]
Output of valgrind as requested

I don't know how useful the valgrind data are, but I'm more than happy to do as I'm told.

PS The seg fault appears to be occurring during the loading and populating of the sheet of completed puzzles.
Comment 7 Albert Astals Cid 2018-09-20 22:41:39 UTC
Arg, you have an old valgrind that doesn't like new Qt.

Can you try with 
gdb palapeli
run
**** make it crash ****
bt
**** attach here the output ****
Comment 8 Peter Hillier-Brook 2018-09-21 15:45:29 UTC
Created attachment 115148 [details]
Requested output of gdb

It looks as if we are closer - seg fault in the gdb run. Not completely clear about "make it crash" so Ctrl D and 'y'

For info, Buster has valgrind as version 3.13.0 which shows as current on the valgrind web site.
Comment 9 Christoph Feck 2018-09-21 18:20:10 UTC
You forgot the 'bt' command in gdb to actually get the backtrace.
Comment 10 Peter Hillier-Brook 2018-09-21 21:39:37 UTC
I didn't forget the 'bt'. It was the "make it crash" that stumped me. How would you suggest that I do this?
Comment 11 Christoph Feck 2018-09-21 23:07:51 UTC
The 'gdb' log from comment #8 shows that Palapeli already crashed. But after that, you need to use the 'bt' command to show the backtrace.
Comment 12 Peter Hillier-Brook 2018-09-22 09:55:14 UTC
Created attachment 115163 [details]
Corrected gdb output

Sorry: it's self evident after coffee! Correct dump attached.
Comment 13 Christoph Feck 2018-09-27 01:51:12 UTC
Thanks for the update; changing status.

Not sure why it crashes while using QLockFile, it might be a multi-threading issue.
Comment 14 Albert Astals Cid 2018-10-10 20:36:53 UTC
If you start it from the terminal does it have the same problem?
Comment 15 Albert Astals Cid 2018-10-10 20:40:02 UTC
Actually i can reproduce the problem myself.
Comment 16 Albert Astals Cid 2018-10-10 21:09:26 UTC
https://phabricator.kde.org/D16118
Comment 17 Albert Astals Cid 2018-10-17 17:33:04 UTC
Git commit ff1e5bc8415167801c1b240fe7384d858e84aa5c by Albert Astals Cid.
Committed on 17/10/2018 at 17:32.
Pushed by aacid into branch 'Applications/18.08'.

Fix crash on startup

Summary:
There was various threads using the same kconfig[group] at the same time, so bad things happened.
Add a mutex

Test Plan:
Run
  rm -f ~/.config/palapeli* && palapeli
a few times, see it doesn't crash anymore

Reviewers: #kde_games

Subscribers: chehrlic, kde-games-devel

Differential Revision: https://phabricator.kde.org/D16118

M  +5    -1    src/file-io/collection.cpp
M  +3    -0    src/file-io/collection.h
M  +10   -4    src/file-io/components-collectionstorage.cpp
M  +2    -1    src/file-io/components.h

https://commits.kde.org/palapeli/ff1e5bc8415167801c1b240fe7384d858e84aa5c
Comment 18 Peter Hillier-Brook 2019-07-19 16:52:49 UTC
Not fixed in Buster (Palapeli 2.1), see below.

CONSTRUCTED TeleportPieceInteractor
CONSTRUCTED ToggleCloseUpInteractor
SCENE RECT QRectF(-30,-30 101.6x101.6) VIEW SIZE QSize(640, 480)
View::zoomTo: level 100 scalingFactor 0.32 QPoint(1156,511) QPointF(200.832,79.2136)
Initial size of Palapeli::View QSize(640, 480)
QObject::moveToThread: Current thread (0x55dce5d52540) is not the object's thread (0x55dce5d52540).
Cannot move to target thread (0x55dce5d52540)

KCrash: crashing... crashRecursionCounter = 2
KCrash: Application Name = palapeli path = /usr/games pid = 10954
KCrash: Arguments: /usr/games/palapeli 
KCrash: Attempting to start /usr/lib/x86_64-linux-gnu/libexec/drkonqi from kdeinit
sock_file=/run/user/1000/kdeinit5__0
QSocketNotifier: Invalid socket 6 and type 'Read', disabling...
Comment 19 Albert Astals Cid 2019-07-20 00:08:27 UTC
Debian is using old palapeli, according to https://repology.org/project/palapeli/badges it's 18.04

My fix went into 18.08

Don't use Debian or don't complain that bugs are not fixed.
Comment 20 Albert Astals Cid 2019-09-02 17:40:07 UTC
*** Bug 411407 has been marked as a duplicate of this bug. ***
Comment 21 Albert Astals Cid 2021-12-09 16:27:11 UTC
Git commit a3b9349131bd0d465adcef0da6dca908990dfc62 by Albert Astals Cid.
Committed on 17/10/2018 at 17:31.
Pushed by aacid into branch 'arcpatch-D16118'.

Fix crash on startup

Summary:
There was various threads using the same kconfig[group] at the same time, so bad things happened.
Add a mutex

Test Plan:
Run
  rm -f ~/.config/palapeli* && palapeli
a few times, see it doesn't crash anymore

Reviewers: #kde_games

Subscribers: chehrlic, kde-games-devel

Differential Revision: https://phabricator.kde.org/D16118

M  +5    -1    src/file-io/collection.cpp
M  +3    -0    src/file-io/collection.h
M  +10   -4    src/file-io/components-collectionstorage.cpp
M  +2    -1    src/file-io/components.h

https://invent.kde.org/games/palapeli/commit/a3b9349131bd0d465adcef0da6dca908990dfc62