Bug 56263 - KPrinter Crashes when using CUPS as Print System
Summary: KPrinter Crashes when using CUPS as Print System
Status: RESOLVED FIXED
Alias: None
Product: kdelibs
Classification: Unmaintained
Component: general (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR crash
Target Milestone: ---
Assignee: Thiago Macieira
URL:
Keywords:
: 56392 56616 56655 56746 56773 56820 57606 57636 58012 58109 58133 58252 58924 61861 62453 63954 66068 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-03-23 05:49 UTC by Charles Philip Chan
Modified: 2003-10-15 18:10 UTC (History)
15 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Charles Philip Chan 2003-03-23 05:49:10 UTC
Version:           3.1.1 (using KDE KDE 3.1.1)
Installed from:    SuSE RPMs
OS:          Linux

I tried to print after upgrading to KDE 3.1.1 and it crashes the app (this happens with all apps). After doing some experiment I found out that this only happens when CUPS it selected as the print system (printing with "Generic Unix LPD Print System" works). I don't know whether this is just a KDE 3.1.1 problem or a combination of KDE 3.1.1 and XFree86 4.3 since I upgraded both at around the same time. Unfortunately, the SuSE packages from the KDE site have been striped of debugging symbols, but FWIW here is the back trace:

(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 1024 (LWP 19430)]
0x410a4449 in wait4 () from /lib/libc.so.6
#0  0x410a4449 in wait4 () from /lib/libc.so.6
#1  0x41120f70 in __DTOR_END__ () from /lib/libc.so.6
#2  0x40efba73 in waitpid () from /lib/libpthread.so.0
#3  0x40627f0d in KCrash::defaultCrashHandler(int) ()
   from /opt/kde3/lib/libkdecore.so.4
#4  0x40ef911b in pthread_sighandler () from /lib/libpthread.so.0
#5  <signal handler called>
#6  0x40657439 in KExtendedSocketLookup::freeresults(kde_addrinfo*) ()
   from /opt/kde3/lib/libkdecore.so.4
#7  0x40656f48 in local_freeaddrinfo(kde_addrinfo*&) ()
   from /opt/kde3/lib/libkdecore.so.4
#8  0x40657ac9 in KExtendedSocket::~KExtendedSocket() ()
   from /opt/kde3/lib/libkdecore.so.4
#9  0x420b247f in KMCupsManager::completePrinterShort(KMPrinter*) ()
   from /opt/kde3/lib/kde3/kdeprint_cups.so
#10 0x415a63f4 in KPrintDialog::slotPrinterSelected(int) ()
   from /opt/kde3/lib/libkdeprint.so.4
#11 0x415a5a27 in KPrintDialog::initialize(KPrinter*) ()
   from /opt/kde3/lib/libkdeprint.so.4
#12 0x415a832d in KPrintDialog::slotUpdatePossible(bool) ()
   from /opt/kde3/lib/libkdeprint.so.4
#13 0x415a8b04 in KPrintDialog::qt_invoke(int, QUObject*) ()
   from /opt/kde3/lib/libkdeprint.so.4
#14 0x409bd149 in QObject::activate_signal(QConnectionList*, QUObject*) ()
   from /usr/lib/libqt-mt.so.3
#15 0x409bd50d in QObject::activate_signal_bool(int, bool) ()
   from /usr/lib/libqt-mt.so.3
#16 0x4158ea7a in KMManager::updatePossible(bool) ()
   from /opt/kde3/lib/libkdeprint.so.4
#17 0x4158e8ce in KMManager::setUpdatePossible(bool) ()
   from /opt/kde3/lib/libkdeprint.so.4
#18 0x420b81b7 in KMCupsManager::slotConnectionSuccess() ()
   from /opt/kde3/lib/kde3/kdeprint_cups.so
#19 0x420b8d18 in KMCupsManager::qt_invoke(int, QUObject*) ()
   from /opt/kde3/lib/kde3/kdeprint_cups.so
#20 0x409bd149 in QObject::activate_signal(QConnectionList*, QUObject*) ()
   from /usr/lib/libqt-mt.so.3
#21 0x409bcfe7 in QObject::activate_signal(int) () from /usr/lib/libqt-mt.so.3
#22 0x40cca9ec in QSocket::connected() () from /usr/lib/libqt-mt.so.3
#23 0x40b8de9c in QSocket::tryConnection() () from /usr/lib/libqt-mt.so.3
#24 0x40b8de0c in QSocket::sn_write() () from /usr/lib/libqt-mt.so.3
#25 0x40ccabcb in QSocket::qt_invoke(int, QUObject*) ()
   from /usr/lib/libqt-mt.so.3
#26 0x409bd149 in QObject::activate_signal(QConnectionList*, QUObject*) ()
   from /usr/lib/libqt-mt.so.3
#27 0x409bd225 in QObject::activate_signal(int, int) ()
   from /usr/lib/libqt-mt.so.3
#28 0x40c9d482 in QSocketNotifier::activated(int) ()
   from /usr/lib/libqt-mt.so.3
#29 0x409d9800 in QSocketNotifier::event(QEvent*) ()
   from /usr/lib/libqt-mt.so.3
#30 0x4095f204 in QApplication::internalNotify(QObject*, QEvent*) ()
   from /usr/lib/libqt-mt.so.3
#31 0x4095ed6b in QApplication::notify(QObject*, QEvent*) ()
   from /usr/lib/libqt-mt.so.3
#32 0x405b9f09 in KApplication::notify(QObject*, QEvent*) ()
   from /opt/kde3/lib/libkdecore.so.4
#33 0x40938218 in QEventLoop::activateSocketNotifiers() ()
   from /usr/lib/libqt-mt.so.3
#34 0x40915aa3 in QEventLoop::processEvents(unsigned) ()
   from /usr/lib/libqt-mt.so.3
#35 0x40972ec6 in QEventLoop::enterLoop() () from /usr/lib/libqt-mt.so.3
#36 0x4095f491 in QApplication::enter_loop() () from /usr/lib/libqt-mt.so.3
#37 0x40b21b71 in QDialog::exec() () from /usr/lib/libqt-mt.so.3
#38 0x415a9a5e in KPrinter::setup(QWidget*, QString const&, bool) ()
   from /opt/kde3/lib/libkdeprint.so.4
#39 0x414e2e64 in KoMainWindow::print(bool) ()
   from /opt/kde3/lib/libkofficecore.so.2
#40 0x414e2f9c in KoMainWindow::slotFilePrint() ()
   from /opt/kde3/lib/libkofficecore.so.2
#41 0x414e609a in KoMainWindow::qt_invoke(int, QUObject*) ()
   from /opt/kde3/lib/libkofficecore.so.2
#42 0x409bd149 in QObject::activate_signal(QConnectionList*, QUObject*) ()
   from /usr/lib/libqt-mt.so.3
#43 0x409bcfe7 in QObject::activate_signal(int) () from /usr/lib/libqt-mt.so.3
#44 0x403eabeb in KAction::activated() () from /opt/kde3/lib/libkdeui.so.4
#45 0x403dc05f in KAction::slotActivated() () from /opt/kde3/lib/libkdeui.so.4
#46 0x403eade2 in KAction::qt_invoke(int, QUObject*) ()
   from /opt/kde3/lib/libkdeui.so.4
#47 0x409bd149 in QObject::activate_signal(QConnectionList*, QUObject*) ()
   from /usr/lib/libqt-mt.so.3
#48 0x40c9c5e2 in QSignal::signal(QVariant const&) ()
   from /usr/lib/libqt-mt.so.3
#49 0x409d7408 in QSignal::activate() () from /usr/lib/libqt-mt.so.3
#50 0x40aaa9d0 in QPopupMenu::mouseReleaseEvent(QMouseEvent*) ()
   from /usr/lib/libqt-mt.so.3
#51 0x409f140c in QWidget::event(QEvent*) () from /usr/lib/libqt-mt.so.3
#52 0x4095f204 in QApplication::internalNotify(QObject*, QEvent*) ()
   from /usr/lib/libqt-mt.so.3
#53 0x4095e7e3 in QApplication::notify(QObject*, QEvent*) ()
   from /usr/lib/libqt-mt.so.3
#54 0x405b9f09 in KApplication::notify(QObject*, QEvent*) ()
   from /opt/kde3/lib/libkdecore.so.4
#55 0x40902926 in QETWidget::translateMouseEvent(_XEvent const*) ()
   from /usr/lib/libqt-mt.so.3
#56 0x40900931 in QApplication::x11ProcessEvent(_XEvent*) ()
   from /usr/lib/libqt-mt.so.3
#57 0x40915daa in QEventLoop::processEvents(unsigned) ()
   from /usr/lib/libqt-mt.so.3
#58 0x40972ec6 in QEventLoop::enterLoop() () from /usr/lib/libqt-mt.so.3
#59 0x40972d68 in QEventLoop::exec() () from /usr/lib/libqt-mt.so.3
#60 0x4095f431 in QApplication::exec() () from /usr/lib/libqt-mt.so.3
#61 0x406fd2ce in main () from /opt/kde3/lib/kword.so
#62 0x0804cc3a in strcpy ()
#63 0x0804d909 in strcpy ()
#64 0x0804dddc in strcpy ()
#65 0x0804eb40 in strcpy ()
#66 0x4101e4f2 in __libc_start_main () from /lib/libc.so.6

Thanks,
Charles
Comment 1 Thiago Macieira 2003-03-23 12:51:57 UTC
Known problem. 
 
See: http://lists.kde.org/?l=kde-core-devel&m=104816905108215&w=2 
Comment 2 Sebastien ROHAUT 2003-03-23 21:32:28 UTC
Exactly the same problem, but only when I am connected to the Internet via a 
DSL connection.
Without connection : printing is working well.
When I connect to the Internet via DSL connexion (USB Sagem Modem), it hangs 
with a SIGSEGV signal.
When I connect my modem drivers creates a new Ethernet Interface eth0 with a 
class c address (192.168.60.30) then opens a ppp0 (with dynamic IP) with 
routing from the eth0 IP address.
I can use localhost:311 http connection to cups frontend and print a test page 
without any problem even if I am connected, but KDE3.1.1 (SuSE 8.1) crashes.
Comment 3 Thiago Macieira 2003-03-23 23:58:53 UTC
Subject: Re:  KPrinter Crashes when using CUPS as Print System

Sebastien ROHAUT wrote:
> ------- Exactly the same problem, but only when I am connected to the
> Internet via a DSL connection.
>Without connection : printing is working well.
>When I connect to the Internet via DSL connexion (USB Sagem Modem), it hangs
>with a SIGSEGV signal.

Now that's new to me and it might help solving the problem.

Can you describe your network settings? What are your DNS servers before 
connection, how many interfaces active? And how about after connection?

Can you test if it crashes as well when connected, but with the unconnected 
DNS configuration?

Comment 4 Sebastien ROHAUT 2003-03-24 10:19:48 UTC
Subject: Re:  KPrinter Crashes when using CUPS as Print System

En r
Comment 5 Thiago Macieira 2003-03-24 17:31:34 UTC
Subject: Fwd: Re: Fwd: kprinter crashes with KDE 3.1.1 + woody

Subject: Re: Fwd: kprinter crashes with KDE 3.1.1 + woody
Date: Segunda, 24 de Mar
Comment 6 George 2003-03-24 19:11:27 UTC
Experiencing the same problem with Gentoo and kde-3.1.1. 
Solution I found was to swap the order of my localhost file in /etc/hosts. ie. 
From 
127.0.0.1 localhost <hostname> 
To 
127.0.0.1 <hostname> localhost 
 
I am using standard dhcp on eth0 to obtain an IP address. 
HTH 
 
Martin 
Comment 7 Thiago Macieira 2003-03-24 19:34:10 UTC
Subject: kdelibs/kdecore

CVS commit by thiago: 

Tentative solution to bug #56263 (asynchronous lookups still running
even after object deletion). Will backport to BRANCH in a day or two.

