Control: tags 926408 + upstream patch
Control: tags 926408 - moreinfo unreproducible


Dear Maintainer, Hello Gudjon,
I forgot to mention that this little "save" button should be on the
developers information tab of DrKonqi. Then you should not need to
do something in gdb manually.

However, I overlooked initially the subject of your submitting email
completely - so I was now able to reproduce.

In KDiff3App::scrollDiffTextWindow is m_pDiffVScrollBar unconditionally
accessed when it currently contains a null pointer.

Attached patch simply avoids that and does not crash anymore.

Could not find an upstream issue about this.

Kind regards,
Bernhard


Thread 1 (Thread 0x7f50273cd800 (LWP 18204)):
[KCrash Handler]
#6  QAbstractSlider::value (this=this@entry=0x0) at 
widgets/qabstractslider.cpp:526
#7  0x00005649e94cba8a in KDiff3App::scrollDiffTextWindow (this=0x5649e9fe1920, 
deltaX=0, deltaY=-810) at ./src/pdiff.cpp:490
#8  0x00007f502c001588 in QWidget::event (this=0x5649e9fe1920, 
event=0x7ffe9592cdc0) at kernel/qwidget.cpp:8925
#9  0x00007f502bfc34b1 in QApplicationPrivate::notify_helper 
(this=this@entry=0x5649e9b0e040, receiver=receiver@entry=0x5649e9fe1920, 
e=e@entry=0x7ffe9592cdc0) at kernel/qapplication.cpp:3726
#10 0x00007f502bfcc69f in QApplication::notify (this=<optimized out>, 
receiver=0x5649e9daf590, e=0x7ffe9592d2d0) at kernel/qapplication.cpp:3294
#11 0x00007f502b6485a9 in QCoreApplication::notifyInternal2 
(receiver=0x5649e9daf590, event=0x7ffe9592d2d0) at 
../../include/QtCore/5.11.3/QtCore/private/../../../../../src/corelib/thread/qthread_p.h:307
#12 0x00007f502c001588 in QWidget::event (this=this@entry=0x5649e9d0ada0, 
event=event@entry=0x7ffe9592d2d0) at kernel/qwidget.cpp:8925
#13 0x00007f502c0a4d1e in QFrame::event (this=0x5649e9d0ada0, e=0x7ffe9592d2d0) 
at widgets/qframe.cpp:550
#14 0x00007f502c2161bb in QAbstractItemView::viewportEvent 
(this=this@entry=0x5649e9d0ada0, event=event@entry=0x7ffe9592d2d0) at 
itemviews/qabstractitemview.cpp:1750
#15 0x00007f502c27e40b in QTreeView::viewportEvent (this=0x5649e9d0ada0, 
event=0x7ffe9592d2d0) at itemviews/qtreeview.cpp:1326
#16 0x00007f502b6482bb in 
QCoreApplicationPrivate::sendThroughObjectEventFilters (event=<optimized out>, 
receiver=<optimized out>) at kernel/qcoreapplication.cpp:1173
#17 QCoreApplicationPrivate::sendThroughObjectEventFilters 
(receiver=receiver@entry=0x5649e9bdc320, event=event@entry=0x7ffe9592d2d0) at 
kernel/qcoreapplication.cpp:1162
#18 0x00007f502bfc34a1 in QApplicationPrivate::notify_helper 
(this=this@entry=0x5649e9b0e040, receiver=receiver@entry=0x5649e9bdc320, 
e=e@entry=0x7ffe9592d2d0) at kernel/qapplication.cpp:3722
#19 0x00007f502bfcc69f in QApplication::notify (this=<optimized out>, 
receiver=0x5649e9bdc320, e=0x7ffe9592d450) at kernel/qapplication.cpp:3294
#20 0x00007f502b6485a9 in QCoreApplication::notifyInternal2 
(receiver=0x5649e9bdc320, event=0x7ffe9592d450) at 
../../include/QtCore/5.11.3/QtCore/private/../../../../../src/corelib/thread/qthread_p.h:307
#21 0x00007f502c01d56c in QWidgetWindow::handleWheelEvent 
(this=this@entry=0x5649e9b53200, event=event@entry=0x7ffe9592d7a0) at 
kernel/qwidgetwindow.cpp:844
#22 0x00007f502c01ebf3 in QWidgetWindow::event (event=0x7ffe9592d7a0, 
this=0x5649e9b53200) at kernel/qwidgetwindow.cpp:308
#23 QWidgetWindow::event (this=0x5649e9b53200, event=0x7ffe9592d7a0) at 
kernel/qwidgetwindow.cpp:224
#24 0x00007f502bfc34b1 in QApplicationPrivate::notify_helper 
(this=this@entry=0x5649e9b0e040, receiver=receiver@entry=0x5649e9b53200, 
e=e@entry=0x7ffe9592d7a0) at kernel/qapplication.cpp:3726
#25 0x00007f502bfca950 in QApplication::notify (this=0x7ffe9592dad0, 
receiver=0x5649e9b53200, e=0x7ffe9592d7a0) at kernel/qapplication.cpp:3485
#26 0x00007f502b6485a9 in QCoreApplication::notifyInternal2 
(receiver=receiver@entry=0x5649e9b53200, event=event@entry=0x7ffe9592d7a0) at 
../../include/QtCore/5.11.3/QtCore/private/../../../../../src/corelib/thread/qthread_p.h:307
#27 0x00007f502b9f031c in QCoreApplication::sendSpontaneousEvent 
(event=0x7ffe9592d7a0, receiver=0x5649e9b53200) at 
../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:237
#28 QGuiApplicationPrivate::processWheelEvent (e=0x7f5020007500) at 
kernel/qguiapplication.cpp:2160
#29 0x00007f502b9f5e15 in QGuiApplicationPrivate::processWindowSystemEvent 
(e=e@entry=0x7f5020007500) at kernel/qguiapplication.cpp:1820
#30 0x00007f502b9d006b in QWindowSystemInterface::sendWindowSystemEvents 
(flags=...) at kernel/qwindowsysteminterface.cpp:1032
#31 0x00007f50270303eb in QPAEventDispatcherGlib::processEvents 
(this=0x5649e9b51e40, flags=...) at qeventdispatcher_glib.cpp:70
#32 0x00007f502b64727b in QEventLoop::exec (this=this@entry=0x7ffe9592d980, 
flags=..., flags@entry=...) at 
../../include/QtCore/../../src/corelib/global/qflags.h:140
#33 0x00007f502b64f262 in QCoreApplication::exec () at 
../../include/QtCore/../../src/corelib/global/qflags.h:120
#34 0x00005649e94a5932 in main (argc=<optimized out>, argv=<optimized out>) at 
./src/main.cpp:177
[Inferior 1 (process 18204) detached]


