Bug 283191 - Solver frequently crashes while playing Gypsy
Summary: Solver frequently crashes while playing Gypsy
Status: RESOLVED FIXED
Alias: None
Product: kpat
Classification: Applications
Component: solver (show other bugs)
Version: unspecified
Platform: Chakra Linux
: HI crash
Target Milestone: ---
Assignee: Stephan Kulow
URL:
Keywords:
: 285403 286137 286319 287799 288551 288945 289581 290452 291311 303182 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-10-02 18:45 UTC by Sergei Andreev
Modified: 2012-07-08 21:34 UTC (History)
14 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Saved game of Stuart's problematic deal (4.69 KB, application/octet-stream)
2011-11-08 03:13 UTC, Parker Coates
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sergei Andreev 2011-10-02 18:45:56 UTC
Application: kpat (3.6)
KDE Platform Version: 4.7.1 (4.7.1)
Qt Version: 4.7.4
Operating System: Linux 3.0-CHAKRA i686
Distribution: "Chakra Linux"

-- Information about the crash:
- What I was doing when the application crashed:

Just playing Gypsy Solitaire. I can not remember crashes with other games in kpat.

The crash can be reproduced some of the time.

-- Backtrace:
Application: Пасьянс KDE (kpat), signal: Segmentation fault
[Current thread is 1 (Thread 0xb4ccd710 (LWP 8296))]

Thread 2 (Thread 0xb2eaab70 (LWP 10768)):
[KCrash Handler]
#7  MemoryManager::new_from_block (this=0x9, s=48) at /chakra/desktop-testing/kdegames/src/kdegames-4.7.1/kpat/patsolve/memory.cpp:164
#8  0x0807bdc3 in Solver::pack_position (this=0x91ce648) at /chakra/desktop-testing/kdegames/src/kdegames-4.7.1/kpat/patsolve/patsolve.cpp:369
#9  0x0807c5c4 in Solver::insert (this=0x91ce648, cluster=0xb2eaa22c, d=122, node=0xb2eaa228) at /chakra/desktop-testing/kdegames/src/kdegames-4.7.1/kpat/patsolve/patsolve.cpp:1046
#10 0x0807c685 in Solver::new_position (this=0x91ce648, parent=0xb1247e00, m=0xb11e1138) at /chakra/desktop-testing/kdegames/src/kdegames-4.7.1/kpat/patsolve/patsolve.cpp:1077
#11 0x0807cc35 in Solver::solve (this=0x91ce648, parent=0xb1247e00) at /chakra/desktop-testing/kdegames/src/kdegames-4.7.1/kpat/patsolve/patsolve.cpp:739
#12 0x0807ce6c in Solver::doit (this=0x91ce648) at /chakra/desktop-testing/kdegames/src/kdegames-4.7.1/kpat/patsolve/patsolve.cpp:664
#13 0x0807d42c in Solver::patsolve (this=0x91ce648, _max_positions=-1, _debug=false) at /chakra/desktop-testing/kdegames/src/kdegames-4.7.1/kpat/patsolve/patsolve.cpp:958
#14 0x08068605 in SolverThread::run (this=0x9145d68) at /chakra/desktop-testing/kdegames/src/kdegames-4.7.1/kpat/dealer.cpp:114
#15 0xb6175d52 in ?? () from /usr/lib/libQtCore.so.4
#16 0xb58e3e10 in start_thread () from /lib/libpthread.so.0
#17 0xb5f8297e in clone () from /lib/libc.so.6

