Bug 404848 - Crash on "Enter Next Transcation"
Summary: Crash on "Enter Next Transcation"
Status: RESOLVED FIXED
Alias: None
Product: kmymoney
Classification: Applications
Component: exporter (show other bugs)
Version: unspecified
Platform: Microsoft Windows Microsoft Windows
: NOR major
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-02-26 17:12 UTC by Robert Blackwell
Modified: 2019-03-06 12:16 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 5.0.4


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Blackwell 2019-02-26 17:12:48 UTC
SUMMARY


STEPS TO REPRODUCE
1. Open Scheduled Transaction Account
2. Select Transaction
3. Use Right Mouse Window to select "Enter Next Transaction"
4. Click on "Enter Next Transaction"

OBSERVED RESULT
System pauses for a short period of time then crashes. Tried several scheduled transactions. Results are the same - system crash.

EXPECTED RESULT
Transaction window to open so data may be verified.


SOFTWARE/OS VERSIONS
Windows: 10
MacOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
I had to drop back to nightly build kmymoney-master-225-windows-mingw_64-gcc.exe in order for this function to work.

Note that until build 260, I had been using the mingw builds. There was an issue a while back when those builds were failing so I started using the msvc2017 builds. I haven't used the "Next Transaction" feature for a while so I cannot tell when it broke. I've tried mscv builds 260, 301, 303 and 306. These builds fail with the same error. I'm not able to try the latest mingw build as the nightly build failed.
Comment 1 Thomas Baumgart 2019-02-26 19:17:20 UTC
I am a bit confused by "1. Open Scheduled Transaction Account". Do you mean

a) open the ledger for the account containing the scheduled transaction
b) open the schedule view

There is a third spot that can start the entry of a scheduled transaction which is the home view showing scheduled transactions.

So my questions are:

1) Where does it fail for you and
2) Does it also fail using the other two methods?
Comment 2 Robert Blackwell 2019-02-26 21:10:27 UTC
Using build 306 (kmymoney-master-306-windows-msvc2017_64-cl.exe) as a means of testing;

It fails at;
a) the ledger for the account containing the scheduled transaction
b) the schedule view

It fails shortly after I click on the menu item that reads "Enter Next Transaction". No error messages occur. The Busy icon displays for a few seconds then the program closes abruptly. It seems to fail at the point where the transaction window would normally open.

It _DOES NOT_ fail on the Home Screen. I am able to enter a scheduled transaction from the home screen by clicking on the "Enter Schedule" button. When I do, the transaction window opens. I'm then able to "Enter" the transaction without the program stopping.
Comment 3 Thomas Baumgart 2019-02-27 10:31:59 UTC
Thanks, I was able to duplicate the problem. But I have no idea what is going on right now and no environment to do some debugging.
Comment 4 Robert Blackwell 2019-02-27 11:58:14 UTC
I'm pleased to hear you've been able to duplicate the problem. I'll enter scheduled transactions from the Home screen until the problem can be rectified.
Comment 5 Thomas Baumgart 2019-02-28 10:12:16 UTC
Git commit 88cad4dc6c70875a472275b653b641aa5dfc2509 by Thomas Baumgart.
Committed on 28/02/2019 at 10:11.
Pushed by tbaumgart into branch '5.0'.

Use active window as parent for scheduled transaction entry dialog

Try to resolve the 'Crash on "Enter Next Transcation"' bug

M  +3    -7    kmymoney/views/kscheduledview_p.h