benutzer@debian:~$ cat -n 
/home/benutzer/source/kdiff3/orig/kdiff3-1.7.90/src/pdiff.cpp | grep -E "^   
490" -C6
   484  }
   485
   486  void KDiff3App::scrollDiffTextWindow(int deltaX, int deltaY)
   487  {
   488      if(deltaY != 0)
   489      {
   490          m_pDiffVScrollBar->setValue(m_pDiffVScrollBar->value() + 
deltaY);
   491          m_pOverview->setRange(m_pDiffVScrollBar->value(), 
m_pDiffVScrollBar->pageStep());
   492      }
   493      if(deltaX != 0)
   494          m_pHScrollBar->QScrollBar::setValue(m_pHScrollBar->value() + 
deltaX);
   495  }
   496
From 452cce13b85ac79bb26b08a38cb91965357a70b4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bernhard=20=C3=9Cbelacker?= <bernha...@mailbox.org>
Date: Sun, 7 Apr 2019 23:45:04 +0200
Subject: Avoid crash in KDiff3App::scrollDiffTextWindow

https://bugs.debian.org/926408
---
 src/pdiff.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/pdiff.cpp b/src/pdiff.cpp
index d5bc326..50cfe54 100644
--- a/src/pdiff.cpp
+++ b/src/pdiff.cpp
@@ -485,12 +485,12 @@ void KDiff3App::resizeMergeResultWindow()
 
 void KDiff3App::scrollDiffTextWindow(int deltaX, int deltaY)
 {
-    if(deltaY != 0)
+    if(deltaY != 0 && m_pDiffVScrollBar)
     {
         m_pDiffVScrollBar->setValue(m_pDiffVScrollBar->value() + deltaY);
         m_pOverview->setRange(m_pDiffVScrollBar->value(), m_pDiffVScrollBar->pageStep());
     }
-    if(deltaX != 0)
+    if(deltaX != 0 && m_pHScrollBar)
         m_pHScrollBar->QScrollBar::setValue(m_pHScrollBar->value() + deltaX);
 }
 
