Bug 160260 - [PATCH] Crash when printing journal pages by using journal entry's print button
Summary: [PATCH] Crash when printing journal pages by using journal entry's print button
Status: RESOLVED FIXED
Alias: None
Product: korganizer
Classification: Applications
Component: printing (show other bugs)
Version: SVN trunk (KDE 4)
Platform: Gentoo Packages Linux
: NOR crash
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords: triaged
: 160850 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-04-02 13:56 UTC by Tais P. Hansen
Modified: 2008-11-24 22:36 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Adds calendar pointer to popup so it can passed to print (7.56 KB, patch)
2008-11-16 11:03 UTC, Ron Goodheart
Details
Adds calendar pointer to popup so it can passed to print (7.87 KB, patch)
2008-11-17 03:15 UTC, Ron Goodheart
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tais P. Hansen 2008-04-02 13:56:56 UTC
Version:           3.5.9 (using KDE 3.5.9)
Installed from:    Gentoo Packages
Compiler:          gcc (GCC) 4.2.3 (Gentoo 4.2.3 p1.0) 
OS:                Linux

Reproduce:
* Weekly journal view, three days with one entry.
* Click print in the first entry's toolbar - NOT the main toolbar (printing from main toolbar works).
* Select "Print week".
* Set start and end date to beginning and end of week. Time is set to 9:00 and 21:00. Print layout is left at Filofax. Use colors enabled. Page orientation is printer default.
* Click "Print...", select printer and click "Print".
* Crash.

Backtrace:
Using host libthread_db library "/lib/libthread_db.so.1".
[Thread debugging using libthread_db enabled]
[New Thread 0xb605cb00 (LWP 30118)]
[KCrash handler]
#6  KCal::Calendar::events (this=0x0, date=@0xbf9984f8, 
    sortField=KCal::EventSortStartDate, 
    sortDirection=KCal::SortDirectionAscending) at calendar.cpp:255
#7  0xb7bfa4da in CalPrintPluginBase::drawDayBox (this=0x8555968, 
    p=@0xbf99868c, qd=@0xbf9984f8, box=@0xbf9984e8, fullDate=true, 
    printRecurDaily=true, printRecurWeekly=true) at calprintpluginbase.cpp:917
#8  0xb7bfb55c in CalPrintPluginBase::drawWeek (this=0x8555968, 
    p=@0xbf99868c, qd=@0xbf998658, box=@0xbf9985cc)
    at calprintpluginbase.cpp:1008
#9  0xb7c0121d in CalPrintWeek::print (this=0x8555968, p=@0xbf99868c, 
    width=712, height=1082) at calprintdefaultplugins.cpp:747
#10 0xb7bf1eb7 in CalPrintPluginBase::doPrint (this=0x8555968, 
    printer=0xbf998834) at calprintpluginbase.cpp:167
#11 0xb7befe4c in CalPrinter::doPrint (this=0xbf9989dc, 
    selectedStyle=0x8555968, dlgorientation=CalPrinter::eOrientPrinter, 
    preview=false) at calprinter.cpp:156
#12 0xb7bf0b7b in CalPrinter::print (this=0xbf9989dc, type=100, 
    fd=@0xbf998a50, td=@0xbf998a4c, selectedIncidences=@0xbf998a34, 
    preview=false) at calprinter.cpp:121
#13 0xb7edc430 in JournalEntry::printItem (this=0x8366ab8)
    at journalentry.cpp:291
#14 0xb7edc621 in JournalEntry::qt_invoke (this=0x8366ab8, _id=48, 
    _o=0xbf998ae4) at journalentry.moc:149
#15 0xb69746b0 in QObject::activate_signal (this=0x83501c0, clist=0x82cac78, 
    o=0xbf998ae4) at kernel/qobject.cpp:2356
#16 0xb6975179 in QObject::activate_signal (this=0x83501c0, signal=4)
    at kernel/qobject.cpp:2325
#17 0xb6c87cfa in QButton::clicked (this=0x83501c0)
    at .moc/release-shared-mt/moc_qbutton.cpp:152
