Bug 105438 - kprinter crashes when clicking "properties"
Summary: kprinter crashes when clicking "properties"
Status: CLOSED FIXED
Alias: None
Product: kdeprint
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: ---
Assignee: Cristian Tibirna
URL:
Keywords:
: 108622 111433 113926 116316 116967 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-05-11 01:48 UTC by Norman Urs Baier
Modified: 2008-12-31 18:32 UTC (History)
8 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
.lpoptions (248 bytes, text/plain)
2005-10-10 22:52 UTC, Vince Fischer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Norman Urs Baier 2005-05-11 01:48:39 UTC
Version:            (using KDE KDE 3.4.0)
Installed from:    Compiled From Sources
Compiler:          gcc-3.4.3 Different optimization flags
OS:                Linux

When clicking the properties button in the kprinter shell, the application crashes. Interestingly only for printers, not for the pseudo printers PDF and PS.
I doubt this might be caused by some strange optimization flag of one of the linked libraries, but I tried to recompile everything without optimization flags. Unfortunately I do not really know what backtrace might tell on that:


Using host libthread_db library "/lib/libthread_db.so.1".
[Thread debugging using libthread_db enabled]
[New Thread -1229003088 (LWP 3749)]
[KCrash handler]
#7  0xb7acff28 in KDoubleSpinBox::maxPrecision (this=0x82733e8)
    at kglobal.h:200
#8  0xb7ad1101 in KDoubleSpinBox::setPrecision (this=0x82733e8, precision=3, 
    force=232) at knuminput.cpp:1053
#9  0xb7acf505 in KDoubleSpinBox::setPrecision (this=0x82733e8, precision=0)
    at knuminput.cpp:1047
#10 0xb7acf52c in KDoubleNumInput::setPrecision (this=0x8273158, 
    precision=-1208280766) at knuminput.cpp:855
#11 0xb7fb1942 in MarginValueWidget::setMode (this=0x8273158, m=2)
    at marginvaluewidget.cpp:105
#12 0x00000002 in ?? ()
#13 0xb7fd152d in typeinfo name for MarginWidget ()
   from /opt/kde-3.4.0/lib/libkdeprint.so.4
#14 0xb7fb33d6 in MarginWidget (this=0x826cde0, parent=0x824c198, 
    name=0x82485b8 "\210=\222¶BÒ\226·h\206$\b\020ãÿ¿hÂ$\b", allowMetricUnit=8)
    at marginwidget.cpp:211
#15 0xbfffe204 in ?? ()
#16 0x0824c108 in ?? ()
#17 0x081f73a8 in ?? ()
#18 0xb68cdd70 in ?? () from /opt/kde-3.4.0/lib/kde3/kdeprint_cups.so
#19 0x080d6280 in ?? ()
#20 0x0824b8e8 in ?? ()
#21 0xbfffe310 in ?? ()
#22 0xb6e357be in operator new (sz=136756856)
    at ../../../../gcc-3.4.3/libstdc++-v3/libsupc++/new_op.cc:48
Comment 1 Michael Goffioul 2005-05-12 14:51:00 UTC
Do you have access to a gcc-3.3x compiler? I never had that problem before and the code hasn't changed for the last 5 months. Moreover, the backtrace looks weird as the value for "precision" is different in every frame, while it should be the same.

Michael.
Comment 2 Norman Urs Baier 2005-05-13 12:06:14 UTC
I did just recompile everything (LFS system). I used compiler gcc-3.4.3 with flags: -Os -march=pentium-m -msse2 -msse -mmmx -fomit-frame-pointer, except of course for gcc and glibc. Anyway, I got somehow the same phenomenon. I might want to consider a gcc-3.3 compiler, but what would I need to recompile, kprinter, qt, kde-libs, kde-base? It does not seem to be cups, X, nor any of the other linked libraries, does it?