-- 
2.20.1

# Buster amd64 qemu VM 2019-04-07


apt update
apt dist-upgrade


apt install dpkg-dev devscripts mc systemd-coredump xserver-xorg dbus-x11 sddm 
plasma-desktop kdiff3 kdiff3-dbgsym libc6-dbg libqt5core5a-dbgsym 
libqt5gui5-dbgsym libqt5widgets5-dbgsym
apt build-dep kdiff3


systemctl start sddm


#########


mkdir dir1 dir2
zcat /usr/share/doc/kdiff3/changelog.gz > dir1/changelog.txt
zcat /usr/share/doc/kdiff3/changelog.gz > dir2/changelog.txt
echo test >> dir2/changelog.txt 

export DISPLAY=:0
kdiff3 dir1 dir2

# use the mouse wheel -> crash


#########


mkdir /home/benutzer/source/kdiff3/orig -p
cd    /home/benutzer/source/kdiff3/orig
apt source kdiff3
cd


#########



Thread 1 (Thread 0x7f50273cd800 (LWP 18204)):
[KCrash Handler]
#6  0x00007f502c0acbd0 in QAbstractSlider::value() const () from 
/usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#7  0x00005649e94cba8a in ?? ()
#8  0x00007f502c001588 in QWidget::event(QEvent*) () from 
/usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#9  0x00007f502bfc34b1 in QApplicationPrivate::notify_helper(QObject*, QEvent*) 
() from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#10 0x00007f502bfcc69f in QApplication::notify(QObject*, QEvent*) () from 
/usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#11 0x00007f502b6485a9 in QCoreApplication::notifyInternal2(QObject*, QEvent*) 
() from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#12 0x00007f502c001588 in QWidget::event(QEvent*) () from 
/usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#13 0x00007f502c0a4d1e in QFrame::event(QEvent*) () from 
/usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#14 0x00007f502c2161bb in QAbstractItemView::viewportEvent(QEvent*) () from 
/usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#15 0x00007f502c27e40b in QTreeView::viewportEvent(QEvent*) () from 
/usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#16 0x00007f502b6482bb in 
QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject*, QEvent*) () 
from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#17 0x00007f502bfc34a1 in QApplicationPrivate::notify_helper(QObject*, QEvent*) 
() from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#18 0x00007f502bfcc69f in QApplication::notify(QObject*, QEvent*) () from 
/usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#19 0x00007f502b6485a9 in QCoreApplication::notifyInternal2(QObject*, QEvent*) 
() from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#20 0x00007f502c01d56c in ?? () from 
/usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#21 0x00007f502c01ebf3 in ?? () from 
/usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#22 0x00007f502bfc34b1 in QApplicationPrivate::notify_helper(QObject*, QEvent*) 
() from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#23 0x00007f502bfca950 in QApplication::notify(QObject*, QEvent*) () from 
/usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#24 0x00007f502b6485a9 in QCoreApplication::notifyInternal2(QObject*, QEvent*) 
() from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#25 0x00007f502b9f031c in 
QGuiApplicationPrivate::processWheelEvent(QWindowSystemInterfacePrivate::WheelEvent*)
 () from /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
#26 0x00007f502b9f5e15 in 
QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*)
 () from /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
#27 0x00007f502b9d006b in 
QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>)
 () from /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