Thread 1 (Thread 0xb4ccd710 (LWP 8296)):
#0  0xb78c1424 in __kernel_vsyscall ()
#1  0xb5f786a6 in poll () from /lib/libc.so.6
#2  0xb51eb380 in ?? () from /usr/lib/libxcb.so.1
#3  0xb51eccc7 in xcb_wait_for_reply () from /usr/lib/libxcb.so.1
#4  0xb5b06ad8 in _XReply () from /usr/lib/libX11.so.6
#5  0xb5b03e52 in XTranslateCoordinates () from /usr/lib/libX11.so.6
#6  0xb67fd106 in QWidgetPrivate::mapFromGlobal(QPoint const&) const () from /usr/lib/libQtGui.so.4
#7  0xb67fd15f in QWidgetPrivate::mapFromGlobal(QPoint const&) const () from /usr/lib/libQtGui.so.4
#8  0xb67fd15f in QWidgetPrivate::mapFromGlobal(QPoint const&) const () from /usr/lib/libQtGui.so.4
#9  0xb67fd1f3 in QWidget::mapFromGlobal(QPoint const&) const () from /usr/lib/libQtGui.so.4
#10 0xb67637c8 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#11 0xb72d9e0a in KApplication::notify(QObject*, QEvent*) () from /usr/lib/libkdeui.so.5
#12 0xb626b34b in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/libQtCore.so.4
#13 0xb675f0de in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) () from /usr/lib/libQtGui.so.4
#14 0xb67e81dc in ?? () from /usr/lib/libQtGui.so.4
#15 0xb67e724d in QApplication::x11ProcessEvent(_XEvent*) () from /usr/lib/libQtGui.so.4
#16 0xb6810aa2 in ?? () from /usr/lib/libQtGui.so.4
#17 0xb56e0752 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#18 0xb56e0f30 in ?? () from /usr/lib/libglib-2.0.so.0
#19 0xb56e11e4 in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#20 0xb6298a0f in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#21 0xb68106a5 in ?? () from /usr/lib/libQtGui.so.4
#22 0xb626a519 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#23 0xb626a7ba in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#24 0xb626f202 in QCoreApplication::exec() () from /usr/lib/libQtCore.so.4
#25 0xb675bf47 in QApplication::exec() () from /usr/lib/libQtGui.so.4
#26 0x0805d074 in main (argc=) at /chakra/desktop-testing/kdegames/src/kdegames-4.7.1/kpat/main.cpp:329

Reported using DrKonqi
Comment 1 Stuart Kirby 2011-10-22 13:49:59 UTC
I have also seen this bug while playing Gypsy, which results in KPAT closing down.  It seems to occur when I move to pick up a new card or am doing nothing having just moved a card - I have seen it about a dozen times.  I suggest that it is some change to the solver.

I note that there are no problems with Freecell, Forty & Eight, Spider or Simple Simon.  I have not played the other games.
Comment 2 Stuart Kirby 2011-11-05 16:00:01 UTC
You can reproduce this by doing the following:

Choose "new numbered deal", gypsy, 102194206
7 of spades to 8 of hearts, 8H to 9C, 5C to 6D, 6D to 7C ... boom

Alternatively:
7 of spades to 8 of hearts, 8H to 9C, 5C to 6D, 6D to 7S, 2S to space, 6H to 7C ... boom
Comment 3 Parker Coates 2011-11-05 21:11:12 UTC
*** Bug 285403 has been marked as a duplicate of this bug. ***
Comment 4 sromeroan 2011-11-06 01:02:09 UTC
Application: kpat (3.6)


Distribution: "Ubuntu 11.10"

I have the same problem. This is what I got in the terminal:

santiago@santiago-desktop:~$ kpat
kpat(3540)/KSharedDataCache: Unable to free up memory for "1920-941-background" 
kpat(3540)/KSharedDataCache: Unable to free up memory for "1920-995-background" 
KCrash: Application 'kpat' crashing...
KCrash: Attempting to start /usr/lib/kde4/libexec/drkonqi from kdeinit
sock_file=/home/santiago/.kde/socket-santiago-desktop/kdeinit4__0
Warning: connect() failed: : No existe el archivo o el directorio
KCrash: Attempting to start /usr/lib/kde4/libexec/drkonqi directly
QSocketNotifier: Invalid socket 14 and type 'Read', disabling...
kpat: Fatal IO error 9 (Descriptor de archivo erróneo) on X server :0.0.
Unable to start Dr. Konqi
santiago@santiago-desktop:~$ drkonqi(3568): The specified process does not exist. 
santiago@santiago-desktop:~$
Comment 5 Belomir 2011-11-07 15:36:44 UTC
Confirm this bug on Kubuntu 11.10:

:~$ kpat
kpat: Fatal IO error: client killed
KCrash: Application 'kpat' crashing...
KCrash: Attempting to start /usr/lib/kde4/libexec/drkonqi from kdeinit
sock_file=/home/belomir/.kde/socket-belomir-desktop/kdeinit4__1
Unable to start Dr. Konqi
:~$
Comment 6 sromeroan 2011-11-07 21:01:19 UTC
El 07/11/11 16:36, Belomir escribió:
> https://bugs.kde.org/show_bug.cgi?id=283191
>
>
> Belomir<leggis@mail.ru>  changed:
>
>             What    |Removed                     |Added
> ----------------------------------------------------------------------------
>                   CC|                            |leggis@mail.ru
>
>
>
>
> --- Comment #5 from Belomir<leggis mail ru>   2011-11-07 15:36:44 ---
> Confirm this bug on Kubuntu 11.10:
>
> :~$ kpat
> kpat: Fatal IO error: client killed
> KCrash: Application 'kpat' crashing...
> KCrash: Attempting to start /usr/lib/kde4/libexec/drkonqi from kdeinit
> sock_file=/home/belomir/.kde/socket-belomir-desktop/kdeinit4__1
> Unable to start Dr. Konqi
> :~$
>
Sorry, I can't . I'm not using Kubuntu 11.10
My system is Ubuntu 11.10 wtih gnome 3.2 and I've been using Kpat for a 
couple of years since Ubuntu 9.4
and it always worked fine.
Comment 7 Parker Coates 2011-11-08 03:13:31 UTC
Created attachment 65374 [details]
Saved game of Stuart's problematic deal

