Summary: | Kmymoney crashes while importing .csv | ||
---|---|---|---|
Product: | [Applications] kmymoney | Reporter: | Matthew <avanesov> |
Component: | general | Assignee: | allan <agander93> |
Status: | RESOLVED FIXED | ||
Severity: | crash | CC: | agander93, onet.cristian |
Priority: | NOR | ||
Version: | 4.6.0 | ||
Target Milestone: | --- | ||
Platform: | openSUSE | ||
OS: | Linux | ||
Latest Commit: | http://commits.kde.org/kmymoney/1a7483ef7d73cec1be91df1e2bf18fb4b91bdcf9 | Version Fixed In: | |
Attachments: | Patch file for this bug |
Description
Matthew
2011-09-25 21:09:30 UTC
(In reply to comment #0) > Application: kmymoney (4.6.0) > KDE Platform Version: 4.7.1 (4.7.1) "release 8" > Qt Version: 4.7.4 > Operating System: Linux 2.6.37.6-0.7-desktop x86_64 > Distribution: "openSUSE 11.4 (x86_64)" Would it be possible for you to send direct to me a copy of your csv file, if necessary with private data changed, as long as the format remains intact. Allan I managed to get it to work right before I left home. The csv had 3 lines at
the top that only appeared in colum 1 in csv format, and then the header row.
I deleted the 3 lines and the header from the file and the import went
perfect. I did not back up the file first so I do not have a copy of the
original formatting to send. If I remember correctly the formatting was like
this:
name of institution
account number
some description
transaction number,date,payee,description,debit,deposit
data,data,data,data,data,data
data,data,data,data,data,data
data,data,data,data,data,data
data,data,data,data,data,data
data,data,data,data,data,data
data,data,data,data,data,data
etc...
Not backing up the original was carless of me. This is the first time I have
submitted a bug and I diddnt think it through first. Ill be more thorough next
time and have some better feedback to help with the troubleshooting.
On Sunday, September 25, 2011 09:33:26 PM allan wrote:
> https://bugs.kde.org/show_bug.cgi?id=282763
>
>
> allan <agander93@gmail.com> changed:
>
> What |Removed |Added
> ----------------------------------------------------------------------------
> CC| |agander93@gmail.com
>
>
>
>
> --- Comment #1 from allan <agander93 gmail com> 2011-09-25 21:33:25 ---
> (In reply to comment #0)
>
> > Application: kmymoney (4.6.0)
> > KDE Platform Version: 4.7.1 (4.7.1) "release 8"
> > Qt Version: 4.7.4
> > Operating System: Linux 2.6.37.6-0.7-desktop x86_64
> > Distribution: "openSUSE 11.4 (x86_64)"
>
> Would it be possible for you to send direct to me a copy of your csv
> file, if necessary with private data changed, as long as the format
> remains intact.
>
> Allan
(In reply to comment #2) > I managed to get it to work right before I left home. The csv had 3 lines at > the top that only appeared in colum 1 in csv format, and then the header row. > I deleted the 3 lines and the header from the file and the import went > perfect. I did not back up the file first so I do not have a copy of the > original formatting to send. If I remember correctly the formatting was like > this: > > name of institution > account number > some description > > transaction number,date,payee,description,debit,deposit > data,data,data,data,data,data > data,data,data,data,data,data > data,data,data,data,data,data > data,data,data,data,data,data > data,data,data,data,data,data > data,data,data,data,data,data > etc... > > > Not backing up the original was carless of me. This is the first time I have > submitted a bug and I diddnt think it through first. Ill be more thorough next > time and have some better feedback to help with the troubleshooting. > I constructed a test file by adding your header lines to the top of a valid csv file. The only way I could reproduce your problem was by failing to set the first line to the correct value on the Settings tab. Leaving it set to '1' will result in that error message appearing. Prior to that, another warning appears, an empty cell having been detected in the amount column on row 1. Ignoring that and proceeding to import, your message appears. Clicking 'accept' or accept all brings up an error message that an invalid date has been detected on row 1. As far as I can see, the logic is correct, and can only assume you failed to set the first line correctly on the Settings tab. If you will be able to retry with another file, I'll leave this bug open, unless you con confirm that an incorrect setting was used. In the event of a further problem, it might help if you can enable debug symbols. > On Sunday, September 25, 2011 09:33:26 PM allan wrote: > > https://bugs.kde.org/show_bug.cgi?id=282763 > > > > > > allan <agander93@gmail.com> changed: > > > > What |Removed |Added > > ---------------------------------------------------------------------------- > > CC| |agander93@gmail.com > > > > > > > > > > --- Comment #1 from allan <agander93 gmail com> 2011-09-25 21:33:25 --- > > (In reply to comment #0) > > > > > Application: kmymoney (4.6.0) > > > KDE Platform Version: 4.7.1 (4.7.1) "release 8" > > > Qt Version: 4.7.4 > > > Operating System: Linux 2.6.37.6-0.7-desktop x86_64 > > > Distribution: "openSUSE 11.4 (x86_64)" > > > > Would it be possible for you to send direct to me a copy of your csv > > file, if necessary with private data changed, as long as the format > > remains intact. > > > > Allan Even if an invalid setting has been selected by the user, the application should not respond with a crash. (In reply to comment #4) > Even if an invalid setting has been selected by the user, the application > should not respond with a crash. Of course, I agree totally. Unfortunately, the BT wasn't very helpful, just giving the routine but no address. Also unfortunately, my attempt to reproduce the problem was unsuccessful as well, but I haven't washed my hands on it. Is this still relevant to git master? (In reply to comment #6) > Is this still relevant to git master? I've constructed another file based on the format 'remembered' by the user. Attempting to import with a starting row other than the correct one always resulted in one or more error messages. Accepting or cancelling these never resulted in a crash. As the BT provided was unhelpful, without symbols, and it was a very old revision, I think this should be closed as 'works for me'. While there was no crash, there was a condition, depending on responses to the errors, where it was not possible to get to the import stage without reselecting the file to import, and that needs to be looked at. So, either close as suggested, or leave open, but for a quite different issue?? Please open an issue for that problem you observed if it's still happening on git master. (In reply to comment #8) > Please open an issue for that problem you observed if it's still happening > on git master. See https://bugs.kde.org/show_bug.cgi?id=324991 I've now found a condition which will result in a crash. It may not be the original issue as it only appears to affect investment files. I might as well add it here though. Again, it involves the user ignoring error messages, in a similar way to https://bugs.kde.org/show_bug.cgi?id=324991 above. (Comment #9) Steps to Reproduce: 1. Perform the usual steps to import an investment CSV file, until reaching the Lines page. 2. On that page, select an incorrect start (or end) line, such that a line with invalid format is - included in the import selection, then click Next. 3. An error message is likely to appear indicating that an incorrect value has been detected on - the invalid row. 4. Instead of clicking Cancel, click an Accept button. 5. On the Finish page, click Import CSV. 6. Another error message now is likely to appear, when the import data is parsed. Generally, - the error first detected is likely to be an incorrect date value. Click OK. 7a. What the user should do next is to click on Back and correct the line number then click Next. 7b. Instead of correcting the line number, click to change date format. 8. Now click Next, and a crash occurs. Created attachment 82405 [details]
Patch file for this bug
Both this bug and 324991 involve the same areas of code. I started off intending to submit separate patches, but they were too interwoven. It's a fairly small patch, and some of the inserts/deletes are really moves, to obtain a more logical sequence.
They are in the wizard version of the CSV plugin, which is not in stable, and the issues only arise following the user attempting to continue without correcting errors which had been flagged. The crash condition probably would not arise in the tabbed wizard in stable.
Assuming no objections, I would intend to commit in a week or so.
(In reply to comment #11) > and the issues only arise following the user attempting to continue without > correcting errors which had been flagged. The crash condition probably > would not arise in the tabbed wizard in stable. The crash condition does *not* arise in the tabbed wizard in stable. > Assuming no objections, I would intend to commit in a week or so. The intention of the patch is that, when KMM app detects the error in the import, it will pass control to the LinesDatePage wizard page, where the error needs to be corrected, instead of remaining on the CompletionPage, removing the possibility of the user re-importing a file with invalid parameters. Finally, I've found the cause of the original crash. It was fixed 28 Nov 2011 in Bug 287786 - If a CSV file contains lines with differing numbers of columns, and if one of the selected columns happens to be the last column in a line with fewer than the maximum number, an array goes out of bounds. It was backported into 4.6.3. So the cause was the user importing the header lines, after several warnings. ? *** Bug 324991 has been marked as a duplicate of this bug. *** Git commit 1a7483ef7d73cec1be91df1e2bf18fb4b91bdcf9 by Allan Anderson. Committed on 19/09/2013 at 12:21. Pushed by allananderson into branch 'master'. Related: bug 324491 M +18 -15 kmymoney/plugins/csvimport/csvdialog.cpp M +31 -3 kmymoney/plugins/csvimport/investprocessing.cpp http://commits.kde.org/kmymoney/1a7483ef7d73cec1be91df1e2bf18fb4b91bdcf9 |