https://bugs.kde.org/show_bug.cgi?id=465518

            Bug ID: 465518
           Summary: Crash when loading invalid PGN file
    Classification: Applications
           Product: knights
           Version: unspecified
          Platform: Other
                OS: Linux
            Status: REPORTED
          Severity: crash
          Priority: NOR
         Component: general
          Assignee: alexander.se...@web.de
          Reporter: cspie...@gmail.com
                CC: kde-games-b...@kde.org
  Target Milestone: ---

Created attachment 156112
  --> https://bugs.kde.org/attachment.cgi?id=156112&action=edit
The invalid PGN file

Note: This is version 22.12.2, but that's not available in the versions list.

SUMMARY
When loading an invalid PGN file, Knights segfaults.

STEPS TO REPRODUCE
1. Start Knights
2. Open an invalid PGN file

OBSERVED RESULT
Crash

EXPECTED RESULT
No crash

SOFTWARE/OS VERSIONS
KDE Plasma Version: 5.26.5
KDE Frameworks Version: 5.102.0
Qt Version: 5.15 (From KDE Git)

ADDITIONAL INFORMATION
I've attached the invalid PGN file.  Since there is, apparently, only one
attachment allowed, I'll dump the gdb stack trace here:

Thread 1 "knights" received signal SIGSEGV, Segmentation fault.
0x0000000000429f40 in Knights::Piece::pieceType (this=0x0) at
/usr/ports/ports/knights-kde/knights-22.12.2/src/core/piece.cpp:140
140             return m_type;
#0  0x0000000000429f40 in Knights::Piece::pieceType (this=0x0) at
/usr/ports/ports/knights-kde/knights-22.12.2/src/core/piece.cpp:140
#1  0x000000000044bbcb in Knights::ChessRules::castlingMoves (this=0x1018160,
pos=...) at
/usr/ports/ports/knights-kde/knights-22.12.2/src/rules/chessrules.cpp:463
#2  0x00000000004480de in Knights::ChessRules::legalMoves (this=0x1018160,
pos=...) at
/usr/ports/ports/knights-kde/knights-22.12.2/src/rules/chessrules.cpp:122
#3  0x000000000044cca9 in Knights::ChessRules::changeNotation (this=0x1018160,
move=0x7fffffffd240, notation=Knights::Move::Coordinate, color=Knights::White)
    at
/usr/ports/ports/knights-kde/knights-22.12.2/src/rules/chessrules.cpp:578
#4  0x0000000000449b05 in Knights::ChessRules::checkSpecialFlags
(this=0x1018160, move=0x7fffffffd240, color=Knights::White) at
/usr/ports/ports/knights-kde/knights-22.12.2/src/rules/chessrules.cpp:285
#5  0x00000000004653a1 in Knights::Manager::processMove (this=0x4d0620
<(anonymous namespace)::Q_QGS_instance::innerFunction()::holder>, move=...)
    at /usr/ports/ports/knights-kde/knights-22.12.2/src/gamemanager.cpp:736
#6  0x0000000000465f5e in Knights::Manager::loadGameHistoryFrom (this=0x4d0620
<(anonymous namespace)::Q_QGS_instance::innerFunction()::holder>, filename=...)
    at /usr/ports/ports/knights-kde/knights-22.12.2/src/gamemanager.cpp:850
#7  0x000000000047966a in Knights::MainWindow::protocolInitSuccesful
(this=0xaf8dd0) at
/usr/ports/ports/knights-kde/knights-22.12.2/src/knights.cpp:441
#8  0x000000000048045d in QtPrivate::FunctorCall<QtPrivate::IndexesList<>,
QtPrivate::List<>, void, void (Knights::MainWindow::*)()>::call(void
(Knights::MainWindow::*)(), Knights::MainWindow*, void**) (
    f=(void (Knights::MainWindow::*)(Knights::MainWindow * const)) 0x47834a
<Knights::MainWindow::protocolInitSuccesful()>, o=0xaf8dd0, arg=0x7fffffffd4d0)
at /usr/include/qt/QtCore/qobjectdefs_impl.h:152
#9  0x000000000048001d in QtPrivate::FunctionPointer<void
(Knights::MainWindow::*)()>::call<QtPrivate::List<>, void>(void
(Knights::MainWindow::*)(), Knights::MainWindow*, void**) (
    f=(void (Knights::MainWindow::*)(Knights::MainWindow * const)) 0x47834a
<Knights::MainWindow::protocolInitSuccesful()>, o=0xaf8dd0, arg=0x7fffffffd4d0)
at /usr/include/qt/QtCore/qobjectdefs_impl.h:185
#10 0x000000000047f5da in QtPrivate::QSlotObject<void
(Knights::MainWindow::*)(), QtPrivate::List<>, void>::impl(int,
QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) (which=1,
this_=0x10d8220, 
    r=0xaf8dd0, a=0x7fffffffd4d0, ret=0x0) at