#28 0x00007f50270303eb in ?? () from /usr/lib/x86_64-linux-gnu/libQt5XcbQpa.so.5
#29 0x00007f502b64727b in 
QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from 
/usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#30 0x00007f502b64f262 in QCoreApplication::exec() () from 
/usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#31 0x00005649e94a5932 in ?? ()
#32 0x00007f502af3a09b in __libc_start_main () from 
/lib/x86_64-linux-gnu/libc.so.6
#33 0x00005649e94a5d3a in _start ()
[Inferior 1 (process 18204) detached]




Thread 1 (Thread 0x7f50273cd800 (LWP 18204)):
[KCrash Handler]
#6  QAbstractSlider::value (this=this@entry=0x0) at 
widgets/qabstractslider.cpp:526
#7  0x00005649e94cba8a in KDiff3App::scrollDiffTextWindow (this=0x5649e9fe1920, 
deltaX=0, deltaY=-810) at ./src/pdiff.cpp:490
#8  0x00007f502c001588 in QWidget::event (this=0x5649e9fe1920, 
event=0x7ffe9592cdc0) at kernel/qwidget.cpp:8925
#9  0x00007f502bfc34b1 in QApplicationPrivate::notify_helper 
(this=this@entry=0x5649e9b0e040, receiver=receiver@entry=0x5649e9fe1920, 
e=e@entry=0x7ffe9592cdc0) at kernel/qapplication.cpp:3726
#10 0x00007f502bfcc69f in QApplication::notify (this=<optimized out>, 
receiver=0x5649e9daf590, e=0x7ffe9592d2d0) at kernel/qapplication.cpp:3294
#11 0x00007f502b6485a9 in QCoreApplication::notifyInternal2 
(receiver=0x5649e9daf590, event=0x7ffe9592d2d0) at 
../../include/QtCore/5.11.3/QtCore/private/../../../../../src/corelib/thread/qthread_p.h:307
#12 0x00007f502c001588 in QWidget::event (this=this@entry=0x5649e9d0ada0, 
event=event@entry=0x7ffe9592d2d0) at kernel/qwidget.cpp:8925
#13 0x00007f502c0a4d1e in QFrame::event (this=0x5649e9d0ada0, e=0x7ffe9592d2d0) 
at widgets/qframe.cpp:550
#14 0x00007f502c2161bb in QAbstractItemView::viewportEvent 
(this=this@entry=0x5649e9d0ada0, event=event@entry=0x7ffe9592d2d0) at 
itemviews/qabstractitemview.cpp:1750
#15 0x00007f502c27e40b in QTreeView::viewportEvent (this=0x5649e9d0ada0, 
event=0x7ffe9592d2d0) at itemviews/qtreeview.cpp:1326
#16 0x00007f502b6482bb in 
QCoreApplicationPrivate::sendThroughObjectEventFilters (event=<optimized out>, 
receiver=<optimized out>) at kernel/qcoreapplication.cpp:1173
#17 QCoreApplicationPrivate::sendThroughObjectEventFilters 
(receiver=receiver@entry=0x5649e9bdc320, event=event@entry=0x7ffe9592d2d0) at 
kernel/qcoreapplication.cpp:1162
#18 0x00007f502bfc34a1 in QApplicationPrivate::notify_helper 
(this=this@entry=0x5649e9b0e040, receiver=receiver@entry=0x5649e9bdc320, 
e=e@entry=0x7ffe9592d2d0) at kernel/qapplication.cpp:3722
#19 0x00007f502bfcc69f in QApplication::notify (this=<optimized out>, 
receiver=0x5649e9bdc320, e=0x7ffe9592d450) at kernel/qapplication.cpp:3294
#20 0x00007f502b6485a9 in QCoreApplication::notifyInternal2 
(receiver=0x5649e9bdc320, event=0x7ffe9592d450) at 
../../include/QtCore/5.11.3/QtCore/private/../../../../../src/corelib/thread/qthread_p.h:307
#21 0x00007f502c01d56c in QWidgetWindow::handleWheelEvent 
(this=this@entry=0x5649e9b53200, event=event@entry=0x7ffe9592d7a0) at 
kernel/qwidgetwindow.cpp:844
#22 0x00007f502c01ebf3 in QWidgetWindow::event (event=0x7ffe9592d7a0, 
this=0x5649e9b53200) at kernel/qwidgetwindow.cpp:308
#23 QWidgetWindow::event (this=0x5649e9b53200, event=0x7ffe9592d7a0) at 
kernel/qwidgetwindow.cpp:224
#24 0x00007f502bfc34b1 in QApplicationPrivate::notify_helper 
(this=this@entry=0x5649e9b0e040, receiver=receiver@entry=0x5649e9b53200, 
e=e@entry=0x7ffe9592d7a0) at kernel/qapplication.cpp:3726
#25 0x00007f502bfca950 in QApplication::notify (this=0x7ffe9592dad0, 
receiver=0x5649e9b53200, e=0x7ffe9592d7a0) at kernel/qapplication.cpp:3485
#26 0x00007f502b6485a9 in QCoreApplication::notifyInternal2 
(receiver=receiver@entry=0x5649e9b53200, event=event@entry=0x7ffe9592d7a0) at 
../../include/QtCore/5.11.3/QtCore/private/../../../../../src/corelib/thread/qthread_p.h:307
#27 0x00007f502b9f031c in QCoreApplication::sendSpontaneousEvent 
(event=0x7ffe9592d7a0, receiver=0x5649e9b53200) at 
../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:237
#28 QGuiApplicationPrivate::processWheelEvent (e=0x7f5020007500) at 
kernel/qguiapplication.cpp:2160
#29 0x00007f502b9f5e15 in QGuiApplicationPrivate::processWindowSystemEvent 
(e=e@entry=0x7f5020007500) at kernel/qguiapplication.cpp:1820
#30 0x00007f502b9d006b in QWindowSystemInterface::sendWindowSystemEvents 
(flags=...) at kernel/qwindowsysteminterface.cpp:1032
#31 0x00007f50270303eb in QPAEventDispatcherGlib::processEvents 
(this=0x5649e9b51e40, flags=...) at qeventdispatcher_glib.cpp:70
#32 0x00007f502b64727b in QEventLoop::exec (this=this@entry=0x7ffe9592d980, 
flags=..., flags@entry=...) at 
../../include/QtCore/../../src/corelib/global/qflags.h:140
#33 0x00007f502b64f262 in QCoreApplication::exec () at 
../../include/QtCore/../../src/corelib/global/qflags.h:120
#34 0x00005649e94a5932 in main (argc=<optimized out>, argv=<optimized out>) at 
./src/main.cpp:177
[Inferior 1 (process 18204) detached]