Just move the 6 of diamonds to the 7 of clubs and instant segfault.
Comment 8 Parker Coates 2011-11-09 01:27:49 UTC
*** Bug 286137 has been marked as a duplicate of this bug. ***
Comment 9 Paco Sánchez 2011-11-09 19:31:06 UTC
If I run the game from a game console terminal does not fail
Comment 10 Parker Coates 2011-11-11 14:36:46 UTC
*** Bug 286319 has been marked as a duplicate of this bug. ***
Comment 11 Parker Coates 2011-11-11 15:09:16 UTC
(In reply to comment #9)
> If I run the game from a game console terminal does not fail

Using Stuart's reproduction steps listed above, I can confirm that the crash happens regardless of whether the game is running in a terminal or not.
Comment 12 Parker Coates 2011-11-11 15:11:57 UTC
I should also mention that for those of you encountering this crash, until we have a real fix, it can be avoided by disabling the solver. (Menu -> Settings -> Enable Solver)
Comment 13 Stephan Kulow 2011-11-13 17:31:57 UTC
==9401== Thread 2:
==9401== Invalid read of size 8
==9401==    at 0x447DE6: MemoryManager::new_from_block(unsigned long) (memory.cpp:164)
==9401==    by 0x448DE4: Solver::pack_position() (patsolve.cpp:369)
==9401==    by 0x44A4D6: Solver::insert(unsigned int*, int, TREE**) (patsolve.cpp:1046)
==9401==    by 0x44A599: Solver::new_position(POSITION*, MOVE*) (patsolve.cpp:1077)
==9401==    by 0x44994A: Solver::solve(POSITION*) (patsolve.cpp:739)
==9401==    by 0x4496DB: Solver::doit() (patsolve.cpp:664)
==9401==    by 0x44A1A0: Solver::patsolve(int, bool) (patsolve.cpp:958)
==9401==    by 0x4277F7: SolverThread::run() (dealer.cpp:110)
==9401==    by 0x6EB8024: QThreadPrivate::start(void*) (qthread_unix.cpp:331)
==9401==    by 0x72D7F04: start_thread (pthread_create.c:301)
==9401==    by 0x8C304BC: clone (clone.S:115)
==9401==  Address 0x20700000010 is not stack'd, malloc'd or (recently) free'd
Comment 14 Stephan Kulow 2011-11-14 12:44:10 UTC
SVN commit 1264171 by coolo:

don't overfill the possible array
BUG: 283191


 M  +11 -5     gypsysolver.cpp  
 M  +2 -0      patsolve.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1264171
Comment 15 Parker Coates 2011-11-14 16:39:55 UTC
SVN commit 1264189 by coates:

Backport of commit 1264171.

don't overfill the possible array
CCBUG:283191
FIXED-IN:4.7.4


 M  +11 -5     gypsysolver.cpp  
 M  +2 -0      patsolve.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1264189
Comment 16 Parker Coates 2011-12-05 16:40:34 UTC
*** Bug 287799 has been marked as a duplicate of this bug. ***
Comment 17 Christoph Feck 2011-12-17 19:46:47 UTC
*** Bug 288945 has been marked as a duplicate of this bug. ***
Comment 18 Stephan Kulow 2011-12-22 12:17:46 UTC
*** Bug 289581 has been marked as a duplicate of this bug. ***
Comment 19 Stephan Kulow 2011-12-22 12:18:11 UTC
*** Bug 288551 has been marked as a duplicate of this bug. ***
Comment 20 Ken 2012-01-04 02:55:51 UTC
Playing Gypsy on open suse allways crashes
Comment 21 Christoph Feck 2012-01-11 23:29:25 UTC
*** Bug 291311 has been marked as a duplicate of this bug. ***
Comment 22 Parker Coates 2012-01-20 14:32:19 UTC
*** Bug 290452 has been marked as a duplicate of this bug. ***
Comment 23 Parker Coates 2012-07-08 21:34:47 UTC
*** Bug 303182 has been marked as a duplicate of this bug. ***