Serazahr / ardb

Anarch Revolt Deck Builder
GNU General Public License v2.0
0 stars 0 forks source link

Importing inventory crashes ARDB on OS X #75

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Open ARDB 3.1.0 or 2.9.0a on OS X 10.6.4 (only OS tested)
2. Import inventory.xml saved by either program
3. Program crashes

What is the expected output? What do you see instead?
I expect invetory to be updated. Instead program crashes (both versions).

What version of the product are you using? On what operating system?
ARDB 2.9.0a & 3.1.0. OS X 10.6.4

Please provide any additional information below.

Original issue reported on code.google.com by j.woeldi...@gmail.com on 27 Jul 2010 at 1:25

GoogleCodeExporter commented 9 years ago
On Mac OS 10.5.8 using ARDB version 3.1.0 I followed the steps below:

- Open ARDB
- From the menu bar: Inventory -> Open -> Select the xml file
- Verify that the deck is loaded successfully using Deck Builder (Command + D)

So, I cannot reproduce this on Mac OS Leopard.

Can you attach the crash report as a text file here?

Original comment by gokturk....@gmail.com on 29 Jul 2010 at 11:24

GoogleCodeExporter commented 9 years ago
Can you also attach you inventory file.  The problem may be in the XML.

Graham.

Original comment by graham.r...@gmail.com on 30 Jul 2010 at 6:05

GoogleCodeExporter commented 9 years ago
Crash report and inventory xml included. 

I have started to suspect a malformed XML myself. I saved a new inventory.xml 
from 3.1.0 and later opened it succesfully in 3.1.0. When I attempt to open an 
older version of the inventory created by 2.9.0a it still crashes 3.1.0 (thats 
the XML and the error report I included).

Original comment by j.woeldi...@gmail.com on 30 Jul 2010 at 7:12

Attachments:

GoogleCodeExporter commented 9 years ago
I dumped the binary image of ARDB 3.1.0 and checked the line 0x000657c4. It 
seems that the following lines are causing the problem:

in inventorymodel.cpp:
#line 613
    for(int i = 0; i < size; i++) {
    if(i % updateAt == 0) {
            if (updateCount < 100) {
                progressDlg.Update(updateCount++);
            }
        }
#line 620

And the only possible operation that might cause "division by zero" error is "i 
% updateAt" operation where updateAt is 0. This leads us to an xml parsing 
error because the only situation updateAt becomes 0 is when the 
    size = (nodes) ? nodes->nodeNr : 0;
line assigns 0 to size.

Original comment by gokturk....@gmail.com on 31 Jul 2010 at 11:49