[Bug 788141] Re: Okular crashes at opening of print dialog

Harald Sitter apachelogger at ubuntu.com
Wed May 25 16:13:41 UTC 2011


Indeed... Please check that libqtgui4 is actually on 4.7.2

The function in question:

> const cups_option_t* QCUPSSupport::printerOption(const QString &key) const
> {
>     for (int i = 0; i < printers[currPrinterIndex].num_options; ++i) {
>         if (QLatin1String(printers[currPrinterIndex].options[i].name) == key)
>             return &printers[currPrinterIndex].options[i];
>     }
>     return 0;
> }

Crash happens in first line.

Both variables there are members of qcups:
>     cups_dest_t *printers;
>     int currPrinterIndex;

Both initialized to 0:
>     printers(0),
>     currPrinterIndex(0),

Printers apparently is only set once (in the ctor of qcups).

The _q_printerChanged slot essentially adds this on top:
>         cups->setCurrentPrinter(index);
>         const cups_option_t *opt = cups->printerOption(QString::fromLatin1("printer-location"));

So, from the bt we know that the index there is sane (0), leaving us with the following causes:
a) printers points to invalid mem (which should not be the case as cups internally sets this, unless of course something went horribly wrong in cups)
b) printer points to an array of nil size

So all together the issue is rather weird as I suppose if there is no printer the printerChanged slot ought not be called:
>     QObject::connect(widget.printers, SIGNAL(currentIndexChanged(int)),
>                      parent, SLOT(_q_printerChanged(int)));
i.e. if there is no printer the printer widget (or rather the dropdown with printers) should be disabled an thus not emit the signal. This means that no matter what, something is not quite right about this whole thing in both cases from above there should be no printers reported, so the widget.printers should be disabled. Very odd.

I suppose something that could help in addition to known whether
libqtgui4 is actually up-to-date is whether you actually have any
printers installed? If you have, that would suggest a bug in CUPS itself
(wrongly assigning the pointer address or somesuch).

** Package changed: kdegraphics (Ubuntu) => qt4-x11 (Ubuntu)

** Changed in: qt4-x11 (Ubuntu)
       Status: New => Incomplete

-- 
You received this bug notification because you are a member of Kubuntu
Bugs, which is subscribed to qt4-x11 in Ubuntu.
https://bugs.launchpad.net/bugs/788141

Title:
  Okular crashes at opening of print dialog




More information about the kubuntu-bugs mailing list