CCMAIL:56263-done@bugs.kde.org, staikos@kde.org


  M +12 -5     kextsock.cpp   1.55


--- kdelibs/kdecore/kextsock.cpp  #1.54:1.55
@@ -1507,6 +1507,4 @@ void KExtendedSocket::closeNow()
     return;                     // nothing to close
 
-  d->status = done;
-
   // close the socket
   delete d->qsnIn;
@@ -1514,6 +1512,15 @@ void KExtendedSocket::closeNow()
   d->qsnIn = d->qsnOut = NULL;
 
+  if (d->status > connecting)
+    {
   ::close(sockfd);
   sockfd = -1;
+    }
+  else if (d->status == connecting)
+    cancelAsyncConnect();
+  else if (d->status == lookupInProgress)
+    cancelAsyncLookup();
+
+  d->status = done;
 
   emit closed(closedNow |


Comment 8 Osho G 2003-03-25 07:05:04 UTC
I have RedHat 8.0. I compiled kde 3.1.1 using konstruct. Everything seems working fine except printing. I 
ran across this bug report and the thread in the kde-core-devel mailing list. I applied the patch for 
kextsock.cpp and recompiled/reinstalled kdelibs and kdebase. I still have the same problem. 
 
I can get rid of this problem right now by changing the order of localhost and mymachinename in 
/etc/hosts (as suggested previously in this bug-report). That does solve this problem. 
 
Is there any other way to get rid of this problem? 
Comment 9 Sebastien ROHAUT 2003-03-25 08:37:41 UTC
Subject: Re:  KPrinter Crashes when using CUPS as Print System

En r
Comment 10 Andris Pavenis 2003-03-25 12:53:56 UTC
Subject: Re:  KPrinter Crashes when using CUPS as Print System

On Monday 24 March 2003 20:34, Thiago Macieira wrote:
> ------- You are receiving this mail because: -------
> You are a voter for the bug, or are watching someone who is.
>
> http://bugs.kde.org/show_bug.cgi?id=56263
> thiagom@mail.com changed:
>
>            What    |Removed                     |Added
> ---------------------------------------------------------------------------
>- Status|NEW                         |RESOLVED
>          Resolution|                            |FIXED
>
>
>
> ------- Additional Comments From thiagom@mail.com  2003-03-24 19:34 -------
> Subject: kdelibs/kdecore
>
> CVS commit by thiago:
>
> Tentative solution to bug #56263 (asynchronous lookups still running
> even after object deletion). Will backport to BRANCH in a day or two.
>
> CCMAIL:56263-done@bugs.kde.org, staikos@kde.org
>
>
>   M +12 -5     kextsock.cpp   1.55
>
>
> --- kdelibs/kdecore/kextsock.cpp  #1.54:1.55
> @@ -1507,6 +1507,4 @@ void KExtendedSocket::closeNow()
>      return;                     // nothing to close
>
> -  d->status = done;
> -
>    // close the socket
>    delete d->qsnIn;
> @@ -1514,6 +1512,15 @@ void KExtendedSocket::closeNow()
>    d->qsnIn = d->qsnOut = NULL;
>
> +  if (d->status > connecting)
> +    {
>
>    ::close(sockfd);
>
>    sockfd = -1;
> +    }
> +  else if (d->status == connecting)
> +    cancelAsyncConnect();
> +  else if (d->status == lookupInProgress)
> +    cancelAsyncLookup();
> +
> +  d->status = done;
>
>    emit closed(closedNow |


Tried this and also earlier patch for kdeprint/cups/kmcupsmanager.cpp, but I'm 
still getting crashes. Build some parts of kdelibs with debug info to get 
better backttrace. It is added below (in this case both patches were 
applied).

Some additional info: Slackware-9.0, glibc-2.3.1, gcc-3.2.2, ...

Andris

(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 13043)]