#18 0xb6a0003f in QButton::mouseReleaseEvent (this=0x83501c0, e=0xbf998ee4)
    at widgets/qbutton.cpp:836
#19 0xb69a8453 in QWidget::event (this=0x83501c0, e=0xbf998ee4)
    at kernel/qwidget.cpp:4677
#20 0xb691a494 in QApplication::internalNotify (this=0xbf999248, 
    receiver=0x83501c0, e=0xbf998ee4) at kernel/qapplication.cpp:2635
#21 0xb691b18a in QApplication::notify (this=0xbf999248, receiver=0x83501c0, 
    e=0xbf998ee4) at kernel/qapplication.cpp:2421
#22 0xb6f047b9 in KApplication::notify (this=0xbf999248, receiver=0x83501c0, 
    event=0xbf998ee4) at kapplication.cpp:550
#23 0xb68bf38f in QETWidget::translateMouseEvent (this=0x83501c0, 
    event=0xbf999178) at kernel/qapplication.h:499
#24 0xb68be9ff in QApplication::x11ProcessEvent (this=0xbf999248, 
    event=0xbf999178) at kernel/qapplication_x11.cpp:3449
#25 0xb68cdb9b in QEventLoop::processEvents (this=0x807eb50, 
    flags=<value optimized out>) at kernel/qeventloop_x11.cpp:192
#26 0xb692fb99 in QEventLoop::enterLoop (this=0x807eb50)
    at kernel/qeventloop.cpp:198
#27 0xb692fa52 in QEventLoop::exec (this=0x807eb50)
    at kernel/qeventloop.cpp:145
#28 0xb6919f7b in QApplication::exec (this=0xbf999248)
    at kernel/qapplication.cpp:2758
#29 0x080508e8 in main (argc=-1080457588, argv=0x2b) at main.cpp:58
#30 0xb6078400 in __libc_start_main (main=0x8050770 <main>, argc=1, 
    ubp_av=0xbf999414, init=0x8052850 <__libc_csu_init>, 
    fini=0x8052840 <__libc_csu_fini>, rtld_fini=0xb7fe0360 <_dl_fini>, 
    stack_end=0xbf99940c) at libc-start.c:227
#31 0x080506f1 in _start ()
Comment 1 Michael Leupold 2008-09-28 11:03:39 UTC
This bug is still reproducible on trunk r865573. Same backtrace.
Comment 2 George Goldberg 2008-09-28 20:30:47 UTC
In svn trunk r865619 I get the following backtrace:

Application: KOrganizer (korganizer), signal SIGSEGV
Using host libthread_db library "/lib64/libthread_db.so.1".
[New Thread 46954506507648 (LWP 18656)]
[New Thread 1090525520 (LWP 18715)]
[New Thread 1082132816 (LWP 18714)]
0x00002ab46ac49091 in nanosleep () from /lib64/libc.so.6
[Current thread is 0 (LWP 18656)]

Thread 3 (Thread 1082132816 (LWP 18714)):
#0  0x00002ab46775d719 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00002ab467327ea3 in QWaitConditionPrivate::wait (this=0x13366e0, time=18446744073709551615) at thread/qwaitcondition_unix.cpp:89
#2  0x00002ab467327a02 in QWaitCondition::wait (this=0x123f478, mutex=0x123f470, time=18446744073709551615) at thread/qwaitcondition_unix.cpp:161
#3  0x00002ab4687d1abc in QFileInfoGatherer::run (this=0x123f460) at dialogs/qfileinfogatherer.cpp:197
#4  0x00002ab46732752d in QThreadPrivate::start (arg=0x123f460) at thread/qthread_unix.cpp:191
#5  0x00002ab4677593e0 in start_thread () from /lib64/libpthread.so.0
#6  0x00002ab46ac8287d in clone () from /lib64/libc.so.6