Using host libthread_db library "/lib/libthread_db.so.1".
[Thread debugging using libthread_db enabled]
[New Thread -1228351824 (LWP 472)]
[KCrash handler]
#7  0xb7b05787 in KDoubleSpinBox::maxPrecision ()
   from /opt/kde-3.4.0/lib/libkdeui.so.4
#8  0xb7b0695b in KDoubleSpinBox::setPrecision ()
   from /opt/kde-3.4.0/lib/libkdeui.so.4
#9  0xb7b04d86 in KDoubleSpinBox::setPrecision ()
   from /opt/kde-3.4.0/lib/libkdeui.so.4
#10 0xb7b04dab in KDoubleNumInput::setPrecision ()
   from /opt/kde-3.4.0/lib/libkdeui.so.4
#11 0xb7fb120c in MarginValueWidget::setMode ()
   from /opt/kde-3.4.0/lib/libkdeprint.so.4
#12 0xb7fb2f22 in MarginWidget::MarginWidget ()
   from /opt/kde-3.4.0/lib/libkdeprint.so.4
#13 0xb69abb82 in KPTextPage::KPTextPage ()
   from /opt/kde-3.4.0/lib/kde3/kdeprint_cups.so
#14 0xb6998566 in KMCupsUiManager::setupPrinterPropertyDialog ()
   from /opt/kde-3.4.0/lib/kde3/kdeprint_cups.so
#15 0xb7f721ad in KMUiManager::setupPropertyDialog ()
   from /opt/kde-3.4.0/lib/libkdeprint.so.4
#16 0xb7f9523e in KPrinterPropertyDialog::setupPrinter ()
   from /opt/kde-3.4.0/lib/libkdeprint.so.4
#17 0xb7f7f1b6 in KPrintDialog::slotProperties ()
   from /opt/kde-3.4.0/lib/libkdeprint.so.4
#18 0xb7f85ef1 in KPrintDialog::qt_invoke ()
   from /opt/kde-3.4.0/lib/libkdeprint.so.4
#19 0xb739e8b0 in QObject::activate_signal ()
   from /usr/lib/qt-3.3.4/lib/libqt-mt.so.3
#20 0xb739eeea in QObject::activate_signal ()
   from /usr/lib/qt-3.3.4/lib/libqt-mt.so.3
#21 0xb7623ca9 in QButton::clicked () from /usr/lib/qt-3.3.4/lib/libqt-mt.so.3
#22 0xb74104a4 in QButton::mouseReleaseEvent ()
   from /usr/lib/qt-3.3.4/lib/libqt-mt.so.3
#23 0xb73c94b4 in QWidget::event () from /usr/lib/qt-3.3.4/lib/libqt-mt.so.3
#24 0xb735407d in QApplication::internalNotify ()
   from /usr/lib/qt-3.3.4/lib/libqt-mt.so.3
#25 0xb73543f3 in QApplication::notify ()
   from /usr/lib/qt-3.3.4/lib/libqt-mt.so.3
#26 0xb7876821 in KApplication::notify ()
   from /opt/kde-3.4.0/lib/libkdecore.so.4
#27 0xb7306543 in QETWidget::translateMouseEvent ()
   from /usr/lib/qt-3.3.4/lib/libqt-mt.so.3
#28 0xb730529c in QApplication::x11ProcessEvent ()
   from /usr/lib/qt-3.3.4/lib/libqt-mt.so.3
#29 0xb73138c3 in QEventLoop::processEvents ()
   from /usr/lib/qt-3.3.4/lib/libqt-mt.so.3
#30 0xb7364b2c in QEventLoop::enterLoop ()
   from /usr/lib/qt-3.3.4/lib/libqt-mt.so.3
#31 0xb73534fe in QApplication::enter_loop ()
   from /usr/lib/qt-3.3.4/lib/libqt-mt.so.3
#32 0xb74cf71e in QDialog::exec () from /usr/lib/qt-3.3.4/lib/libqt-mt.so.3
#33 0xb7fe73b9 in PrintWrapper::slotPrint (this=0x80f8568)
    at printwrapper.cpp:272