0x41583f29 in wait4 () from /lib/libc.so.6
#0  0x41583f29 in wait4 () from /lib/libc.so.6
#1  0x41604234 in __DTOR_END__ () from /lib/libc.so.6
#2  0x41399103 in waitpid () from /lib/libpthread.so.0
#3  0x40ae228d in KCrash::defaultCrashHandler(int) (sig=11) at kcrash.cpp:235
#4  <signal handler called>
#5  KExtendedSocketLookup::freeresults(kde_addrinfo*) (res=0x8487454)
    at kextsock.cpp:382
#6  0x40b16c98 in local_freeaddrinfo(kde_addrinfo*&) (p=@0x8487454)
    at kextsock.cpp:274
#7  0x40b17829 in ~KExtendedSocket (this=0x8487398) at kextsock.cpp:428
#8  0x41a6e7b4 in KMCupsManager::completePrinterShort(KMPrinter*) (
    this=0x849c2f0, p=0x850b7a0) at kmcupsmanager.cpp:288
#9  0x402b7a89 in KPrintDialog::slotPrinterSelected(int) ()
   from /opt/kde/lib/libkdeprint.so.4
#10 0x402b705e in KPrintDialog::initialize(KPrinter*) ()
   from /opt/kde/lib/libkdeprint.so.4
#11 0x402b999d in KPrintDialog::slotUpdatePossible(bool) ()
   from /opt/kde/lib/libkdeprint.so.4
#12 0x402ba15f in KPrintDialog::qt_invoke(int, QUObject*) ()
   from /opt/kde/lib/libkdeprint.so.4
#13 0x40e639f9 in QObject::activate_signal(QConnectionList*, QUObject*) ()
   from /usr/lib/qt/lib/libqt-mt.so.3
#14 0x40e63dbd in QObject::activate_signal_bool(int, bool) ()
   from /usr/lib/qt/lib/libqt-mt.so.3
#15 0x4029d26a in KMManager::updatePossible(bool) ()
   from /opt/kde/lib/libkdeprint.so.4
#16 0x4029d0c2 in KMManager::setUpdatePossible(bool) ()
   from /opt/kde/lib/libkdeprint.so.4
#17 0x41a74236 in KMCupsManager::slotConnectionSuccess() (this=0x849c2f0)
    at kmcupsmanager.cpp:1056
#18 0x41a74db8 in KMCupsManager::qt_invoke(int, QUObject*) (this=0x849c2f0, 
    _id=5, _o=0xbfffde60) at kmcupsmanager.moc:100
#19 0x40e639f9 in QObject::activate_signal(QConnectionList*, QUObject*) ()
   from /usr/lib/qt/lib/libqt-mt.so.3
#20 0x40e6389d in QObject::activate_signal(int) ()
   from /usr/lib/qt/lib/libqt-mt.so.3