Thread 2 (Thread 1090525520 (LWP 18715)):
#0  0xffffffffff600107 in ?? ()
#1  0x00007fff45bfe628 in KMainWindow::setCaption () at /home/george/kde/src/KDE/kdelibs/kdeui/widgets/kmainwindow.cpp:525
#2  0x00002ab46dac14a9 in clock_gettime () from /lib64/librt.so.1
#3  0x00002ab46744f88c in QTimerInfoList::getTime (this=0x13f7370, t=@0x13f73b0) at kernel/qeventdispatcher_unix.cpp:341
#4  0x00002ab46744fb57 in QTimerInfoList::updateCurrentTime (this=0x13f7370) at kernel/qeventdispatcher_unix.cpp:299
#5  0x00002ab4674502a7 in QTimerInfoList::timerWait (this=0x13f7370, tm=@0x41000d90) at kernel/qeventdispatcher_unix.cpp:422
#6  0x00002ab46744da27 in timerSourcePrepare (source=0x13f7310, timeout=0x41000df4) at kernel/qeventdispatcher_glib.cpp:142
#7  0x00002ab46dcfe717 in g_main_context_prepare () from /usr/lib64/libglib-2.0.so.0
#8  0x00002ab46dcfedd8 in KMainWindow::setCaption () at /home/george/kde/src/KDE/kdelibs/kdeui/widgets/kmainwindow.cpp:525
#9  0x00002ab46dcff5df in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#10 0x00002ab46744cb6a in QEventDispatcherGlib::processEvents (this=0x137f7e0, flags=@0x41000f40) at kernel/qeventdispatcher_glib.cpp:327
#11 0x00002ab46741a4d4 in QEventLoop::processEvents (this=0x41000ff0, flags=@0x41000fa0) at kernel/qeventloop.cpp:149
#12 0x00002ab46741a6d0 in QEventLoop::exec (this=0x41000ff0, flags=@0x41001000) at kernel/qeventloop.cpp:196
#13 0x00002ab4673236aa in QThread::exec (this=0x13c9190) at thread/qthread.cpp:472
#14 0x00002ab4674020bf in QInotifyFileSystemWatcherEngine::run (this=0x13c9190) at io/qfilesystemwatcher_inotify.cpp:216
#15 0x00002ab46732752d in QThreadPrivate::start (arg=0x13c9190) at thread/qthread_unix.cpp:191
#16 0x00002ab4677593e0 in start_thread () from /lib64/libpthread.so.0
#17 0x00002ab46ac8287d in clone () from /lib64/libc.so.6

Thread 1 (Thread 46954506507648 (LWP 18656)):
[KCrash Handler]
#5  0x00002ab4692f5455 in KCal::Calendar::events (this=0x0, date=@0x7fff45a909e0, timespec=@0x7fff45a907f0, sortField=KCal::EventSortStartDate, sortDirection=KCal::SortDirectionAscending)
    at /home/george/kde/src/KDE/kdepimlibs/kcal/calendar.cpp:386
#6  0x00002ab47014414f in CalPrintPluginBase::drawDayBox (this=0x133cc40, p=@0x7fff45a90c60, qd=@0x7fff45a909e0, box=@0x7fff45a909d0, fullDate=true, printRecurDaily=true, printRecurWeekly=true)
    at /home/george/kde/src/KDE/kdepim/korganizer/printing/calprintpluginbase.cpp:910
#7  0x00002ab470144989 in CalPrintPluginBase::drawWeek (this=0x133cc40, p=@0x7fff45a90c60, qd=@0x7fff45a90b00, box=@0x7fff45a90a90)
    at /home/george/kde/src/KDE/kdepim/korganizer/printing/calprintpluginbase.cpp:1004
#8  0x00002ab470150898 in CalPrintWeek::print (this=0x133cc40, p=@0x7fff45a90c60, width=767, height=1114) at /home/george/kde/src/KDE/kdepim/korganizer/printing/calprintdefaultplugins.cpp:918
#9  0x00002ab470148b81 in CalPrintPluginBase::doPrint (this=0x133cc40, printer=0x7fff45a90d40) at /home/george/kde/src/KDE/kdepim/korganizer/printing/calprintpluginbase.cpp:157
#10 0x00002ab47013e25f in CalPrinter::doPrint (this=0x7fff45a90f20, selectedStyle=0x133cc40, dlgorientation=CalPrinter::eOrientPrinter, preview=false)
    at /home/george/kde/src/KDE/kdepim/korganizer/printing/calprinter.cpp:163
