Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Opening a File from 2.9.4 (WIndows) in 3.0.0 (Linux) and trying to edit/add entries causes crashes #512

Closed
nruri opened this issue May 6, 2019 · 13 comments

Comments

Projects
None yet
2 participants
@nruri
Copy link

commented May 6, 2019

Editing Dates, adding entries causes the program to crash.
I tried editing the Date format, which allowed me to add a few entries. Then it crashed when adding entries to another account.

Application Name: moneyGuru
Version: 3.0.0

Traceback (most recent call last):
File "/home/x/hsoft/moneyguru/qt/controller/table.py", line 186, in submit
self.model.save_edits()
File "/home/x/hsoft/moneyguru/core/gui/transaction_table_base.py", line 108, in save_edits
super().save_edits()
File "/home/x/hsoft/moneyguru/core/gui/table.py", line 412, in save_edits
row.save()
File "/home/x/hsoft/moneyguru/core/gui/entry_table_base.py", line 213, in save
self.table.mainwindow.revalidate()
File "/home/x/hsoft/moneyguru/core/gui/base.py", line 200, in revalidate
self._revalidate()
File "/home/x/hsoft/moneyguru/core/gui/main_window.py", line 309, in _revalidate
self._current_pane.view.revalidate()
File "/home/x/hsoft/moneyguru/core/gui/base.py", line 200, in revalidate
self._revalidate()
File "/home/x/hsoft/moneyguru/core/gui/account_view.py", line 46, in _revalidate
TransactionViewBase._revalidate(self)
File "/home/x/hsoft/moneyguru/core/gui/transaction_view.py", line 45, in _revalidate
self.table.refresh_and_show_selection()
File "/home/x/hsoft/moneyguru/core/gui/table.py", line 585, in refresh_and_show_selection
self.refresh(refresh_view=False)
File "/home/x/hsoft/moneyguru/core/gui/table.py", line 393, in refresh
self._fill()
File "/home/x/hsoft/moneyguru/core/gui/entry_table.py", line 77, in _fill
rows = self._get_account_rows(account)
File "/home/x/hsoft/moneyguru/core/gui/entry_table_base.py", line 387, in _get_account_rows
entries = self.mainwindow.visible_entries_for_account(account)
File "/home/x/hsoft/moneyguru/core/gui/main_window.py", line 628, in visible_entries_for_account
self._account2visibleentries[account] = self._visible_entries_for_account(account)
File "/home/x/hsoft/moneyguru/core/gui/main_window.py", line 274, in _visible_entries_for_account
entries = [e for e in entries if e.date in date_range]
File "/home/x/hsoft/moneyguru/core/gui/main_window.py", line 274, in
entries = [e for e in entries if e.date in date_range]
ValueError: year 4444566 is out of range

Another error I get trying to close the error box.

Application Name: moneyGuru
Version: 3.0.0

Traceback (most recent call last):
File "/home/x/hsoft/moneyguru/qt/controller/table.py", line 145, in flags
row = self.model[index.row()]
File "/home/x/hsoft/moneyguru/core/gui/table.py", line 47, in getitem
return self._rows.getitem(key)
IndexError: list index out of range

@hsoft hsoft self-assigned this May 6, 2019

@hsoft

This comment has been minimized.

Copy link
Owner

commented May 6, 2019

Does it crash on you only when you open that specific file? Did you try working on a new file to see if it crashes as well?

@nruri

This comment has been minimized.

Copy link
Author

commented May 6, 2019

I'm going to say it's my file. I just freshly imported it from an older version of moneyguru.

I did a quick testing with a new file and created a few account and entries. No crash from doing this.

@hsoft

This comment has been minimized.

Copy link
Owner

commented May 6, 2019

I'm trying to reproduce the problem but it's not easy without the file itself. Of course, you can't really send it to me due to it being sensitive data, so I would need you to help me and try a few things so I can isolate the problem.

  1. Do you only get a crash when you change entries? If you play with your file without modifying it, you get no crash anywhere? Try changing date range etc..
  2. Do you get the crash when editing an existing entry or only when adding a new entry?
  3. Do you get the crash when you don't change the date?
  4. Do you get the crash when you don't change assigned account(s)?
  5. Do you get the crash when manipulating transactions from the Transactions pane (rather than Account panes)?
@nruri

This comment has been minimized.

Copy link
Author

commented May 8, 2019

Let me answer these the best I can.

