Bug 64952

Summary: kword crashes switching from "Page mode" to "Text mode"
Product: kword Reporter: Patrizio Bruno <scain>
Component: generalAssignee: Thomas Zander <zander>
Status: RESOLVED FIXED    
Severity: crash CC: pauls, shetzl
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:

Description Patrizio Bruno 2003-09-26 02:09:22 UTC
Version:           1.2.92 (using KDE 3.1.3)
Installed from:     (testing/unstable)
Compiler:          gcc version 3.3.1 20030722 (Debian prerelease)
OS:          Linux (i686) release 2.6.0-test3

Kword crashes when switching from "Page mode" to "Text mode".
To reproduce the crash:

- open kword
- when the wizard appears choose to start with an empty document
- using the menu "View" switch from "Page mode" to "Text mode"
Comment 1 Patrizio Bruno 2003-09-26 02:09:54 UTC
I forgot the backtrace. 
 
(no debugging symbols found)...(no debugging symbols found)... 
(no debugging symbols found)...(no debugging symbols found)... 
(no debugging symbols found)...(no debugging symbols found)... 
(no debugging symbols found)...(no debugging symbols found)... 
(no debugging symbols found)...(no debugging symbols found)... 
(no debugging symbols found)...(no debugging symbols found)... 
(no debugging symbols found)...(no debugging symbols found)... 
(no debugging symbols found)...(no debugging symbols found)... 
(no debugging symbols found)...[New Thread 16384 (LWP 1566)] 
(no debugging symbols found)... 
(no debugging symbols found)...(no debugging symbols found)... 
(no debugging symbols found)...(no debugging symbols found)... 
(no debugging symbols found)...(no debugging symbols found)... 
(no debugging symbols found)...(no debugging symbols found)... 
(no debugging symbols found)...(no debugging symbols found)... 
(no debugging symbols found)...(no debugging symbols found)... 
(no debugging symbols found)...(no debugging symbols found)... 
(no debugging symbols found)...(no debugging symbols found)... 
(no debugging symbols found)...(no debugging symbols found)... 
(no debugging symbols found)...(no debugging symbols found)... 
(no debugging symbols found)...(no debugging symbols found)... 
(no debugging symbols found)...(no debugging symbols found)... 
(no debugging symbols found)...(no debugging symbols found)... 
(no debugging symbols found)...(no debugging symbols found)... 
(no debugging symbols found)...(no debugging symbols found)... 
(no debugging symbols found)...(no debugging symbols found)... 
(no debugging symbols found)...(no debugging symbols found)... 
(no debugging symbols found)...(no debugging symbols found)... 
(no debugging symbols found)...(no debugging symbols found)... 
(no debugging symbols found)...(no debugging symbols found)... 
(no debugging symbols found)...(no debugging symbols found)... 
(no debugging symbols found)...(no debugging symbols found)... 
(no debugging symbols found)...(no debugging symbols found)... 
(no debugging symbols found)...(no debugging symbols found)... 
(no debugging symbols found)...(no debugging symbols found)... 
(no debugging symbols found)...(no debugging symbols found)... 
(no debugging symbols found)...(no debugging symbols found)... 
(no debugging symbols found)...(no debugging symbols found)... 
0x40d8ba66 in waitpid () from /lib/libpthread.so.0 
#0  0x40d8ba66 in waitpid () from /lib/libpthread.so.0 
#1  0x405d5ed0 in KCrash::defaultCrashHandler(int) () 
   from /usr/lib/libkdecore.so.4 
#2  0x40d8a695 in __pthread_sighandler () from /lib/libpthread.so.0 
#3  <signal handler called> 
#4  0x409497fa in QPainter::setWorldMatrix(QWMatrix const&, bool) () 
   from /usr/lib/libqt-mt.so.3 
#5  0x40949a3f in QPainter::translate(double, double) () 
   from /usr/lib/libqt-mt.so.3 
#6  0x41933d6a in KoTextDocument::drawParagWYSIWYG(QPainter*, KoTextParag*, 
int, int, int, int, QPixmap*&, QColorGroup const&, KoZoomHandler*, bool, 
KoTextCursor*, bool, unsigned) () from /usr/lib/libkotext.so.2 
#7  0x41718e85 in KWTextFrameSet::drawCursor(QPainter*, KoTextCursor*, bool, 
KWCanvas*, KWFrame*) () from /usr/lib/kde3/libkwordpart.so 
#8  0x4172548c in KWTextFrameSetEdit::drawCursor(bool) () 
   from /usr/lib/kde3/libkwordpart.so 