#34 0xb7fe759e in PrintWrapper::qt_invoke (this=0x80f8568, _id=45, 
    _o=0xbffff0a0) at printwrapper.moc:89
#35 0xb739e8b0 in QObject::activate_signal ()
   from /usr/lib/qt-3.3.4/lib/libqt-mt.so.3
#36 0xb761ed9d in QSignal::signal () from /usr/lib/qt-3.3.4/lib/libqt-mt.so.3
#37 0xb73b2b6b in QSignal::activate () from /usr/lib/qt-3.3.4/lib/libqt-mt.so.3
#38 0xb73b83c5 in QSingleShotTimer::event ()
   from /usr/lib/qt-3.3.4/lib/libqt-mt.so.3
#39 0xb735407d in QApplication::internalNotify ()
   from /usr/lib/qt-3.3.4/lib/libqt-mt.so.3
#40 0xb7354850 in QApplication::notify ()
   from /usr/lib/qt-3.3.4/lib/libqt-mt.so.3
#41 0xb7876821 in KApplication::notify ()
   from /opt/kde-3.4.0/lib/libkdecore.so.4
#42 0xb734a92f in QEventLoop::activateTimers ()
   from /usr/lib/qt-3.3.4/lib/libqt-mt.so.3
#43 0xb7313faa in QEventLoop::processEvents ()
   from /usr/lib/qt-3.3.4/lib/libqt-mt.so.3
#44 0xb7364b2c in QEventLoop::enterLoop ()
   from /usr/lib/qt-3.3.4/lib/libqt-mt.so.3
#45 0xb7364a91 in QEventLoop::exec () from /usr/lib/qt-3.3.4/lib/libqt-mt.so.3
#46 0xb73534de in QApplication::exec ()
   from /usr/lib/qt-3.3.4/lib/libqt-mt.so.3
#47 0xb7fe520e in kdemain (argc=1, argv=0xbffff744) at main.cpp:54
#48 0xb6ceae0d in __libc_start_main (main=0x8048674 <main>, argc=1, 
    ubp_av=0xbffff744, init=0x8048680 <__libc_csu_init>, fini=0, 
    rtld_fini=0x9a81bc, stack_end=0xbffff73c)
    at ../sysdeps/generic/libc-start.c:209
#49 0x080485e1 in _start () at ../sysdeps/i386/elf/start.S:119

Comment 3 Norman Urs Baier 2005-05-18 14:57:41 UTC
I have recompiled the whole system using gcc-3.3.6 now kprinter does not crash anymore. Seems to be a compiler issue. Furthermore I do not suspect kprinter anymore to trigger the bug in gcc, but some X-library, as the same problem showed also using Samsung llpr, which is in no way linked to Qt or KDE libs.
Comment 4 Norman Urs Baier 2005-05-18 15:01:29 UTC
Because kprinter does not seem to be guilty I mark bug as resolved.
Comment 5 Richard Chonak 2005-08-17 16:55:48 UTC
A similar crash (SIGSEGV) appears on Mandriva 2005 ("Limited Edition Club")

$ kprinter -version
Qt: 3.3.4
KDE: 3.4.0
KPrinter: 0.0.1

Backtrace:

(no debugging symbols found)
Using host libthread_db library "/lib/tls/libthread_db.so.1".
(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)
[Thread debugging using libthread_db enabled]
[New Thread -1231144384 (LWP 10911)]
(no debugging symbols found)
[KCrash handler]
#7  0xb745289b in QGListIterator::QGListIterator ()
   from /usr/lib/qt3/lib/libqt-mt.so.3