/usr/include/qt/QtCore/qobjectdefs_impl.h:418
#11 0x00007ffff58bf742 in ?? () from /usr/lib/libQt5Core.so.5
#12 0x000000000041fa0d in Knights::Manager::initComplete (this=0x4d0620
<(anonymous namespace)::Q_QGS_instance::innerFunction()::holder>)
    at
/usr/ports/ports/knights-kde/knights-22.12.2/x/src/knights_autogen/EWIEGA46WW/moc_gamemanager.cpp:378
#13 0x0000000000463e4b in Knights::Manager::protocolInitSuccesful
(this=0x4d0620 <(anonymous
namespace)::Q_QGS_instance::innerFunction()::holder>)
    at /usr/ports/ports/knights-kde/knights-22.12.2/src/gamemanager.cpp:421
#14 0x00000000004691b8 in QtPrivate::FunctorCall<QtPrivate::IndexesList<>,
QtPrivate::List<>, void, void (Knights::Manager::*)()>::call(void
(Knights::Manager::*)(), Knights::Manager*, void**) (
    f=(void (Knights::Manager::*)(Knights::Manager * const)) 0x463cc0
<Knights::Manager::protocolInitSuccesful()>, o=0x4d0620 <(anonymous
namespace)::Q_QGS_instance::innerFunction()::holder>, 
    arg=0x1a0d778) at /usr/include/qt/QtCore/qobjectdefs_impl.h:152
#15 0x0000000000468de9 in QtPrivate::FunctionPointer<void
(Knights::Manager::*)()>::call<QtPrivate::List<>, void>(void
(Knights::Manager::*)(), Knights::Manager*, void**) (
    f=(void (Knights::Manager::*)(Knights::Manager * const)) 0x463cc0
<Knights::Manager::protocolInitSuccesful()>, o=0x4d0620 <(anonymous
namespace)::Q_QGS_instance::innerFunction()::holder>, 
    arg=0x1a0d778) at /usr/include/qt/QtCore/qobjectdefs_impl.h:185
#16 0x00000000004687b4 in QtPrivate::QSlotObject<void (Knights::Manager::*)(),
QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*,
void**, bool*) (which=1, this_=0x19ae4f0, 
    r=0x4d0620 <(anonymous
namespace)::Q_QGS_instance::innerFunction()::holder>, a=0x1a0d778, ret=0x0) at
/usr/include/qt/QtCore/qobjectdefs_impl.h:418
#17 0x00007ffff58b47c0 in QObject::event(QEvent*) () from
/usr/lib/libQt5Core.so.5
#18 0x00007ffff64053ce in QApplicationPrivate::notify_helper(QObject*, QEvent*)
() from /usr/lib/libQt5Widgets.so.5
#19 0x00007ffff588a4f8 in QCoreApplication::notifyInternal2(QObject*, QEvent*)
() from /usr/lib/libQt5Core.so.5
#20 0x00007ffff588d1d1 in QCoreApplicationPrivate::sendPostedEvents(QObject*,
int, QThreadData*) () from /usr/lib/libQt5Core.so.5
#21 0x00007ffff58df393 in ?? () from /usr/lib/libQt5Core.so.5
#22 0x00007ffff18bccf9 in g_main_context_dispatch () from
/usr/lib/libglib-2.0.so.0
#23 0x00007ffff18bcf68 in g_main_context_iterate.constprop () from
/usr/lib/libglib-2.0.so.0
#24 0x00007ffff18bcfec in g_main_context_iteration () from
/usr/lib/libglib-2.0.so.0
#25 0x00007ffff58deab6 in
QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
from /usr/lib/libQt5Core.so.5
#26 0x00007ffff58890db in
QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from
/usr/lib/libQt5Core.so.5
#27 0x00007ffff5890be2 in QCoreApplication::exec() () from
/usr/lib/libQt5Core.so.5
#28 0x0000000000481245 in main (argc=1, argv=0x7fffffffdbb8) at
/usr/ports/ports/knights-kde/knights-22.12.2/src/main.cpp:94

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to