#9  0x419538fb in KoTextView::blinkCursor() () from /usr/lib/libkotext.so.2 
#10 0x41957d88 in KoTextView::qt_invoke(int, QUObject*) () 
   from /usr/lib/libkotext.so.2 
#11 0x41729723 in KWTextFrameSetEdit::qt_invoke(int, QUObject*) () 
   from /usr/lib/kde3/libkwordpart.so 
#12 0x4094629a in QObject::activate_signal(QConnectionList*, QUObject*) () 
   from /usr/lib/libqt-mt.so.3 
#13 0x409460dc in QObject::activate_signal(int) () from /usr/lib/libqt-mt.so.3 
#14 0x40c0fa75 in QTimer::timeout() () from /usr/lib/libqt-mt.so.3 
#15 0x40964669 in QTimer::event(QEvent*) () from /usr/lib/libqt-mt.so.3 
#16 0x408f026c in QApplication::internalNotify(QObject*, QEvent*) () 
   from /usr/lib/libqt-mt.so.3 
#17 0x408ef89a in QApplication::notify(QObject*, QEvent*) () 
   from /usr/lib/libqt-mt.so.3 
#18 0x40571ad7 in KApplication::notify(QObject*, QEvent*) () 
   from /usr/lib/libkdecore.so.4 
#19 0x408e06f6 in QEventLoop::activateTimers() () from /usr/lib/libqt-mt.so.3 
#20 0x408a1486 in QEventLoop::processEvents(unsigned) () 
   from /usr/lib/libqt-mt.so.3 
#21 0x409018af in QEventLoop::enterLoop() () from /usr/lib/libqt-mt.so.3 
#22 0x40901764 in QEventLoop::exec() () from /usr/lib/libqt-mt.so.3 
#23 0x408f0490 in QApplication::exec() () from /usr/lib/libqt-mt.so.3 
#24 0x400174e6 in main () from /usr/lib/kword.so.0 
#25 0x0804c5cb in ?? () 
#26 0x00000001 in ?? () 
#27 0x0805b1d0 in ?? () 
#28 0xbffff928 in ?? () 
#29 0x0804c5de in ?? () 
 
Comment 2 David Faure 2003-09-26 09:15:36 UTC
Subject: Re:  New: kword crashes switching from "Page mode" to "Text mode"

> Version:           1.2.92 (using KDE 3.1.3)
That's KOffice-1.3-beta3, right?

> Kword crashes when switching from "Page mode" to "Text mode".
I think I fixed that one already. Can you update to beta4?

Comment 3 Stefan Hetzl 2003-11-07 22:53:57 UTC
I can reproduce this with current CVS HEAD. Here is my backtrace:

[New Thread 16384 (LWP 26041)]
0x414f2387 in waitpid () from /lib/libpthread.so.0
#0  0x414f2387 in waitpid () from /lib/libpthread.so.0
#1  0x40a438b2 in KCrash::defaultCrashHandler(int) ()
   from /opt/kde-cvs/lib/libkdecore.so.4
#2  0x414f11ec in __pthread_sighandler () from /lib/libpthread.so.0
#3  <signal handler called>
#4  0x41429202 in XSetForeground () from /usr/X11R6/lib/libX11.so.6
#5  0x40ddebe8 in obtain_gc (ref=0x81989c0, gc=0x81989e0, pix=65535, dpy=0x0, 
    scrn=0, hd=0, painter_clip_serial=0) at kernel/qpainter_x11.cpp:481
#6  0x40ddf90a in QPainter::updateBrush() (this=0x81988c0)
    at kernel/qpainter_x11.cpp:874
#7  0x40e8d9d2 in QPainter::setBrush(QBrush const&) (this=0x81988c0, 
    brush=@0xbfffe820) at kernel/qpainter.cpp:1020