#11 0x00002ab47013e52b in CalPrinter::print (this=0x7fff45a90f20, type=100, fd=@0xda2d00, td=@0xda2d00, selectedIncidences=@0x7fff45a90f80, preview=false)
    at /home/george/kde/src/KDE/kdepim/korganizer/printing/calprinter.cpp:123
#12 0x00002ab469735090 in KOEventPopupMenu::print (this=0xda2cd0) at /home/george/kde/src/KDE/kdepim/korganizer/koeventpopupmenu.cpp:135
#13 0x00002ab469736d3d in KOEventPopupMenu::qt_metacall (this=0xda2cd0, _c=QMetaObject::InvokeMetaMethod, _id=14, _a=0x7fff45a91120)
    at /home/george/kde/build/KDE/kdepim/korganizer/koeventpopupmenu.moc:118
#14 0x00002ab467433c3f in QMetaObject::activate (sender=0xa251f0, from_signal_index=5, to_signal_index=6, argv=0x7fff45a91120) at kernel/qobject.cpp:3020
#15 0x00002ab467433e6b in QMetaObject::activate (sender=0xa251f0, m=0x2ab468d2bfc0, from_local_signal_index=1, to_local_signal_index=2, argv=0x7fff45a91120) at kernel/qobject.cpp:3115
#16 0x00002ab4682f3eeb in QAction::triggered (this=0xa251f0, _t1=false) at .moc/debug-shared/moc_qaction.cpp:221
#17 0x00002ab4682f5afc in QAction::activate (this=0xa251f0, event=QAction::Trigger) at kernel/qaction.cpp:1151
#18 0x00002ab468711c48 in QMenuPrivate::activateAction (this=0xda2d30, action=0xa251f0, action_e=QAction::Trigger, self=true) at widgets/qmenu.cpp:1012
#19 0x00002ab468714576 in QMenu::mouseReleaseEvent (this=0xda2cd0, e=0x7fff45a91db0) at widgets/qmenu.cpp:2179
#20 0x00002ab468356f36 in QWidget::event (this=0xda2cd0, event=0x7fff45a91db0) at kernel/qwidget.cpp:7202
#21 0x00002ab46870f993 in QMenu::event (this=0xda2cd0, e=0x7fff45a91db0) at widgets/qmenu.cpp:2277
#22 0x00002ab4682fbbc7 in QApplicationPrivate::notify_helper (this=0x641210, receiver=0xda2cd0, e=0x7fff45a91db0) at kernel/qapplication.cpp:3886
#23 0x00002ab4682fc92f in QApplication::notify (this=0x7fff45a92d60, receiver=0xda2cd0, e=0x7fff45a91db0) at kernel/qapplication.cpp:3588
#24 0x00002ab465fa2f38 in KApplication::notify (this=0x7fff45a92d60, receiver=0xda2cd0, event=0x7fff45a91db0) at /home/george/kde/src/KDE/kdelibs/kdeui/kernel/kapplication.cpp:307
#25 0x00002ab46741d51c in QCoreApplication::notifyInternal (this=0x7fff45a92d60, receiver=0xda2cd0, event=0x7fff45a91db0) at kernel/qcoreapplication.cpp:589
#26 0x00002ab468308033 in QCoreApplication::sendSpontaneousEvent (receiver=0xda2cd0, event=0x7fff45a91db0) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:220
#27 0x00002ab4683006eb in QApplicationPrivate::sendMouseEvent (receiver=0xda2cd0, event=0x7fff45a91db0, alienWidget=0x0, nativeWidget=0xda2cd0, buttonDown=0x2ab468d67778, 
    lastMouseReceiver=@0x2ab468d67780) at kernel/qapplication.cpp:2806