#21 0x4117121c in QSocket::connected() () from /usr/lib/qt/lib/libqt-mt.so.3
#22 0x4103627f in QSocket::tryConnection() ()
   from /usr/lib/qt/lib/libqt-mt.so.3
#23 0x410361ec in QSocket::sn_write() () from /usr/lib/qt/lib/libqt-mt.so.3
#24 0x411713fb in QSocket::qt_invoke(int, QUObject*) ()
   from /usr/lib/qt/lib/libqt-mt.so.3
#25 0x40e639f9 in QObject::activate_signal(QConnectionList*, QUObject*) ()
   from /usr/lib/qt/lib/libqt-mt.so.3
#26 0x40e63ad5 in QObject::activate_signal(int, int) ()
   from /usr/lib/qt/lib/libqt-mt.so.3
#27 0x411438c2 in QSocketNotifier::activated(int) ()
   from /usr/lib/qt/lib/libqt-mt.so.3
#28 0x40e800b0 in QSocketNotifier::event(QEvent*) ()
   from /usr/lib/qt/lib/libqt-mt.so.3
#29 0x40e058c4 in QApplication::internalNotify(QObject*, QEvent*) ()
   from /usr/lib/qt/lib/libqt-mt.so.3
#30 0x40e0508b in QApplication::notify(QObject*, QEvent*) ()
   from /usr/lib/qt/lib/libqt-mt.so.3
#31 0x40a66fe9 in KApplication::notify(QObject*, QEvent*) (this=0xfffffe00, 
    receiver=0x849d5a8, event=0xbfffe230) at kapplication.cpp:455
#32 0x40de0828 in QEventLoop::activateSocketNotifiers() ()
   from /usr/lib/qt/lib/libqt-mt.so.3
#33 0x40dbdf37 in QEventLoop::processEvents(unsigned) ()
   from /usr/lib/qt/lib/libqt-mt.so.3
#34 0x40e19766 in QEventLoop::enterLoop() () from 
/usr/lib/qt/lib/libqt-mt.so.3
#35 0x40e05b51 in QApplication::enter_loop() ()
   from /usr/lib/qt/lib/libqt-mt.so.3
#36 0x40fc8c71 in QDialog::exec() () from /usr/lib/qt/lib/libqt-mt.so.3
#37 0x402bb34e in KPrinter::setup(QWidget*, QString const&, bool) ()
   from /opt/kde/lib/libkdeprint.so.4
#38 0x400dbcbb in KHTMLView::print() () from /opt/kde/lib/libkhtml.so.4
#39 0x0815c05d in QPtrList<QWidget>::deleteItem(void*) ()
#40 0x080dde2b in QListView::removeItem(QListViewItem*) ()
#41 0x080d9e30 in QListView::removeItem(QListViewItem*) ()
#42 0x080d4b05 in QListView::removeItem(QListViewItem*) ()
#43 0x080d828f in QListView::removeItem(QListViewItem*) ()
#44 0x40e639f9 in QObject::activate_signal(QConnectionList*, QUObject*) ()
   from /usr/lib/qt/lib/libqt-mt.so.3
#45 0x40e63dbd in QObject::activate_signal_bool(int, bool) ()
   from /usr/lib/qt/lib/libqt-mt.so.3
#46 0x080d4a6b in QListView::removeItem(QListViewItem*) ()
#47 0x080d9e65 in QListView::removeItem(QListViewItem*) ()
#48 0x08090513 in QMemArray<char>::detach() ()
#49 0x40e639f9 in QObject::activate_signal(QConnectionList*, QUObject*) ()
   from /usr/lib/qt/lib/libqt-mt.so.3
#50 0x40e6389d in QObject::activate_signal(int) ()
   from /usr/lib/qt/lib/libqt-mt.so.3
#51 0x408948db in KAction::activated() () from /opt/kde/lib/libkdeui.so.4
#52 0x40885d4f in KAction::slotActivated() () from /opt/kde/lib/libkdeui.so.4
#53 0x40894ae1 in KAction::qt_invoke(int, QUObject*) ()
   from /opt/kde/lib/libkdeui.so.4
#54 0x40e63970 in QObject::activate_signal(QConnectionList*, QUObject*) ()
   from /usr/lib/qt/lib/libqt-mt.so.3
#55 0x40e6389d in QObject::activate_signal(int) ()
   from /usr/lib/qt/lib/libqt-mt.so.3
#56 0x4114906e in QButton::clicked() () from /usr/lib/qt/lib/libqt-mt.so.3
#57 0x40ee5b46 in QButton::mouseReleaseEvent(QMouseEvent*) ()
   from /usr/lib/qt/lib/libqt-mt.so.3
#58 0x40e97ccc in QWidget::event(QEvent*) () from 
/usr/lib/qt/lib/libqt-mt.so.3
#59 0x40e058c4 in QApplication::internalNotify(QObject*, QEvent*) ()
   from /usr/lib/qt/lib/libqt-mt.so.3
#60 0x40e050f3 in QApplication::notify(QObject*, QEvent*) ()
   from /usr/lib/qt/lib/libqt-mt.so.3
#61 0x40a66fe9 in KApplication::notify(QObject*, QEvent*) (this=0xfffffe00, 
    receiver=0x8447160, event=0xbffff2f0) at kapplication.cpp:455
#62 0x40dab72b in QETWidget::translateMouseEvent(_XEvent const*) ()
   from /usr/lib/qt/lib/libqt-mt.so.3
#63 0x40da8feb in QApplication::x11ProcessEvent(_XEvent*) ()
   from /usr/lib/qt/lib/libqt-mt.so.3
#64 0x40dbe261 in QEventLoop::processEvents(unsigned) ()
   from /usr/lib/qt/lib/libqt-mt.so.3
#65 0x40e19766 in QEventLoop::enterLoop() () from 
/usr/lib/qt/lib/libqt-mt.so.3
#66 0x40e19608 in QEventLoop::exec() () from /usr/lib/qt/lib/libqt-mt.so.3
#67 0x40e05af1 in QApplication::exec() () from /usr/lib/qt/lib/libqt-mt.so.3
#68 0x081ce895 in QListBoxItem::setText(QString const&) ()
#69 0x414ebbb4 in __libc_start_main () from /lib/libc.so.6