benutzer@debian:~$ cat -n 
/home/benutzer/source/kdiff3/orig/kdiff3-1.7.90/src/pdiff.cpp | grep -E "^   
490" -C6
   484  }
   485
   486  void KDiff3App::scrollDiffTextWindow(int deltaX, int deltaY)
   487  {
   488      if(deltaY != 0)
   489      {
   490          m_pDiffVScrollBar->setValue(m_pDiffVScrollBar->value() + 
deltaY);
   491          m_pOverview->setRange(m_pDiffVScrollBar->value(), 
m_pDiffVScrollBar->pageStep());
   492      }
   493      if(deltaX != 0)
   494          m_pHScrollBar->QScrollBar::setValue(m_pHScrollBar->value() + 
deltaX);
   495  }
   496



############



gdb -q --args /usr/bin/kdiff3 dir1 dir2

set width 0
set pagination off
directory /home/benutzer/source/kdiff3/orig/kdiff3-1.7.90
b kdiff3.cpp:138
b KDiff3App::initView
b KDiff3App::mainInit
b KDiff3App::completeInit
run
cont



###########


cd /home/benutzer/source/kdiff3
cp orig try1 -a
cd try1/kdiff3-1.7.90
git init
git add .
git config user.name "..."
git config user.email "..."
git commit -m "Initial commit."
# modify
git commit

dpkg-buildpackage -b



Reply via email to