#28 0x00002ab468376ba3 in QETWidget::translateMouseEvent (this=0xda2cd0, event=0x7fff45a92940) at kernel/qapplication_x11.cpp:4169
#29 0x00002ab4683747b8 in QApplication::x11ProcessEvent (this=0x7fff45a92d60, event=0x7fff45a92940) at kernel/qapplication_x11.cpp:3232
#30 0x00002ab4683a0c2f in x11EventSourceDispatch (s=0x644780, callback=0, user_data=0x0) at kernel/qguieventdispatcher_glib.cpp:148
#31 0x00002ab46dcfbe92 in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0
#32 0x00002ab46dcff146 in KMainWindow::setCaption () at /home/george/kde/src/KDE/kdelibs/kdeui/widgets/kmainwindow.cpp:525
#33 0x00002ab46dcff5df in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#34 0x00002ab46744cb4c in QEventDispatcherGlib::processEvents (this=0x623740, flags=@0x7fff45a92be0) at kernel/qeventdispatcher_glib.cpp:325
#35 0x00002ab4683a0477 in QGuiEventDispatcherGlib::processEvents (this=0x623740, flags=@0x7fff45a92c40) at kernel/qguieventdispatcher_glib.cpp:204
#36 0x00002ab46741a4d4 in QEventLoop::processEvents (this=0x7fff45a92cf0, flags=@0x7fff45a92ca0) at kernel/qeventloop.cpp:149
#37 0x00002ab46741a6d0 in QEventLoop::exec (this=0x7fff45a92cf0, flags=@0x7fff45a92d00) at kernel/qeventloop.cpp:196
#38 0x00002ab46741dd7c in QCoreApplication::exec () at kernel/qcoreapplication.cpp:862
#39 0x00002ab4682fb928 in QApplication::exec () at kernel/qapplication.cpp:3361
#40 0x000000000040a9d4 in main (argc=1, argv=0x7fff45a92f18) at /home/george/kde/src/KDE/kdepim/korganizer/main.cpp:58

Comment 3 George Goldberg 2008-09-28 20:31:02 UTC
*** Bug 160850 has been marked as a duplicate of this bug. ***
Comment 4 Thomas Moenicke 2008-09-30 20:47:21 UTC
For me it also crashes for day view etc. Does it work at all?
Comment 5 Ron Goodheart 2008-11-16 11:03:32 UTC
Created attachment 28599 [details]
Adds calendar pointer to popup so it can passed to print

The popup memu passed a null pointer as the calendar - the result of this is ONLY incidence selection was valid although all could be selected. This patch adds the calendar pointer so that all the print selections can be used. An alternative to this patch would be to disallow any other than the incidence selection if the calendar pointer is zero.
Comment 6 Ron Goodheart 2008-11-17 03:15:10 UTC
Created attachment 28620 [details]
Adds calendar pointer to popup so it can passed to print

same patch adding calendar info to popup, defaulted parameter for calendar removed as this was an initial development artifact, not part of patch.
Comment 7 Allen Winter 2008-11-24 22:10:30 UTC
Thanks Ron.
Patch looks ok. I'll deal with it.
Comment 8 Allen Winter 2008-11-24 22:36:34 UTC
SVN commit 888572 by winterz:

Ron's patch for fixing journal print crashing.  with some minor changes by me.
actually, fixes print crashing in general.
BUG: 160260


 M  +7 -4      koeventpopupmenu.cpp  
 M  +3 -1      koeventpopupmenu.h  
 M  +2 -1      views/agendaview/koagenda.cpp  
 M  +1 -1      views/agendaview/koagenda.h  
 M  +2 -2      views/agendaview/koagendaview.cpp  
 M  +2 -3      views/listview/kolistview.cpp  
 M  +3 -2      views/monthview/monthscene.cpp  
 M  +1 -1      views/monthview/monthscene.h  
 M  +2 -2      views/monthview/monthview.cpp  
 M  +4 -2      views/timelineview/kotimelineview.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=888572