Wireshark-bugs: [Wireshark-bugs] [Bug 12580] (Qt5) after obtaining a packet trace, crashes when

Date: Sat, 02 Jul 2016 22:38:57 +0000

Comment # 1 on bug 12580 from
To investigate further, I built the same Wireshark 2.0.4 source (as obtained
via Homebrew) locally with Qt 5, and added some debugging prints.

What's happening is:

* PacketList::freeze() is calling QTreeView::setModel(NULL)
* this results in PacketList::selectionChanged() being called with an empty
`selected` parameter
* the first thing PacketList::selectionChanged() does is call
QTreeView::selectionChanged(selected, deselected) with those same parameters
* it then crashes in the guts of Qt

Specifically, PacketList::selectionChanged() is being called with an empty
`selected` (size 0), and a `deselected` of size 1 (and the one item is valid).

I'm no Qt programmer, but looks like it's wrong to call
QTreeView::selectionChanged with an empty `selected` parameter. (No idea why
this crash doesn't happen in Qt 4)

According to http://doc.qt.io/qt-5/qabstractitemview.html#selectionChanged ...

  "void QAbstractItemView::selectionChanged(const QItemSelection &selected,
const QItemSelection &deselected)
   This slot is called when the selection is changed. The previous selection
(which may be empty), is specified by deselected, and the new selection by
selected."

Looks like `deselected` is permitted to be empty, implying that `selected` must
not be. (The Qt 4 documentation is identical.)


You are receiving this mail because:
  • You are watching all bug changes.