Bug#694868: kmymoney: After configuring reports in Polish, Save causes segfault and loss of user profile
On Sun, Dec 02, 2012 at 05:17:58PM +0600, Andrey Rahmatullin wrote: > See also https://bugs.kde.org/show_bug.cgi?id=258974 and > https://projects.kde.org/projects/extragear/office/kmymoney/repository/revisions/7019c148079fbb9ba3d1b8331c09d2c994215c91/diff/kmymoney/dialogs/kreportconfigurationfilterdlg.cpp So, I suppose the best workaround for now would be doing the same as this patch does, replacing "All accounts" with "@item all accounts" in the code (if it helps, of course). -- WBR, wRAR signature.asc Description: Digital signature
Bug#694868: kmymoney: After configuring reports in Polish, Save causes segfault and loss of user profile
On Sun, Dec 02, 2012 at 05:11:00PM +0600, Andrey Rahmatullin wrote: > 2. The code in KReportConfigurationFilterDlg::slotReset() doesn't have a > fallback and can leave m_comboDetail without a selected value. > 3. pl.po and possibly other langs have different values for the combo item > and the constant from the comparison. > > I also feel that it's wrong to have different contexts for that two > strings if they are compared but I don't know best practices for Qt > localization. See also https://bugs.kde.org/show_bug.cgi?id=258974 and https://projects.kde.org/projects/extragear/office/kmymoney/repository/revisions/7019c148079fbb9ba3d1b8331c09d2c994215c91/diff/kmymoney/dialogs/kreportconfigurationfilterdlg.cpp -- WBR, wRAR signature.asc Description: Digital signature
Bug#694868: kmymoney: After configuring reports in Polish, Save causes segfault and loss of user profile
Control: tags -1 + confirmed upstream On Sat, Dec 01, 2012 at 03:18:58PM +0100, Mirosław Zalewski wrote: > Package: kmymoney > Version: 4.6.2-3.1 > Severity: grave > > Steps to reproduce: > 1. touch /tmp/new.kmy > 2. kmymoney --lang pl /tmp/new.kmy > 3. choose any currency from list Here you need to press the first button which is "set as default". > 4. Go to "Raporty" (Reports). Choose any report, right click and choose >"Konfiguracja" (Configure) Looks like it doesn't crash with some reports. It does with he first one though. > I am attaching crashlog from Dr. Konqui. I have kmymoney-dev installed, > but it doesn't seem to provide meaningful information. You need kmymoney-dbg. This is a proper bt: (gdb) bt #0 QString::operator= (this=0x5e18920, other=...) at tools/qstring.cpp:1410 #1 0x74a74d22 in QDomAttrPrivate::setNodeValue (this=0x5e188e0, v=...) at dom/qdom.cpp:4137 #2 0x74a7b9a6 in QDomElementPrivate::setAttribute (this=0x5d3b120, aname=..., newValue=...) at dom/qdom.cpp:4479 #3 0x77b98b48 in MyMoneyReport::write (this=this@entry=0x5d4db60, e=..., doc=doc@entry=0xecd070, anonymous=anonymous@entry=false) at /build/buildd-kmymoney_4.6.2-3.1-amd64-N_PinZ/kmymoney-4.6.2/kmymoney/mymoney/mymoneyreport.cpp:362 #4 0x77b99831 in MyMoneyReport::writeXML (this=0x5d4db60, document=..., parent=...) at /build/buildd-kmymoney_4.6.2-3.1-amd64-N_PinZ/kmymoney-4.6.2/kmymoney/mymoney/mymoneyreport.cpp:741 #5 0x007960c7 in MyMoneyStorageXML::writeReports (this=0x5fdcc90, parent=...) at /build/buildd-kmymoney_4.6.2-3.1-amd64-N_PinZ/kmymoney-4.6.2/kmymoney/mymoney/storage/mymoneystoragexml.cpp:776 #6 0x007949fb in MyMoneyStorageXML::writeFile (this=0x5fdcc90, qf=0x5d0fdd0, storage=) at /build/buildd-kmymoney_4.6.2-3.1-amd64-N_PinZ/kmymoney-4.6.2/kmymoney/mymoney/storage/mymoneystoragexml.cpp:515 #7 0x004aa0de in KMyMoneyView::saveToLocalFile (this=this@entry=0xf2cc10, localFile=..., pWriter=pWriter@entry=0x5fdcc90, plaintext=160, plaintext@entry=false, keyList=...) at /build/buildd-kmymoney_4.6.2-3.1-amd64-N_PinZ/kmymoney-4.6.2/kmymoney/views/kmymoneyview.cpp:1190 #8 0x004ab0c9 in KMyMoneyView::saveFile (this=0xf2cc10, url=..., keyList=...) at /build/buildd-kmymoney_4.6.2-3.1-amd64-N_PinZ/kmymoney-4.6.2/kmymoney/views/kmymoneyview.cpp:1265 #9 0x00482c3f in KMyMoneyApp::slotFileSave (this=0xd4f5a0) at /build/buildd-kmymoney_4.6.2-3.1-amd64-N_PinZ/kmymoney-4.6.2/kmymoney/kmymoney.cpp:1570 (gdb) fr 3 #3 0x77b98b48 in MyMoneyReport::write (this=this@entry=0x5d4db60, e=..., doc=doc@entry=0xecd070, anonymous=anonymous@entry=false) at /build/buildd-kmymoney_4.6.2-3.1-amd64-N_PinZ/kmymoney-4.6.2/kmymoney/mymoney/mymoneyreport.cpp:362 362 e.setAttribute("detail", kDetailLevelText[m_detailLevel]); (gdb) p m_detailLevel $2 = 32767 i.e. m_detailLevel == -1 while it shouldn't be negative (it's enum EDetailLevel defined in kmymoney/mymoney/mymoneyreport.h). Some grepping shows that m_detailLevel is set in the configuration dialog based on the m_comboDetail selected value without validation: kmymoney/dialogs/kreportconfigurationfilterdlg.cpp::KReportConfigurationFilterDlg::slotSearch(): m_currentState.setDetailLevel(dl[m_tab2->findChild("m_comboDetail")->currentIndex()]); Now if we look at that combo (it's on the second tab of the dialog) in the Polish l10n, it doesn't have a selected value (as opposed to the Russian l10n). The default value for that combo is set in KReportConfigurationFilterDlg::slotReset(). The default detailLevel() is eDetailAll so it's trying to find the result of i18nc("All accounts", "All") in the combo. Checking the .po. This is the string from the code that selects the value in the combo: #: kmymoney/dialogs/kreportconfigurationfilterdlg.cpp:290 msgctxt "All accounts" msgid "All" msgstr "Wszystko" This is the string from the .ui that fills the combo values: #. i18n: file: kmymoney/widgets/kmymoneyreportconfigtab2decl.ui:47 #. i18n: ectx: property (text), item, widget (KComboBox, m_comboDetail) #: rc.cpp:3445 msgctxt "@item all accounts" msgid "All" msgstr "Wszystkie" So there are several problems. 1. The code in KReportConfigurationFilterDlg::slotSearch() passes unchecked values to setDetailLevel, it should compare it to -1. 2. The code in KReportConfigurationFilterDlg::slotReset() doesn't have a fallback and can leave m_comboDetail without a selected value. 3. pl.po and possibly other langs have different values for the combo item and the constant from the comparison. I also feel that it's wrong to have different contexts for that two strings if they are compared but I don't know best practices for Qt localization. -- WBR, wRAR signature.asc Description: Digital signature
Processed: Re: Bug#694868: kmymoney: After configuring reports in Polish, Save causes segfault and loss of user profile
Processing control commands: > tags -1 + confirmed upstream Bug #694868 [kmymoney] kmymoney: After configuring reports in Polish, Save causes segfault and loss of user profile Added tag(s) upstream and confirmed. -- 694868: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=694868 Debian Bug Tracking System Contact ow...@bugs.debian.org with problems -- To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Bug#694868: kmymoney: After configuring reports in Polish, Save causes segfault and loss of user profile
Package: kmymoney Version: 4.6.2-3.1 Severity: grave Steps to reproduce: 1. touch /tmp/new.kmy 2. kmymoney --lang pl /tmp/new.kmy 3. choose any currency from list 4. Go to "Raporty" (Reports). Choose any report, right click and choose "Konfiguracja" (Configure) 5. In new window, click OK 6. Choose Plik -> Zapisz (File -> Save) from menu 7. Watch KMyMoney crash. User profile is trimmed to zero bytes, causing loss of all user data You can save file between steps 3 and 4 and check it's size to ensure that trimming is caused by crash, not working on empty file in test case. I am attaching crashlog from Dr. Konqui. I have kmymoney-dev installed, but it doesn't seem to provide meaningful information. So far I was able to reproduce this bug only on Polish language. Other languages seem to work fine. Perhaps .po or generated .mo files are malformed? I am rising severity since normal usage of package can cause data loss for all users of certain nationality. Best regards Mirosław Zalewski -- System Information: Debian Release: wheezy/sid APT prefers testing APT policy: (990, 'testing'), (300, 'unstable'), (102, 'experimental') Architecture: amd64 (x86_64) Foreign Architectures: i386 Kernel: Linux 3.2.0-4-amd64 (SMP w/2 CPU cores) Locale: LANG=pl_PL.UTF-8, LC_CTYPE=pl_PL.UTF-8 (charmap=UTF-8) (ignored: LC_ALL set to pl_PL.UTF-8) Shell: /bin/sh linked to /bin/dash Versions of packages kmymoney depends on: ii kde-runtime 4:4.8.4-2 ii kdepim-runtime4:4.4.11.1-5+b1 ii kmymoney-common 4.6.2-3.1 ii libalkimia4 4.3.2-1.1 ii libaqbanking345.0.24-1 ii libc6 2.13-37 ii libgcc1 1:4.7.2-4 ii libgmp10 2:5.0.5+dfsg-2 ii libgpgme++2 4:4.8.4-1 ii libgwengui-qt4-0 4.3.3-1 ii libgwenhywfar60 4.3.3-1 ii libical0 0.48-2 ii libkabc4 4:4.8.4-1 ii libkcmutils4 4:4.8.4-4 ii libkdecore5 4:4.8.4-4 ii libkdeui5 4:4.8.4-4 ii libkfile4 4:4.8.4-4 ii libkholidays4 4:4.8.4-1 ii libkhtml5 4:4.8.4-4 ii libkio5 4:4.8.4-4 ii libofx4 1:0.9.4-2.1 ii libqt4-dbus 4:4.8.2+dfsg-2 ii libqt4-network4:4.8.2+dfsg-2 ii libqt4-sql4:4.8.2+dfsg-2 ii libqt4-svg4:4.8.2+dfsg-2 ii libqt4-xml4:4.8.2+dfsg-2 ii libqtcore44:4.8.2+dfsg-2 ii libqtgui4 4:4.8.2+dfsg-2 ii libstdc++64.7.2-4 Versions of packages kmymoney recommends: pn gpg-agent pn pinentry-qt4 kmymoney suggests no packages. -- no debconf information File: kmymoney-20121201-144204.kcrash Application: KMyMoney (kmymoney), signal: Segmentation fault Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". [KCrash Handler] #5 0x7f5854b4044e in ?? () from /lib/x86_64-linux-gnu/libc.so.6 #6 0x7f585654905a in QString::realloc(int) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4 #7 0x7f5856549bee in QString::resize(int) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4 #8 0x7f585654bd1d in QString::replace_helper(unsigned int*, int, int, QChar const*, int) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4 #9 0x7f585654c7d2 in QString::replace(int, int, QChar const*, int) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4 #10 0x7f585654c825 in QString::replace(int, int, QString const&) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4 #11 0x7f5856e3d642 in ?? () from /usr/lib/x86_64-linux-gnu/libQtXml.so.4 #12 0x7f5856e494f2 in ?? () from /usr/lib/x86_64-linux-gnu/libQtXml.so.4 #13 0x7f5856e48fcd in ?? () from /usr/lib/x86_64-linux-gnu/libQtXml.so.4 #14 0x7f5856e48fcd in ?? () from /usr/lib/x86_64-linux-gnu/libQtXml.so.4 #15 0x7f5856e42dc4 in ?? () from /usr/lib/x86_64-linux-gnu/libQtXml.so.4 #16 0x7f5856e43213 in QDomDocument::toString(int) const () from /usr/lib/x86_64-linux-gnu/libQtXml.so.4 #17 0x00794adf in ?? () #18 0x004aa0de in ?? () #19 0x004ab0c9 in ?? () #20 0x00482c3f in _start () -- To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org