[kmymoney] [Bug 398410] KMyMoney crashes when trying to save entries back to DB Backend

Thomas Baumgart bugzilla_noreply at kde.org
Sat Jan 5 13:45:56 GMT 2019


https://bugs.kde.org/show_bug.cgi?id=398410

--- Comment #38 from Thomas Baumgart <tbaumgart at kde.org> ---
This seems extremely weird. Looking at the following

#6  0x00007fffa721e87f in MyMoneyStorageSql::open(QUrl const&, int, bool)
(this=0x5555568e4480, url=..., openMode=3, clear=false)
    at /home/eagleboy/kmymoney/kmymoney/plugins/sql/mymoneystoragesql.cpp:114
#7  0x00007fffa721a1c8 in SQLStorage::save(QUrl const&) (this=0x55555626ba60,
url=...) at /home/eagleboy/kmymoney/kmymoney/plugins/sql/sqlstorage.cpp:198
#8  0x00007fffa721bdc1 in SQLStorage::saveAsDatabase(QUrl const&)
(this=0x55555626ba60, url=...) at
/home/eagleboy/kmymoney/kmymoney/plugins/sql/sqlstorage.cpp:354
#9  0x00007fffa721abfa in SQLStorage::saveAs() (this=0x55555626ba60) at
/home/eagleboy/kmymoney/kmymoney/plugins/sql/sqlstorage.cpp:241
#10 0x000055555560e39e in KMyMoneyApp::slotFileSaveAs() (this=0x555555e75430)
at /home/eagleboy/kmymoney/kmymoney/kmymoney.cpp:3554

and at the involved code itself, one can see that apparently opening the
database fails. What astonishes me is, that to get to that point, the DB was
opened in SQLStorage::saveAsDatabase() w/o problems. If one compares the two
affecting lines of code, we see


in bool SQLStorage::saveAsDatabase(const QUrl &url)

  auto writer = new MyMoneyStorageSql(MyMoneyFile::instance()->storage(), url);
  auto canWrite = false;
  switch (writer->open(url, QIODevice::WriteOnly)) {

and in SQLStorage::save()

  auto writer = new MyMoneyStorageSql(MyMoneyFile::instance()->storage(), url);
  writer->open(url, QIODevice::ReadWrite);

We can assume, that url is the same as it is passed as a const ref. The second
parameter is used to control the internals of MyMoneyStorageSql::writer() and
do not have an influence on the call to QDatabase::open() which is identical in
both cases. So the question is, why does it work the first time but not the
second and why does this only happen in Eleazar's installation and not on other
people's?

One more difference I found here: my libmysqlclient.so is actually a symlink to
libmariadb.so. My Qt-Version is 5.9.4 and my glibc version is 2.26 in case that
plays a role. BTW, I tested this against a MySQL database at my provider (so I
had a WAN connection in between).

It would be cool if we can solve this mystery.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the KMyMoney-devel mailing list