#8  0x40e90227 in QPainter::fillRect(int, int, int, int, QBrush const&) (
    this=0x81988c0, x=0, y=0, w=0, h=16, brush=@0xbfffe820)
    at kernel/qpainter.cpp:2127
#9  0x41e0cb34 in KoTextDocument::drawParagWYSIWYG(QPainter*, KoTextParag*, int, int, int, int, QPixmap*&, QColorGroup const&, KoZoomHandler*, bool, KoTextCursor*, bool, unsigned) () from /opt/kde-cvs/lib/libkotext.so.2
#10 0x41bdcd0b in KWTextFrameSet::drawCursor(QPainter*, KoTextCursor*, bool, KWCanvas*, KWFrame*) () from /opt/kde-cvs/lib/kde3/libkwordpart.so
#11 0x41bf335c in KWTextFrameSetEdit::drawCursor(bool) ()
   from /opt/kde-cvs/lib/kde3/libkwordpart.so
#12 0x41e32dbb in KoTextView::blinkCursor() ()
   from /opt/kde-cvs/lib/libkotext.so.2
#13 0x41e392ef in KoTextView::qt_invoke(int, QUObject*) ()
   from /opt/kde-cvs/lib/libkotext.so.2
#14 0x41bf7c7c in KWTextFrameSetEdit::qt_invoke(int, QUObject*) ()
   from /opt/kde-cvs/lib/kde3/libkwordpart.so
#15 0x40e8937f in QObject::activate_signal(QConnectionList*, QUObject*) (
    this=0x82e0be0, clist=0x817df70, o=0xbfffed20) at kernel/qobject.cpp:2333
#16 0x40e8921e in QObject::activate_signal(int) (this=0x82e0be0, signal=2)
    at kernel/qobject.cpp:2302
#17 0x411c7f7a in QTimer::timeout() (this=0x82e0be0)
    at .moc/debug-shared-mt/moc_qtimer.cpp:82
#18 0x40eadb5b in QTimer::event(QEvent*) (this=0x82e0be0, e=0xbfffef90)
    at kernel/qtimer.cpp:219
#19 0x40e2655d in QApplication::internalNotify(QObject*, QEvent*) (
    this=0xbffff1b0, receiver=0x82e0be0, e=0xbfffef90)
    at kernel/qapplication.cpp:2582
#20 0x40e25a1a in QApplication::notify(QObject*, QEvent*) (this=0xbffff1b0, 
    receiver=0x82e0be0, e=0xbfffef90) at kernel/qapplication.cpp:2305
#21 0x4099a323 in KApplication::notify(QObject*, QEvent*) ()
   from /opt/kde-cvs/lib/libkdecore.so.4
#22 0x40dbd427 in QApplication::sendEvent(QObject*, QEvent*) (
    receiver=0x82e0be0, event=0xbfffef90) at kernel/qapplication.h:490
#23 0x40e14490 in QEventLoop::activateTimers() (this=0x80b4ac8)
    at kernel/qeventloop_unix.cpp:557
#24 0x40dcef42 in QEventLoop::processEvents(unsigned) (this=0x80b4ac8, flags=4)
    at kernel/qeventloop_x11.cpp:346
#25 0x40e3bf26 in QEventLoop::enterLoop() (this=0x80b4ac8)
    at kernel/qeventloop.cpp:198
#26 0x40e3be42 in QEventLoop::exec() (this=0x80b4ac8)
    at kernel/qeventloop.cpp:145
#27 0x40e266dd in QApplication::exec() (this=0xbffff1b0)
    at kernel/qapplication.cpp:2705
#28 0x4001710f in main () from /opt/kde-cvs/lib/kword.so
#29 0x41636857 in __libc_start_main () from /lib/libc.so.6