Comment 11 Thiago Macieira 2003-03-25 13:57:54 UTC
Apparently it hasn't been solved. 
Comment 12 Thiago Macieira 2003-03-25 15:02:07 UTC
Subject: kdelibs/kdecore

CVS commit by thiago: 

Attempting yet another patch for bug #56263. Seeing that I cannot reproduce
it, I'm just trying to fix any holes I can find...

To the bug reporters: please try this patch as well and report if you have
any problems

CCMAIL:56263@bugs.kde.org


  M +6 -3      kextsock.cpp   1.56


--- kdelibs/kdecore/kextsock.cpp  #1.55:1.56
@@ -381,4 +381,7 @@ void KExtendedSocketLookup::freeresults(
 {
   addrinfo *ai = res->data;
+  if (ai == NULL)
+    return;                     // No data? Bizarre, but nonetheless possible
+
   if (ai->ai_canonname)
     free(ai->ai_canonname);
@@ -1504,5 +1507,5 @@ void KExtendedSocket::close()
 void KExtendedSocket::closeNow()
 {
-  if (sockfd == -1 || d->status >= done)
+  if (d->status >= done)
     return;                     // nothing to close
 
@@ -1512,5 +1515,5 @@ void KExtendedSocket::closeNow()
   d->qsnIn = d->qsnOut = NULL;
 
-  if (d->status > connecting)
+  if (d->status > connecting && sockfd == -1)
     {
       ::close(sockfd);


Comment 13 Christophe Prud'Homme 2003-03-25 15:36:42 UTC
Subject: Re: kdelibs/kdecore

[ Tuesday 25 March 2003 03:01 pm ]
| CVS commit by thiago:
|
| Attempting yet another patch for bug #56263. Seeing that I cannot reproduce
| it, I'm just trying to fix any holes I can find...
|
| To the bug reporters: please try this patch as well and report if you have
| any problems

it works for me now
kprinter does not crash anymore :) and works properly

Best regards
thanks a lot
C.
Comment 14 Andris Pavenis 2003-03-25 16:08:56 UTC
Subject: Re:  KPrinter Crashes when using CUPS as Print System

On Tuesday 25 March 2003 16:02, Thiago Macieira wrote:
> Subject: kdelibs/kdecore
>
> CVS commit by thiago:
>
> Attempting yet another patch for bug #56263. Seeing that I cannot reproduce
> it, I'm just trying to fix any holes I can find...
>
> To the bug reporters: please try this patch as well and report if you have
> any problems
>
> CCMAIL:56263@bugs.kde.org
>
>
>   M +6 -3      kextsock.cpp   1.56
>
>
> --- kdelibs/kdecore/kextsock.cpp  #1.55:1.56

Does not help ...

I would recommend following instead. At least it fixed a problem for me and 
CUPS printing worked. Really it crashed on call to dnsIpv6.canonicalName()
according backtrace, but perhaps also first is not needed without IPV6.

Andris

--- kextsock.cpp.orig	2003-01-14 01:49:06.000000000 +0200
+++ kextsock.cpp	2003-03-25 17:02:25.000000000 +0200
@@ -283,8 +283,10 @@ void local_freeaddrinfo(kde_addrinfo *&p
  */
 kde_addrinfo* KExtendedSocketLookup::results()
 {
-  QValueList<QHostAddress> v4 = dnsIpv4.addresses(),
-    v6 = dnsIpv6.addresses();
+  QValueList<QHostAddress> v4 = dnsIpv4.addresses();
+#ifdef AF_INET6
+  QValueList<QHostAddress> v6 = dnsIpv6.addresses();
+#endif    
   addrinfo *p = NULL;
   kde_addrinfo *res = new kde_addrinfo;
   res->origin = KAI_QDNS;
@@ -292,9 +294,10 @@ kde_addrinfo* KExtendedSocketLookup::res
   unsigned short port;
 
   QString canon = dnsIpv4.canonicalName();
+#ifdef AF_INET6
   if (canon.isNull())
     canon = dnsIpv6.canonicalName();
-
+#endif
   char* canonname;
   if (!canon.isNull())
     canonname = strdup(canon.latin1());

Comment 15 Hans Verkuil 2003-03-25 22:03:26 UTC
The change introduced in the 1.50 revision of kmcupsmanager.cpp is certainly the 
culprit. I've done some simple tests that show that it is not working as it should. 
Running kprinter from a shell produces the following error message: 
 
kdecore (KSocket): ERROR: KExtendedSocket::connectionEvent() called but no data 
available! 
 
Adding some debug messages show that neither hostPingSlot nor hostPingFailedSlot are 
ever called. So m_lookupDone is never set to true and the while loop takes the full two 
seconds which explains the delay until the core dump. The currently suggested fixes DO 
solve the crash, but do NOT address the real issue. Even with the fixes it still takes two 
seconds before the Print button in the kprinter dialog is enabled, while this was almost 
immediate in KDE 3.1.0. 
 
I don't know how KExtendedSocket works, but it is clear that it does not work as the 
current code expects. 
 
I hope this helps to really fix this bug. 
Comment 16 Thiago Macieira 2003-03-25 22:24:21 UTC
Agreed. For the moment, we're trying to solve the crash. The 2s delay is another 
matter which will be dealt with later. (which reminds me to repatriate this ticket to the 
correct KDE product) 
 
The culprit is probably QDns, the class used to do asynchronous lookups in Qt. 
Unfortunately, it's somehow not resolving the hostnames properly, leading to empty 
resolution data and, thus, the error message you see. (I'll probably change it into a 
warning). That means that the resolution did finish, but it came up empty. So the 
socket tries to connect, but has no available results. 
 
The problem is that QDns is a big beast that we're trying to get rid of. So, fixing its 
bugs is a no-go. We're instead working hard to provide its future replacement by the 
next version (again, time allowing). That should fix this and many other problems. 
 
To anyone who is affected by the problem, please report if crashes keep on 
happening even after patching. I cannot reproduce the problem, so I don't know if 
it's solved by any patch. 
Comment 17 Osho G 2003-03-26 03:10:15 UTC
I am confused as to which patches I should apply and which one I should not among the different patches 
mentioned in the bug report and the kde-core-devel mailing list discussion (mentioned earlier in the bug 
report). Could someone please tell me which all patches I should currently apply to stock KDE 3.1.1 
sources?  
 
thanks, 
Osho 
Comment 18 Thiago Macieira 2003-03-26 04:57:19 UTC
I should have imagined the number of patches would cause confusion. 
 
Here's the patch to be applied to the sources 
Index: kextsock.cpp 
=================================================================== 
RCS file: /home/kde/kdelibs/kdecore/kextsock.cpp,v 
retrieving revision 1.54 
diff -u -3 -p -r1.54 kextsock.cpp 
--- kextsock.cpp        25 Feb 2003 17:04:46 -0000      1.54 
+++ kextsock.cpp        26 Mar 2003 03:55:35 -0000 
@@ -2,7 +2,7 @@ 
  *  This file is part of the KDE libraries 
  *  Copyright (C) 2000-2002 Thiago Macieira <thiagom@mail.com> 
  * 
- *  $Id: kextsock.cpp,v 1.54 2003/02/25 17:04:46 thiago Exp $ 
+ *  $Id: kextsock.cpp,v 1.56 2003/03/25 14:01:53 thiago Exp $ 
  * 
  *  This library is free software; you can redistribute it and/or 
  *  modify it under the terms of the GNU Library General Public 
@@ -284,8 +284,10 @@ static void local_freeaddrinfo(kde_addri 
  */ 
 kde_addrinfo* KExtendedSocketLookup::results() 
 { 
-  QValueList<QHostAddress> v4 = dnsIpv4.addresses(), 
-    v6 = dnsIpv6.addresses(); 
+  QValueList<QHostAddress> v4 = dnsIpv4.addresses(); 
+#ifdef AF_INET6 
+  QValueList<QHostAddress> v6 = dnsIpv6.addresses(); 
+#endif 
   addrinfo *p = NULL; 
   kde_addrinfo *res = new kde_addrinfo; 
   res->origin = KAI_QDNS; 
@@ -293,9 +295,10 @@ kde_addrinfo* KExtendedSocketLookup::res 
   unsigned short port; 
 
   QString canon = dnsIpv4.canonicalName(); 
+#ifdef AF_INET6 
   if (canon.isNull()) 
     canon = dnsIpv6.canonicalName(); 
- 
+#endif 
   char* canonname; 
   if (!canon.isNull()) 
     canonname = strdup(canon.latin1()); 
@@ -380,6 +383,9 @@ kde_addrinfo* KExtendedSocketLookup::res 
 void KExtendedSocketLookup::freeresults(kde_addrinfo *res) 
 { 
   addrinfo *ai = res->data; 
+  if (ai == NULL) 
+    return;                    // No data? Bizarre, but nonetheless possible 
+ 
   if (ai->ai_canonname) 
     free(ai->ai_canonname); 
   while (ai) 
@@ -1503,18 +1509,25 @@ void KExtendedSocket::close() 
 
 void KExtendedSocket::closeNow() 
 { 
-  if (sockfd == -1 || d->status >= done) 
+  if (d->status >= done) 
     return;                    // nothing to close 
 
-  d->status = done; 
- 
   // close the socket 
   delete d->qsnIn; 
   delete d->qsnOut; 
   d->qsnIn = d->qsnOut = NULL; 
 
-  ::close(sockfd); 
-  sockfd = -1; 
+  if (d->status > connecting && sockfd == -1) 
+    { 
+      ::close(sockfd); 
+      sockfd = -1; 
+    } 
+  else if (d->status == connecting) 
+    cancelAsyncConnect(); 
+  else if (d->status == lookupInProgress) 
+    cancelAsyncLookup(); 
+ 
+  d->status = done; 
 
   emit closed(closedNow | 
         (readBufferSize() != 0 ? availRead : 0) | 
 
Comment 19 Andris Pavenis 2003-03-26 09:29:36 UTC
Subject: Re:  KPrinter Crashes when using CUPS as Print System

On Wednesday 26 March 2003 05:57, Thiago Macieira wrote:

> ------- Additional Comments From thiagom@mail.com  2003-03-26 04:57 -------
> I should have imagined the number of patches would cause confusion.
>
> Here's the patch to be applied to the sources
> Index: kextsock.cpp
> ===================================================================
> RCS file: /home/kde/kdelibs/kdecore/kextsock.cpp,v
> retrieving revision 1.54
> diff -u -3 -p -r1.54 kextsock.cpp
> --- kextsock.cpp        25 Feb 2003 17:04:46 -0000      1.54
> +++ kextsock.cpp        26 Mar 2003 03:55:35 -0000
> @@ -1503,18 +1509,25 @@ void KExtendedSocket::close()
>

.....

>
> -  ::close(sockfd);
> -  sockfd = -1;
> +  if (d->status > connecting && sockfd == -1)
> +    {
> +      ::close(sockfd);
> +      sockfd = -1;
> +    }

Is it really correct (to close socket descriptor and set it to -1 when
it is not opened at all ...)?

Andris

Comment 20 Osho G 2003-03-26 10:47:48 UTC
HI Thiago,  
 
I applied the patch you provided and it did result in no more crashes. However, as earlier mentioned, 
there is two seconds delay before the Print button is enabled. It does seem very strange and annoying at 
times.  
 
thanks for all efforts to get this issue resolved, 
Osho 
Comment 21 Thiago Macieira 2003-03-26 14:23:38 UTC
The logic is inverted in my patch. It should be sockfd != -1, instead of ==. I'll fix that 
in CVS. 
 
As for the two-second delay, I think I've finally seen the effects of the changes to 
KDE print, because my Print button a bit of time (less than a second, though) to 
become enabled. But subsequent operations had it enabled immediately or faster 
than I can see, so I believe that this delay is caused by the hostname lookup. 
 
Unfortunately, there's no fixing that in our code. You could probably try and 
workaround it  by inverting some entries in /etc/hosts; see if that helps. 
 
KDE 3.2 should be rid of this problem due to the new code we're writing. 
 
If no one else reports crashes by tonight, I'll close the bug report. Thanks to 
everyone for helping so much (especially thanks for a backtrace with debugging 
enabled! You have no idea how much that helped). 
Comment 22 Thiago Macieira 2003-03-28 18:06:52 UTC
*** Bug 56392 has been marked as a duplicate of this bug. ***
Comment 23 Thiago Macieira 2003-03-30 15:25:24 UTC
*** Bug 56616 has been marked as a duplicate of this bug. ***
Comment 24 Rod Sheaff 2003-03-30 20:04:44 UTC
Same problem. I have broadband connection running continuously. I use SuSE 8.1. 
Here is my debug output:  
 
DEBUG OUTPUT ---> 
 
(no debugging symbols found)...(no debugging symbols found)... 
(no debugging symbols found)...(no debugging symbols found)...[New Thread 1024 
(LWP 2326)] 
 
(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)...0x415728c9 in wait4 () from /lib/libc.so.6 
#0  0x415728c9 in wait4 () from /lib/libc.so.6 
#1  0x415edc90 in __DTOR_END__ () from /lib/libc.so.6 
#2  0x413cda93 in waitpid () from /lib/libpthread.so.0 
#3  0x40aeff0d in KCrash::defaultCrashHandler(int) () 
   from /opt/kde3/lib/libkdecore.so.4 
#4  0x413cb12b in pthread_sighandler () from /lib/libpthread.so.0 
#5  <signal handler called> 
#6  0x40b1f439 in KExtendedSocketLookup::freeresults(kde_addrinfo*) () 
   from /opt/kde3/lib/libkdecore.so.4 
#7  0x40b1ef48 in local_freeaddrinfo(kde_addrinfo*&) () 
   from /opt/kde3/lib/libkdecore.so.4 
#8  0x40b1fac9 in KExtendedSocket::~KExtendedSocket() () 
   from /opt/kde3/lib/libkdecore.so.4 
#9  0x420b347f in KMCupsManager::completePrinterShort(KMPrinter*) () 
   from /opt/kde3/lib/kde3/kdeprint_cups.so 
#10 0x402cf3f4 in KPrintDialog::slotPrinterSelected(int) () 
   from /opt/kde3/lib/libkdeprint.so.4 
#11 0x402cea27 in KPrintDialog::initialize(KPrinter*) () 
   from /opt/kde3/lib/libkdeprint.so.4 
#12 0x402d132d in KPrintDialog::slotUpdatePossible(bool) () 
   from /opt/kde3/lib/libkdeprint.so.4 
#13 0x402d1b04 in KPrintDialog::qt_invoke(int, QUObject*) () 
   from /opt/kde3/lib/libkdeprint.so.4 
#14 0x40e5def9 in QObject::activate_signal(QConnectionList*, QUObject*) () 
   from /usr/lib/libqt-mt.so.3 
#15 0x40e5e2bd in QObject::activate_signal_bool(int, bool) () 
   from /usr/lib/libqt-mt.so.3 
#16 0x402b7a7a in KMManager::updatePossible(bool) () 
   from /opt/kde3/lib/libkdeprint.so.4 
#17 0x402b78ce in KMManager::setUpdatePossible(bool) () 
   from /opt/kde3/lib/libkdeprint.so.4 
#18 0x420b91b7 in KMCupsManager::slotConnectionSuccess() () 
   from /opt/kde3/lib/kde3/kdeprint_cups.so 
#19 0x420b9d18 in KMCupsManager::qt_invoke(int, QUObject*) () 
   from /opt/kde3/lib/kde3/kdeprint_cups.so 
#20 0x40e5def9 in QObject::activate_signal(QConnectionList*, QUObject*) () 
   from /usr/lib/libqt-mt.so.3 
#21 0x40e5dd97 in QObject::activate_signal(int) () from /usr/lib/libqt-mt.so.3 
#22 0x4116d44c in QSocket::connected() () from /usr/lib/libqt-mt.so.3 
#23 0x41030fac in QSocket::tryConnection() () from /usr/lib/libqt-mt.so.3 
#24 0x41030f1c in QSocket::sn_write() () from /usr/lib/libqt-mt.so.3 
#25 0x4116d62b in QSocket::qt_invoke(int, QUObject*) () 
   from /usr/lib/libqt-mt.so.3 
#26 0x40e5def9 in QObject::activate_signal(QConnectionList*, QUObject*) () 
   from /usr/lib/libqt-mt.so.3 
#27 0x40e5dfd5 in QObject::activate_signal(int, int) () 
   from /usr/lib/libqt-mt.so.3 
#28 0x4113fee2 in QSocketNotifier::activated(int) () 
   from /usr/lib/libqt-mt.so.3 
#29 0x40e7a740 in QSocketNotifier::event(QEvent*) () 
   from /usr/lib/libqt-mt.so.3 
#30 0x40dffd94 in QApplication::internalNotify(QObject*, QEvent*) () 
   from /usr/lib/libqt-mt.so.3 
#31 0x40dff31c in QApplication::notify(QObject*, QEvent*) () 
   from /usr/lib/libqt-mt.so.3 
#32 0x40a81f09 in KApplication::notify(QObject*, QEvent*) () 
   from /opt/kde3/lib/libkdecore.so.4 
#33 0x40dd8d08 in QEventLoop::activateSocketNotifiers() () 
   from /usr/lib/libqt-mt.so.3 
#34 0x40db62f3 in QEventLoop::processEvents(unsigned) () 
   from /usr/lib/libqt-mt.so.3 
#35 0x40e13b06 in QEventLoop::enterLoop() () from /usr/lib/libqt-mt.so.3 
#36 0x40e00021 in QApplication::enter_loop() () from /usr/lib/libqt-mt.so.3 
#37 0x40fc3c61 in QDialog::exec() () from /usr/lib/libqt-mt.so.3 
#38 0x402d2a5e in KPrinter::setup(QWidget*, QString const&, bool) () 
   from /opt/kde3/lib/libkdeprint.so.4 
#39 0x400e424b in KHTMLView::print() () from /opt/kde3/lib/libkhtml.so.4 
#40 0x0814bc1d in QComboBox::setAutoCompletion(bool) () 
#41 0x080d802b in QComboBox::setAutoCompletion(bool) () 
#42 0x080d4040 in QComboBox::setAutoCompletion(bool) () 
#43 0x080ced15 in QComboBox::setAutoCompletion(bool) () 
#44 0x080d249f in QComboBox::setAutoCompletion(bool) () 
#45 0x40e5def9 in QObject::activate_signal(QConnectionList*, QUObject*) () 
   from /usr/lib/libqt-mt.so.3 
#46 0x40e5e2bd in QObject::activate_signal_bool(int, bool) () 
   from /usr/lib/libqt-mt.so.3 
#47 0x080cec7b in QComboBox::setAutoCompletion(bool) () 
#48 0x080d4075 in QComboBox::setAutoCompletion(bool) () 
#49 0x0808ef56 in QComboBox::setAutoCompletion(bool) () 
#50 0x40e5def9 in QObject::activate_signal(QConnectionList*, QUObject*) () 
   from /usr/lib/libqt-mt.so.3 
#51 0x40e5dd97 in QObject::activate_signal(int) () from /usr/lib/libqt-mt.so.3 
#52 0x408b1beb in KAction::activated() () from /opt/kde3/lib/libkdeui.so.4 
#53 0x408a305f in KAction::slotActivated() () from /opt/kde3/lib/libkdeui.so.4 
#54 0x408b1de2 in KAction::qt_invoke(int, QUObject*) () 
   from /opt/kde3/lib/libkdeui.so.4 
#55 0x40e5de70 in QObject::activate_signal(QConnectionList*, QUObject*) () 
   from /usr/lib/libqt-mt.so.3 
#56 0x40e5dd97 in QObject::activate_signal(int) () from /usr/lib/libqt-mt.so.3 
#57 0x4114566e in QButton::clicked() () from /usr/lib/libqt-mt.so.3 
#58 0x40ee0a26 in QButton::mouseReleaseEvent(QMouseEvent*) () 
   from /usr/lib/libqt-mt.so.3 
#59 0x40e923dc in QWidget::event(QEvent*) () from /usr/lib/libqt-mt.so.3 
#60 0x40dffd94 in QApplication::internalNotify(QObject*, QEvent*) () 
   from /usr/lib/libqt-mt.so.3 
#61 0x40dff383 in QApplication::notify(QObject*, QEvent*) () 
   from /usr/lib/libqt-mt.so.3 
#62 0x40a81f09 in KApplication::notify(QObject*, QEvent*) () 
   from /opt/kde3/lib/libkdecore.so.4 
#63 0x40da3636 in QETWidget::translateMouseEvent(_XEvent const*) () 
   from /usr/lib/libqt-mt.so.3 
#64 0x40da0f33 in QApplication::x11ProcessEvent(_XEvent*) () 
   from /usr/lib/libqt-mt.so.3 
#65 0x40db6621 in QEventLoop::processEvents(unsigned) () 
   from /usr/lib/libqt-mt.so.3 
#66 0x40e13b06 in QEventLoop::enterLoop() () from /usr/lib/libqt-mt.so.3 
#67 0x40e139a8 in QEventLoop::exec() () from /usr/lib/libqt-mt.so.3 
#68 0x40dfffc1 in QApplication::exec() () from /usr/lib/libqt-mt.so.3 
#69 0x081b52ac in QComboBox::setAutoCompletion(bool) () 
#70 0x414ed4a2 in __libc_start_main () from /lib/libc.so.6 
 
<--- DEBUG OUTPUT 
 
Rod S.  
Comment 25 Thiago Macieira 2003-03-31 01:51:57 UTC
*** Bug has been marked as fixed ***.
Comment 26 Thiago Macieira 2003-03-31 14:31:11 UTC
*** Bug 56655 has been marked as a duplicate of this bug. ***
Comment 27 Michael Goffioul 2003-04-02 14:34:02 UTC
*** Bug 56746 has been marked as a duplicate of this bug. ***
Comment 28 Thiago Macieira 2003-04-02 15:19:51 UTC
Apparently the CCMAIL I sent from CVS with the patch did not get through. You can 
find the patch here: 
 
For KDE 3.1.1 
http://webcvs.kde.org/cgi-bin/cvsweb.cgi/kdelibs/kdecore/kextsock.cpp.diff?r1=1.44.2.4&r2=1.44.2.5 
 
If you're using KDE CVS, make sure you've got the latest checkout for kextsock 
(revision 1.57 or higher). 
 
Comment 29 Thiago Macieira 2003-04-03 12:57:37 UTC
*** Bug 56773 has been marked as a duplicate of this bug. ***
Comment 30 Michael Goffioul 2003-04-07 13:35:32 UTC
*** Bug 56820 has been marked as a duplicate of this bug. ***
Comment 31 Stephan Kulow 2003-04-24 10:43:15 UTC
*** Bug 57606 has been marked as a duplicate of this bug. ***
Comment 32 Stephan Kulow 2003-04-24 12:56:44 UTC
*** Bug 57636 has been marked as a duplicate of this bug. ***
Comment 33 Stephan Kulow 2003-05-03 16:03:00 UTC
*** Bug 58012 has been marked as a duplicate of this bug. ***
Comment 34 Michael Goffioul 2003-05-05 13:09:00 UTC
*** Bug 58133 has been marked as a duplicate of this bug. ***
Comment 35 Maksim Orlovich 2003-05-08 22:18:32 UTC
*** Bug 58252 has been marked as a duplicate of this bug. ***
Comment 36 Michael Goffioul 2003-05-14 13:28:51 UTC
*** Bug 58109 has been marked as a duplicate of this bug. ***
Comment 37 Stephan Kulow 2003-05-25 15:18:59 UTC
*** Bug 58924 has been marked as a duplicate of this bug. ***
Comment 38 Thiago Macieira 2003-07-30 17:25:08 UTC
*** Bug 61861 has been marked as a duplicate of this bug. ***
Comment 39 Thiago Macieira 2003-08-10 15:34:02 UTC
*** Bug 62453 has been marked as a duplicate of this bug. ***
Comment 40 Maksim Orlovich 2003-09-09 15:40:07 UTC
*** Bug 63954 has been marked as a duplicate of this bug. ***
Comment 41 Maksim Orlovich 2003-10-15 18:10:29 UTC
*** Bug 66068 has been marked as a duplicate of this bug. ***