#8  0xbfffd7c0 in ?? ()
#9  0x081f5bbc in ?? ()
#10 0x00000000 in ?? ()
#11 0x00000000 in ?? ()
#12 0xb7f01411 in malloc () from /lib/tls/libc.so.6
#13 0x00000000 in ?? ()
#14 0xbfffd828 in ?? ()
#15 0x00000009 in ?? ()
#16 0x081c6c70 in ?? ()
#17 0xb75c4574 in ?? () from /usr/lib/qt3/lib/libqt-mt.so.3
#18 0xbfffd9d8 in ?? ()
#19 0xb7e963ac in ?? () from /usr/lib/libkdeprint.so.4
#20 0xbfffd930 in ?? ()
#21 0x00000000 in ?? ()
#22 0xbfffd9d8 in ?? ()
#23 0xb7e43b87 in KPGeneralPage::setOptions () from /usr/lib/libkdeprint.so.4

Configuration: 
The CUPS server is on another machine.  If I configure a local CUPS server, the problem goes away.
Comment 6 Chris Bayley 2005-08-21 22:46:34 UTC
I too have been having this problem since about the begining of the year (maybe KDE 3.2) and haven't found any resolution above - however I have stopped short of recompiling my whole system on a hope!

Like the original poster properties for the PDF distiller works ok as does properties for a real cups printer when kprinter is run as root.

gcc (GCC) 3.3.5-20050130
Qt: 3.3.4
KDE: 3.4.2
KPrinter: 0.0.1

Backtrace:
[KCrash handler]
#4  0xb738ff52 in QGListIterator::QGListIterator ()
   from /usr/qt/3/lib/libqt-mt.so.3
#5  0xb7f5a2fc in DrListOption::findChoice ()
   from /usr/kde/3.4/lib/libkdeprint.so.4
#6  0xb7f870de in KPGeneralPage::setOptions ()
   from /usr/kde/3.4/lib/libkdeprint.so.4
#7  0xb7f81e11 in KPrinterPropertyDialog::slotCurrentChanged ()
   from /usr/kde/3.4/lib/libkdeprint.so.4
#8  0xb7f828bd in KPrinterPropertyDialog::qt_invoke ()
   from /usr/kde/3.4/lib/libkdeprint.so.4
#9  0xb70d3f4c in QObject::activate_signal () from /usr/qt/3/lib/libqt-mt.so.3
#10 0xb7431faa in QTabWidget::currentChanged ()
   from /usr/qt/3/lib/libqt-mt.so.3
#11 0xb7200403 in QTabWidget::showTab () from /usr/qt/3/lib/libqt-mt.so.3
#12 0xb74320c0 in QTabWidget::qt_invoke () from /usr/qt/3/lib/libqt-mt.so.3
#13 0xb70d3f4c in QObject::activate_signal () from /usr/qt/3/lib/libqt-mt.so.3
#14 0xb70d40ad in QObject::activate_signal () from /usr/qt/3/lib/libqt-mt.so.3
#15 0xb74318a2 in QTabBar::selected () from /usr/qt/3/lib/libqt-mt.so.3
#16 0xb71fcb45 in QTabBar::show () from /usr/qt/3/lib/libqt-mt.so.3
#17 0xb71099cd in QWidget::showChildren () from /usr/qt/3/lib/libqt-mt.so.3
#18 0xb7109482 in QWidget::show () from /usr/qt/3/lib/libqt-mt.so.3
#19 0xb71099cd in QWidget::showChildren () from /usr/qt/3/lib/libqt-mt.so.3
#20 0xb7109482 in QWidget::show () from /usr/qt/3/lib/libqt-mt.so.3
#21 0xb725fa0c in QDialog::show () from /usr/qt/3/lib/libqt-mt.so.3
#22 0xb725f24c in QDialog::exec () from /usr/qt/3/lib/libqt-mt.so.3
#23 0xb7f82614 in KPrinterPropertyDialog::setupPrinter ()
Comment 7 Michael Goffioul 2005-08-22 11:38:30 UTC
Just to notify Cristian.
Comment 8 Cristian Tibirna 2005-08-24 20:48:56 UTC
*** Bug 111433 has been marked as a duplicate of this bug. ***
Comment 9 Cristian Tibirna 2005-08-24 20:51:01 UTC
*** Bug 108622 has been marked as a duplicate of this bug. ***
Comment 10 Cristian Tibirna 2005-08-24 20:57:38 UTC
Richard Chonak, would you please provide the version of your compiler?