The debugging output of kword:
kio (KSycoca): Trying to open ksycoca from /var/tmp/kdecache-stefan/ksycoca
kio (KTrader): KServiceTypeProfile::offers( KOfficePart, )
kio (KTrader): Returning 12 offers
koffice (lib kospell): KOSpellConfig::interpret []
kio (KDirLister): +KDirLister
kio (KDirListerCache): +KDirListerCache
kio (KDirWatch): Can't use FAM (fam daemon not running?)
kio (KDirWatch): Available methods: Stat
kio (KTrader): KServiceTypeProfile::offers( ThumbCreator, )
kio (KTrader): Returning 12 offers
kio (KTrader): KServiceTypeProfile::offers( ThumbCreator, )
kio (KTrader): Returning 12 offers
kio (KTrader): KServiceTypeProfile::offers( KOfficePart, )
kio (KTrader): Returning 12 offers
koffice (filter manager): KoFilterEntry::query(  )
kio (KTrader): KServiceTypeProfile::offers( KOfficeFilter, )
kio (KTrader): Returning 62 offers
koffice (filter manager): Checking whether KOffice XSLT Export Filter is available.
koffice (filter manager): Not cached, checking...
koffice (filter manager): Filter: KOffice XSLT Export Filter not available.
kio (KTrader): KServiceTypeProfile::offers( ThumbCreator, )
kio (KTrader): Returning 12 offers
kio (KTrader): KServiceTypeProfile::offers( ThumbCreator, )
kio (KTrader): Returning 12 offers
kio (KTrader): KServiceTypeProfile::offers( ThumbCreator, )
kio (KTrader): Returning 12 offers
kio (KTrader): KServiceTypeProfile::offers( ThumbCreator, )
kio (KTrader): Returning 12 offers
kio (KIOJob): stat file:/home/stefan/uni/graphstego/submission/graphstego.pdf
kio (KDirLister): -KDirLister
kio (KDirLister): [virtual void KDirLister::stop()]
kio (KDirListerCache): [void KDirListerCache::stop(KDirLister*)] lister: 0x81b1dc0
kio (KDirListerCache): [void KDirListerCache::forgetDirs(KDirLister*)] 0x81b1dc0
koffice (lib kofficecore): KoDocument::loadNativeFormat( /opt/kde-cvs/share/apps/kword/templates/Publishing/.source/Empty.kwt )
kword: Loading took 0.101 seconds
kword: [void KWDocument::processPictureRequests()] 0 picture requests.
kword (formatting): KWDocument::recalcFrames from=0 to=-1
kword: fixing page 0 z-orders
kparts: found Plugin : /opt/kde-cvs/share/apps/kword/kpartplugins/scan-kword.rc !
kparts: loadPlugins found desktopfile for kword:
kparts: load plugin
kword: 1 true
kio (KTrader): KServiceTypeProfile::offers( KOfficePart, )
kio (KTrader): Returning 12 offers
kparts: 0x81528e8 emitting activePartChanged 0x810c508
kdecore (KAction): WARNING: KAction::plug(): has no KAccel object; this = 0x8116718 name = koffice_undo parentCollection = 0x8116340
kdecore (KAction): WARNING: KAction::plug(): has no KAccel object; this = 0x811b850 name = koffice_redo parentCollection = 0x8116340
kword: [KFormula::Document* KWDocument::getFormulaDocument()]
kword: KWTextFrameSetEdit::KWTextFrameSetEdit First Page Header
kword: KWTextFrameSet::slotAvailableHeightNeeded First Page Header
ASSERT: "m_availableHeight != -1" in kotextobject.cc (116)
QPainter::begin: Cannot paint null pixmap
QPainter::setPen: Will be reset by begin()
QPainter::setBrush: Will be reset by begin()

Greetings,
Stefan

Comment 4 Paul Sprakes 2003-11-13 01:01:19 UTC
I get the same. For me it only happens if you choose a "Page layout" document at startup. The go View->Text mode from the menu.

Here's my backtrace:

[New Thread 16384 (LWP 7831)]
0x411fc677 in waitpid () from /lib/i686/libpthread.so.0
#0  0x411fc677 in waitpid () from /lib/i686/libpthread.so.0
#1  0x4079434d in KCrash::defaultCrashHandler(int) ()
   from /opt/kde-cvs/lib/libkdecore.so.4
#2  0x411fb5ce in __pthread_sighandler () from /lib/i686/libpthread.so.0
#3  0x413683b8 in __libc_sigaction () from /lib/i686/libc.so.6
#4  0x40b5fe4f in QPainter::translate(double, double) ()
   from /opt/qt3.2/lib/libqt-mt.so.3
