DFHack / df-structures

Dwarf Fortress data structure descriptions
https://github.com/DFHack/dfhack
114 stars 81 forks source link

invalid vectors on linux32 #370

Closed cvuchener closed 4 years ago

cvuchener commented 4 years ago

Tested on linux32 using DFHack/dfhack@e267876 and c0edb62

(*world.status.spoils_reports[0]).mat_types (0xd636bb3c): invalid vector (Invalid capacity)
d636bb20     d636bbe0 d636bbe8 d636bbe8 d636bbf0
d636bb30     d636bbf8 d636bbf8 d636bc00 d636bc08
d636bb40     d636bc08 d6354fc0 d6354fd0 d6354fd0
d636bb50     d636bc10 d636bc20 d636bc20 d636bc30
(*world.status.spoils_reports[0]).creature_counts (0xd636bb78): invalid vector (Invalid capacity)
d636bb60     d636bc38 d636bc38 d636bc40 d636bc48
d636bb70     d636bc48 d636bc50 d636bc58 d636bc58
d636bb80     00000000 00000000 00000000 00000055
d636bb90     00000030 00000030 00000000 696f7053
(*world.status.spoils_reports[1]).creature_counts (0xd636bcc8): invalid vector (Invalid capacity)
d636bcb0     d636bd38 d636bd38 d636bd40 d636bd48
d636bcc0     d636bd48 d636bd50 d636bd58 d636bd58
d636bcd0     00000000 00000000 00000000 00000055
d636bce0     00000030 00000030 00000000 696f7053
(*world.status.spoils_reports[2]).creature_counts (0xd636bdc8): invalid vector (Invalid capacity)
d636bdb0     d636be84 d636be84 d636be90 d636be94
d636bdc0     d636be94 d636bea0 d636bea4 d636bea4
d636bdd0     00000000 00000000 00000000 00000055
d636bde0     00000031 00000031 00000000 696f7053
(*world.crimes.all[1]).reports (0xdffd2734): invalid vector (Unaligned pointer)
dffd2720     ffffffff 00000000 00000000 000000c5
dffd2730     00000002 00000000 0000000a 00000001
dffd2740     00000000 00003bd2 0000fe4f 0000fe4f
(*world.crimes.all[2]).reports (0xdffd27f4): invalid vector (Unaligned pointer)
dffd27e0     ffffffff 00000000 00000000 000000c5
dffd27f0     00000003 00000000 00000001 00000004
dffd2800     00000000 00003d62 ffffffff ffffffff
(*world.crimes.all[3]).reports (0xdffd28b4): invalid vector (Unaligned pointer)
dffd28a0     ffffffff 00000000 00000000 000000c5
dffd28b0     00000004 00000000 00000003 00000001
dffd28c0     00000000 00003bdd 0000fe5a 0000fe5a
(*world.crimes.all[4]).reports (0xdffd2974): invalid vector (Unaligned pointer)
dffd2960     ffffffff 00000000 00000000 000000c5
dffd2970     00000005 00000000 00000005 00000003
dffd2980     00000000 00003c50 0000ff06 0000ff06
(*world.crimes.all[5]).reports (0xdffd2a34): invalid vector (Unaligned pointer)
dffd2a20     ffffffff 00000000 00000000 000000c5
dffd2a30     00000006 00000000 00000005 00000001
dffd2a40     00000000 0000116e 0000cf71 0000cf71
lethosor commented 4 years ago

If you're able to test easily, is this still an issue? (Note that I have no idea if this has been touched since you opened this issue, although I did poke around at the justice screen on linux64 recently in case that's relevant)

cvuchener commented 4 years ago

Yes, it is still happening with fd4b705e36d8b90bf8380849fd074672fd6d6f0d.

lethosor commented 4 years ago

I don't seem to have a world with spoils handy, but I confirmed the second issue (with crime.reports) as of 8427f518c941f8e5734e98f2ff56648522f1281b.

cvuchener commented 4 years ago

I found this issues using this save from PatrikLundell.

lethosor commented 4 years ago

In crime, the two integers around the three convicted_hf* int32s are actually just padding. This may also be the case around victim_hf*. Not sure what the proper layout is, but I will continue experimenting.

lethosor commented 4 years ago

I found this issues using this save from PatrikLundell.

Wow, check-structures-sanity is picking up a lot of issues in this save. Most of them appear to be minor. I'll just focus on spoils_report for now, but this will be useful for testing (thanks @PatrikLundell!).

lethosor commented 4 years ago

The spoils_report issue was an unknown field that was actually just padding, so it didn't exist on i386: https://github.com/DFHack/df-structures/blame/9bf18dfc6647e1ff51deddac9da042baa1655987/df.world.xml#L329 This dates back to 2018, so this was a really old issue - nice catch!

lethosor commented 4 years ago

Forgot to link in a106b5e98381184004fa9dfff44072239755e554, but this is fixed now