Chris Bayley, could you please confirm that the KDE and Qt packages that you're using were compiled with gcc-3.3.5? ('cause I have 3.3.5-20050117 here and I can't reproduce the crash -- thus it's difficult to debug).
Comment 11 Richard Chonak 2005-08-25 05:45:02 UTC
I'm running Mandriva Linux; I assume it's all built with the following
compiler:

$ gcc -v
Reading specs from /usr/lib/gcc/i586-mandrake-linux-gnu/3.4.3/specs
Configured with: ../configure --prefix=/usr --libexecdir=/usr/lib
--with-slibdir=/lib --mandir=/usr/share/man --infodir=/usr/share/info
--enable-shared --enable-threads=posix --disable-checking
--enable-long-long --enable-__cxa_atexit --enable-clocale=gnu
--disable-libunwind-exceptions
--enable-languages=c,c++,ada,f77,objc,java
--host=i586-mandrake-linux-gnu --with-system-zlib
Thread model: posix
gcc version 3.4.3 (Mandrakelinux 10.2 3.4.3-7mdk)


Thanks for looking into the problem.

Regards--
--RC




--- Cristian Tibirna <tibirna@kde.org> wrote:

[bugs.kde.org quoted mail]
----------------------------------------------------------------------------
>                  CC|                            |chonak yahoo com,
>                    |                            |chris codeweaver co
> nz
> 
> 
> 
> ------- Additional Comments From tibirna kde org  2005-08-24 20:57
> -------
> Richard Chonak, would you please provide the version of your
> compiler?
> 
> Chris Bayley, could you please confirm that the KDE and Qt packages
> that you're using were compiled with gcc-3.3.5? ('cause I have
> 3.3.5-20050117 here and I can't reproduce the crash -- thus it's
> difficult to debug).
> 



__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
Comment 12 Chris Bayley 2005-08-27 13:57:21 UTC
On my system (gentoo), gcc (GCC) 3.3.5-20050130 was compiled April 13,
libqt was compiled May 10, and kdelibs compiled Aug 1, is that
sufficient to imply that gcc (GCC) 3.3.5-20050130 was used for both qt
and kdelibs, or is there a definitive method to determine the gcc
version used to compile various apps ?

Thanks,
Chris

Cristian Tibirna wrote:

[bugs.kde.org quoted mail]
Comment 13 Cristian Tibirna 2005-10-06 00:41:08 UTC
*** Bug 113926 has been marked as a duplicate of this bug. ***
Comment 14 Chris Bayley 2005-10-06 09:54:12 UTC
Do you want an strace of the Seg fault ?

Cristian Tibirna wrote:

[bugs.kde.org quoted mail]
Comment 15 Cristian Tibirna 2005-10-06 14:34:46 UTC
Thanks Chris. The backtraces that I have are already saying more than what an strace could. What would help much more would be a backtrace gotten with a KDE compiled with debug symbols or, even better, a way to reproduce this crash reliably, so that _I_ can do it too. I never manage to get such a crash, not with the PPDs indicated by reporters, not with anything else.

I will try valgrind in this week-end.

Thanks.
Comment 16 Cristian Tibirna 2005-10-10 21:33:21 UTC
Since the dependence of the crash on some compiler version is no more plausible, could everybody who still sees this crash provide me with their ~/.lpoptions file? Thanks.
Comment 17 Georg von Hippel 2005-10-10 21:52:53 UTC
On 10 Oct 2005, Cristian Tibirna wrote:

[bugs.kde.org quoted mail]

~/.lpoptions:
Dest spider media=Letter,Normal,Upper sides=two-sided-long-edge
Special Advanced%20Faxing%20Tool%20(ksendfax)
Special Mail%20PDF%20file
Special Print%20to%20File%20(PDF)
Special Print%20to%20File%20(PostScript)
Special Send%20to%20Fax