Do you only get a crash when you change entries? If you play with your file without modifying it, you get no crash anywhere? Try changing date range etc..

  • When I change the Month (May 2019 -> June 2019), it will crash.
  • Changing the date doesn't crash it immediately. If I switch Tabs to a new account after changing a date it crashes.

Do you get the crash when editing an existing entry or only when adding a new entry?

  • Adding a New entry is okay. I can create a new entry and switch tabs without crashes.
  • I can add a new entry and reconcile it without a crash.
  • I can add a new entry, then goto an existing record to reconcile it, it crashes

Do you get the crash when you don't change the date?

  • No crashes if I don't change a date (on existing) - reconciling can cause a crash.

Do you get the crash when you don't change assigned account(s)?

  • No crash. Only when changing a scheduled entry.

Do you get the crash when manipulating transactions from the Transactions pane (rather than Account panes)?

  • No crash if I use the Transaction Pane. Adding a new entry is okay. Modifying an existing one is also okay. Modifying a Scheduled Entry is also okay.

I did all the testing by killing and restarting moneyguru when it crashed (sometimes I can't even close the program and had to use kill) and for each test scenario. As I was going through the test cases for you I noticed that the crashes were happening on my Scheduled transactions.

  • Crashes when the Date is changed
  • Crashes when a reconcile date is entered.

Hope this helps.

@hsoft

This comment has been minimized.

Copy link
Owner

commented May 8, 2019

Thanks, I think it will help me find the root cause of this.

@hsoft

This comment has been minimized.

Copy link
Owner

commented May 8, 2019

Are you technical enough to build from source? A couple of days ago I fixed a bug that might be our cause. Do you still get crashes when you run from master?

@hsoft

This comment has been minimized.

Copy link
Owner

commented May 8, 2019

Also, another thing to try if you build from source would be to comment out this line: https://github.com/hsoft/moneyguru/blob/master/ccore/py_ccore.c#L3068 . It will cause a memory leak, but if it fixes the crashes, it gives us a better idea of the cause.

@hsoft

This comment has been minimized.

Copy link
Owner

commented May 8, 2019

Wait a second... Are you already on master (rather than 3.0.0)? I think I managed to reproduce the crash you describe, but it only seems to work on master because the over-caching bug that I fixed a couple of days ago prevented moneyGuru from crashing in this particular instance.

If you're on master, could you try running on the 3.0.0 tag and see if you get the crashes?

@hsoft

This comment has been minimized.

Copy link
Owner

commented May 8, 2019

I think I have it:

  1. Be on master
  2. New document, yearly date range
  3. New account, open pane
  4. New entry, today's date. no content. In this case: 08-05-2019
  5. Make schedule from entry. Default values (monthly schedule), save.
  6. Select 3rd spawn (4th entry). In this case: 08-08-2019
  7. Lower the date enough to go to the previous month. In this case, 31-07-2019. Select "All future occurrences"
  8. Select the last visible spawn. In this case, 31-12-2019. Make it one day earlier. "All future occurrences".
  9. Crash

I tried a couple of other things that also crashed, but it was hard to find something that crashed reliably. These steps below crash rather reliably here. I'll see if I can write a test that crashes as reliably and then fix the bug.

@hsoft

This comment has been minimized.

Copy link
Owner

commented May 8, 2019

Yay, I have a test that reliably crashes.

hsoft added a commit that referenced this issue May 8, 2019

@hsoft

This comment has been minimized.

Copy link
Owner

commented May 8, 2019

@nruri does this commit above fix the problem on your side?

@nruri

This comment has been minimized.

Copy link
Author

commented May 9, 2019

Are you technical enough to build from source?
I can probably figure it out.
A couple of days ago I fixed a bug that might be our cause. Do you still get crashes when you run from master?
I believe that version I'm using right now was pulled from master a few days ago. (May 6 most likely)
The git command I used was : git clone --depth=50 --branch=master https://github.com/hsoft/moneyguru.git hsoft/moneyguru

I re-pulled from git under a new path and did:
-make
-make run

It looks much better now! I was able to reconcile the dates, switch accounts and reconcile.
Add a new entry to an existing account. Adding a New Entry to the Schedules.

As I was playing around with the screens I did get a crash log, but I can open a separate ticket once if I can reproduce it reliably.

Thanks!

@hsoft

This comment has been minimized.

Copy link
Owner

commented May 9, 2019

Ok, let's do that.

@hsoft hsoft closed this May 9, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.