https://commits.kde.org/kmymoney/88cad4dc6c70875a472275b653b641aa5dfc2509
Comment 6 Robert Blackwell 2019-02-28 14:30:05 UTC
Based on time of update, it looks like this change will be in the next build. I'll be able to D/L that first thing tomorrow morning then report on success.
Comment 7 Robert Blackwell 2019-03-03 13:27:16 UTC
I've D/Led and tried Build 311, Version 5.0.80-d77450301. The issue remains.
Comment 8 Thomas Baumgart 2019-03-03 14:32:39 UTC
It needs someone with a Windows development environment to debug this.
Comment 9 mahueb55 2019-03-04 01:04:33 UTC
(In reply to Thomas Baumgart from comment #8)
> It needs someone with a Windows development environment to debug this.

Thomas,

please see call stack at the time of the exception below. I can't honestly say I truly understand why, but calling winId() AFTER resize(...) in KEnterScheduleDlg::KEnterScheduleDlg appears to solve the issue for me.




>	kmymoney.exe!KMyMoneyRegister::Register::d_func() Zeile 361	C++
 	kmymoney.exe!KMyMoneyRegister::Register::resize(int col, bool force) Zeile 755	C++
 	kmymoney.exe!KEnterScheduleDlg::resizeEvent(QResizeEvent * ev) Zeile 230	C++
 	Qt5Widgetsd.dll!QWidget::event(QEvent * event) Zeile 9072	C++
 	Qt5Widgetsd.dll!QApplicationPrivate::notify_helper(QObject * receiver, QEvent * e) Zeile 3727	C++
 	Qt5Widgetsd.dll!QApplication::notify(QObject * receiver, QEvent * e) Zeile 3690	C++
 	Qt5Cored.dll!QCoreApplication::notifyInternal2(QObject * receiver, QEvent * event) Zeile 1048	C++
 	Qt5Cored.dll!QCoreApplication::forwardEvent(QObject * receiver, QEvent * event, QEvent * originatingEvent) Zeile 1064	C++
 	Qt5Widgetsd.dll!QWidgetWindow::handleResizeEvent(QResizeEvent * event) Zeile 800	C++
 	Qt5Widgetsd.dll!QWidgetWindow::event(QEvent * event) Zeile 304	C++
 	Qt5Widgetsd.dll!QApplicationPrivate::notify_helper(QObject * receiver, QEvent * e) Zeile 3727	C++
 	Qt5Widgetsd.dll!QApplication::notify(QObject * receiver, QEvent * e) Zeile 3099	C++
 	Qt5Cored.dll!QCoreApplication::notifyInternal2(QObject * receiver, QEvent * event) Zeile 1048	C++
 	Qt5Cored.dll!QCoreApplication::sendSpontaneousEvent(QObject * receiver, QEvent * event) Zeile 237	C++
 	Qt5Guid.dll!QGuiApplicationPrivate::processGeometryChangeEvent(QWindowSystemInterfacePrivate::GeometryChangeEvent * e) Zeile 2402	C++
 	Qt5Guid.dll!QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent * e) Zeile 1829	C++
 	Qt5Guid.dll!QWindowSystemInterfacePrivate::handleWindowSystemEvent<QWindowSystemInterface::SynchronousDelivery>(QWindowSystemInterfacePrivate::WindowSystemEvent * ev) Zeile 105	C++
 	Qt5Guid.dll!QWindowSystemInterface::handleGeometryChange<QWindowSystemInterface::SynchronousDelivery>(QWindow * window, const QRect & newRect) Zeile 308	C++
 	qwindowsd.dll!QWindowsWindow::initialize() Zeile 1149	C++
 	Qt5Guid.dll!QWindowPrivate::create(bool recursive, unsigned __int64 nativeHandle) Zeile 526	C++
 	Qt5Guid.dll!QWindow::create() Zeile 636	C++
 	Qt5Widgetsd.dll!QWidgetPrivate::create_sys(unsigned __int64 window, bool initializeWindow, bool destroyOldWindow) Zeile 1485	C++
 	Qt5Widgetsd.dll!QWidget::create(unsigned __int64 window, bool initializeWindow, bool destroyOldWindow) Zeile 1340	C++
 	Qt5Widgetsd.dll!QWidgetPrivate::createWinId() Zeile 2569	C++
 	Qt5Widgetsd.dll!QWidget::winId() Zeile 2535	C++
 	kmymoney.exe!KEnterScheduleDlg::KEnterScheduleDlg(QWidget * parent, const MyMoneySchedule & schedule) Zeile 112	C++
 	kmymoney.exe!KScheduledViewPrivate::enterSchedule(MyMoneySchedule & schedule, bool autoEnter, bool extendedKeys) Zeile 494	C++
 	kmymoney.exe!KScheduledView::slotEnterSchedule() Zeile 450	C++
 	kmymoney.exe!QtPrivate::FunctorCall<QtPrivate::IndexesList<>,QtPrivate::List<>,void,void (__cdecl KScheduledView::*)(void)>::call(void(KScheduledView::*)() f, KScheduledView * o, void * * arg) Zeile 134	C++
 	kmymoney.exe!QtPrivate::FunctionPointer<void (__cdecl KScheduledView::*)(void)>::call<QtPrivate::List<>,void>(void(KScheduledView::*)() f, KScheduledView * o, void * * arg) Zeile 168	C++
 	kmymoney.exe!QtPrivate::QSlotObject<void (__cdecl KScheduledView::*)(void),QtPrivate::List<>,void>::impl(int which, QtPrivate::QSlotObjectBase * this_, QObject * r, void * * a, bool * ret) Zeile 397	C++
 	Qt5Cored.dll!QtPrivate::QSlotObjectBase::call(QObject * r, void * * a) Zeile 376	C++
 	Qt5Cored.dll!QMetaObject::activate(QObject * sender, int signalOffset, int local_signal_index, void * * argv) Zeile 3759	C++
 	Qt5Cored.dll!QMetaObject::activate(QObject * sender, const QMetaObject * m, int local_signal_index, void * * argv) Zeile 3634	C++
 	Qt5Widgetsd.dll!QAction::triggered(bool _t1) Zeile 377	C++
 	Qt5Widgetsd.dll!QAction::activate(QAction::ActionEvent event) Zeile 1167	C++
 	Qt5Widgetsd.dll!QAction::trigger() Zeile 187	C++
 	Qt5Widgetsd.dll!QAction::qt_static_metacall(QObject * _o, QMetaObject::Call _c, int _id, void * * _a) Zeile 212	C++
 	Qt5Cored.dll!QMetaCallEvent::placeMetaCall(QObject * object) Zeile 507	C++
 	Qt5Cored.dll!QObject::event(QEvent * e) Zeile 1251	C++
 	Qt5Widgetsd.dll!QAction::event(QEvent * e) Zeile 1097	C++
 	Qt5Widgetsd.dll!QApplicationPrivate::notify_helper(QObject * receiver, QEvent * e) Zeile 3727	C++
 	Qt5Widgetsd.dll!QApplication::notify(QObject * receiver, QEvent * e) Zeile 3099	C++
 	Qt5Cored.dll!QCoreApplication::notifyInternal2(QObject * receiver, QEvent * event) Zeile 1048	C++
 	Qt5Cored.dll!QCoreApplication::sendEvent(QObject * receiver, QEvent * event) Zeile 234	C++
 	Qt5Cored.dll!QCoreApplicationPrivate::sendPostedEvents(QObject * receiver, int event_type, QThreadData * data) Zeile 1745	C++
 	Qt5Cored.dll!QEventDispatcherWin32::sendPostedEvents() Zeile 1085	C++
 	qwindowsd.dll!QWindowsGuiEventDispatcher::sendPostedEvents() Zeile 82	C++
 	Qt5Cored.dll!qt_internal_proc(HWND__ * hwnd, unsigned int message, unsigned __int64 wp, __int64 lp) Zeile 239	C++
 	[Externer Code]	
 	Qt5Cored.dll!QEventDispatcherWin32::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags) Zeile 630	C++
 	qwindowsd.dll!QWindowsGuiEventDispatcher::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags) Zeile 74	C++
 	Qt5Cored.dll!QEventLoop::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags) Zeile 137	C++
 	Qt5Cored.dll!QEventLoop::exec(QFlags<enum QEventLoop::ProcessEventsFlag> flags) Zeile 214	C++
 	Qt5Cored.dll!QCoreApplication::exec() Zeile 1336	C++
 	Qt5Guid.dll!QGuiApplication::exec() Zeile 1762	C++
 	Qt5Widgetsd.dll!QApplication::exec() Zeile 2902	C++
 	kmymoney.exe!runKMyMoney(QApplication & a, std::unique_ptr<QSplashScreen,std::default_delete<QSplashScreen> > splash, const QUrl & file, bool noFile) Zeile 335	C++
 	kmymoney.exe!main(int argc, char * * argv) Zeile 243	C++
 	kmymoney.exe!WinMain(HINSTANCE__ * __formal, HINSTANCE__ * __formal, char * __formal, int __formal) Zeile 104	C++
 	[Externer Code]
Comment 10 Thomas Baumgart 2019-03-04 18:27:26 UTC
@mahueb Does it also work for you if you remove the call to winId() completely?
Comment 11 mahueb55 2019-03-05 01:46:08 UTC
(In reply to Thomas Baumgart from comment #10)
> @mahueb Does it also work for you if you remove the call to winId()
> completely?

Yes, looks like it works with the winId() call commented out.
Comment 12 Thomas Baumgart 2019-03-05 08:41:00 UTC
Git commit 9f702f34e9a6197f7d526467505ddaf56f6c5c1e by Thomas Baumgart.
Committed on 05/03/2019 at 08:39.
Pushed by tbaumgart into branch '5.0'.

Remove call to winId

A call to winId causes a crash on MS-Windows. It was needed in certain
circumstances to place the dialog centered on the application window.
This is now handled by a separate move() of the dialog to the position.
FIXED-IN: 5.0.4

M  +5    -1    kmymoney/dialogs/kenterscheduledlg.cpp

https://commits.kde.org/kmymoney/9f702f34e9a6197f7d526467505ddaf56f6c5c1e
Comment 13 Robert Blackwell 2019-03-06 12:16:43 UTC
I confirm this change corrected the problem. Thank you very much.