/etc/cups/lpoptions:
Dest spider page-bottom=36 cpi=12 lpi=7 scaling=100 page-right=36 
page-left=36 wrap=true page-top=36

/etc/cups/printers.conf:
<DefaultPrinter spider>
Info Created by redhat-config-printer 0.6.x
DeviceURI socket://spider-printer.phys.uregina.ca:9100
Location Printer in Grad. Students room
State Idle
Accepting Yes
JobSheets none none
QuotaPeriod 0
PageLimit 0
KLimit 0
</Printer>
Comment 18 Cristian Tibirna 2005-10-10 22:39:15 UTC
Thanks to the latest report (comment #17) from Georg, I think I understand what happens.

The people that observe the not-so-easy-to-reproduce crash seem to have a "media=[SomePageSize],[SomeMediaType],[SomeInputSlot]" option in ~/.lpoptions on the corresponding line of the printer that crashes kprinter. The crash occurs because either one of these three options is missing in the ppd used for that printer. One obvious culprit could be the generic.ppd for postscript printers, that lacks both MediaType and InputSlot options.

I can't really tell how do you end up with those options in the first place, but, as a workaround, you could just remove the media=... option from your ~/.lpoptions for now.

I will commit a fix to 3.5 when the commit freeze is over and in the meanwhile I will try the deeper implications of what happens here.

Thanks for your patience and for your help.
Comment 19 Vince Fischer 2005-10-10 22:52:19 UTC
File attached per request.

On Monday 10 October 2005 21.33, Cristian Tibirna wrote:
[bugs.kde.org quoted mail]


Created an attachment (id=12941)
.lpoptions
Comment 20 Cristian Tibirna 2005-10-10 23:44:41 UTC
SVN commit 469362 by tibirna:

check that ::findOption() returns a valid pointer before using it for
::findChoice()
BUG:105438


 M  +7 -3      kpgeneralpage.cpp  


--- trunk/KDE/kdelibs/kdeprint/kpgeneralpage.cpp #469361:469362
@@ -486,17 +486,21 @@
 		{
 			value = *it;
 			DrBase	*ch;
-			if ((ch = ((DrListOption*)driver()->findOption("PageSize"))->findChoice(value)))
+			if ((ch = (driver()->findOption("PageSize"))) &&
+                            (ch = (static_cast<DrListOption*>(ch))->findChoice(value)))
 			{
 				if (m_pagesize->isEnabled())
 					setComboItem(m_pagesize, ch->get("text"));
 			}
-			else if ((ch = ((DrListOption*)driver()->findOption("MediaType"))->findChoice(value)))
+			else if ((ch = (driver()->findOption("MediaType"))) &&
+                                 (ch = (static_cast<DrListOption*>(ch))->findChoice(value)))
+
 			{
 				if (m_papertype->isEnabled())
 					setComboItem(m_papertype, ch->get("text"));
 			}
-			else if ((ch = ((DrListOption*)driver()->findOption("InputSlot"))->findChoice(value)))
+			else if ((ch = (driver()->findOption("InputSlot"))) &&
+                                 (ch = (static_cast<DrListOption*>(ch))->findChoice(value)))
 			{
 				if (m_inputslot)
 					setComboItem(m_inputslot, ch->get("text"));
Comment 21 chris bayley 2005-10-11 12:00:22 UTC
Thanks Cristian, that was certainly the cause of the problem for me!
Comment 22 Georg von Hippel 2005-10-11 18:09:55 UTC
Removing MediaType and InputSlot from ~/.lpoptions works for me. Thanks, 
Cristian!
Comment 23 Cristian Tibirna 2005-11-14 14:09:51 UTC
*** Bug 116316 has been marked as a duplicate of this bug. ***
Comment 24 Cristian Tibirna 2005-11-24 00:22:19 UTC
*** Bug 116967 has been marked as a duplicate of this bug. ***
Comment 25 John Layt 2008-12-31 18:32:41 UTC
Closing old Resolved status bug.