#5  0x41d28ad0 in KoTextDocument::drawParagWYSIWYG(QPainter*, KoTextParag*, int, int, int, int, QPixmap*&, QColorGroup const&, KoZoomHandler*, bool, KoTextCursor*, bool, unsigned) (this=0x82c53f8, p=0xbfffece0, parag=0x8229de8, cx=0, 
    cy=0, cw=-512, ch=-512, doubleBuffer=@0xbfffeba0, cg=@0xbfffebf0, 
    zoomHandler=0x819c714, drawCursor=true, cursor=0x841c248, 
    resetChanged=false, drawingFlags=4294966784) at kotextdocument.cc:406
#6  0x41b07d00 in KWTextFrameSet::drawCursor(QPainter*, KoTextCursor*, bool, KWCanvas*, KWFrame*) (this=0x81ddfd8, p=0xbfffece0, cursor=0x841c248, 
    cursorVisible=true, canvas=0x82e2ab0, theFrame=0x82c1fe8)
    at kwtextframeset.cc:759
#7  0x41b13ae5 in KWTextFrameSetEdit::drawCursor(bool) (this=0x841c0d0)
    at kwtextframeset.cc:3432
#8  0x41d450fc in KoTextView::blinkCursor() (this=0x841c248)
    at kotextview.cc:831
#9  0x41d4879d in KoTextView::qt_invoke(int, QUObject*) (this=0x841c0d0, 
    _id=138527304, _o=0x841c0d0) at kotextview.moc:178
#10 0x41b16de9 in KWTextFrameSetEdit::qt_invoke(int, QUObject*) (
    this=0x841c0d0, _id=138527304, _o=0x841c0d0) at kwtextframeset.moc:275
#11 0x40b5c507 in QObject::activate_signal(QConnectionList*, QUObject*) ()
   from /opt/qt3.2/lib/libqt-mt.so.3
#12 0x40b5c34c in QObject::activate_signal(int) ()
   from /opt/qt3.2/lib/libqt-mt.so.3
#13 0x40e40d35 in QTimer::timeout() () from /opt/qt3.2/lib/libqt-mt.so.3
#14 0x40b7ab79 in QTimer::event(QEvent*) () from /opt/qt3.2/lib/libqt-mt.so.3
#15 0x40b05af4 in QApplication::internalNotify(QObject*, QEvent*) ()
   from /opt/qt3.2/lib/libqt-mt.so.3
#16 0x40b051d9 in QApplication::notify(QObject*, QEvent*) ()
   from /opt/qt3.2/lib/libqt-mt.so.3
#17 0x406ee3ee in KApplication::notify(QObject*, QEvent*) ()
   from /opt/kde-cvs/lib/libkdecore.so.4
#18 0x40af5dae in QEventLoop::activateTimers() ()
   from /opt/qt3.2/lib/libqt-mt.so.3
#19 0x40ab6937 in QEventLoop::processEvents(unsigned) ()
   from /opt/qt3.2/lib/libqt-mt.so.3
#20 0x40b177bf in QEventLoop::enterLoop() () from /opt/qt3.2/lib/libqt-mt.so.3
#21 0x40b17674 in QEventLoop::exec() () from /opt/qt3.2/lib/libqt-mt.so.3
#22 0x40b05d30 in QApplication::exec() () from /opt/qt3.2/lib/libqt-mt.so.3
#23 0x4089731e in main (argc=-512, argv=0xfffffe00) at main.cc:43
#24 0x0804cfba in launch(int, char const*, char const*, char const*, int, char const*, bool, char const*, bool, char const*) ()
#25 0x0804deac in handle_launcher_request(int) ()
#26 0x0804e3cc in handle_requests(int) ()
#27 0x0804f31b in main ()
#28 0x413557f7 in __libc_start_main () from /lib/i686/libc.so.6
Comment 5 Paul Sprakes 2003-11-13 11:04:08 UTC
Just adding that i'm using up to date cvs
Comment 6 David Faure 2004-02-09 15:55:53 UTC
Fixed crash when switching to Text mode and there's no text frameset to use for it.
TODO: disable action in such a case.
CCMAIL: 64952-done@bugs.kde.org


  M +1 -0      CHANGES   1.429.2.6
  M +9 -5      kwview.cc   1.991.2.3
  M +27 -19    kwviewmode.cc   1.39.2.1
  M +3 -2      kwviewmode.h   1.25.2.1