Yesterday I went on a map collecting spree again, this time it raised the total number of h3m files in my Maps folder to about 6,500. I then found out that WoG crashed with an access violation whenever I clicked on New Game -> Scenario. Further analysis showed that I could prevent the crash when I reduced the number of h3m files to about 5,020. When I added a single additional h3m file, WoG crashed again. When I added the *same* file and also removed one other h3m file from the folder, there was no crash. Hence it is evident that this crash happens due to the number of h3m files present, and not due to a corrupt file.
Note: The number of 5,020 is not exact. Some h3m files are apparently ignored by the game (possibly because of illegal characters in the filename) and therefore do not count towards the limit. So the real limit is probably a bit lower - it might be 5,000 *valid* files. If you have slightly more than 5,000 h3m files and do not experience the crash, keep in mind that some of your files may be invalid and the number of *valid* h3m files in your Maps folder might still be less than the limit.
My guess is that WoG, when it reads the h3m files in the map folder, just makes an array of 5,000 entries, happily starts reading files, and crashes when the number of files exceeds the pre-defined array boundary. If so, then simply raising the number to (say) 10,000 would solve the problem.
The crash may be present in non-WoG versions of HoMM3 too - it probably is, but I haven't checked. However, WoG probably has the tools in place to fix the problem, therefore I'm mentioning the problem here.
The problem should be easily reproducible by duplicating an existing, working h3m file until you exceed the limit. This can be done quickly with a batch file. Nevertheless I'm willing to help anybody who wants to tackle the problem and needs some tests to be run. In case it helps, here is the WOGCRASHLOG.TXT:
Code: Select all
Time Stamp: Wed May 27 16:26:33 2009
Map Saved with:
WoG Version: 3 . 58f
Built on Oct 24 2004
EIP = {0x00618813}, Access Violation. Attempt to {write} the inaccessible data at {0x05EE6028}
The Latest Executed ERM Receiver:
Register Context:
EAX = 0x00000020
EBX = 0x0000138B
ECX = 0x0000B455
EDX = 0x00000000
ESI = 0x05EE6028
EDI = 0x05EE6028
EBP = 0x00227758
ESP = 0x00227614
Stack Frame:
0x00227614 : 0x00257120
0x00227618 : 0x00000020
0x0022761C : 0x290DA7C0
0x00227620 : 0x01C9DE3A
0x00227624 : 0x918D1BBA
0x00227628 : 0x01C9DEE3
0x0022762C : 0xC618E200
0x00227630 : 0x01C75507
0x00227634 : 0x00000000
0x00227638 : 0x000098B8
0x0022763C : 0x00000000
0x00227640 : 0x0000000D
0x00227644 : 0x726562DC
0x00227648 : 0x6E656420
0x0022764C : 0x69654620
0x00227650 : 0x6E65646E
0x00227654 : 0x6D33682E
0x00227658 : 0x73657300
0x0022765C : 0x75655020
0x00227660 : 0x682E7372
0x00227664 : 0x2E006D33
0x00227668 : 0x006D3368
0x0022766C : 0x736E6F69
0x00227670 : 0x33682E29
0x00227674 : 0x6B00006D
0x00227678 : 0x62726576
0x0022767C : 0x65737365
0x00227680 : 0x2E297472
0x00227684 : 0x006D3368
0x00227688 : 0x02080040
0x0022768C : 0x00000045
0x00227690 : 0x4627FA00
0x00227694 : 0x00000040
0x00227698 : 0x00000000
0x0022769C : 0x00000003
0x002276A0 : 0x002277A8
0x002276A4 : 0x00000000
0x002276A8 : 0x01000000
0x002276AC : 0x00227768
0x002276B0 : 0x46010000
0x002276B4 : 0x00000000
0x002276B8 : 0x00000000
0x002276BC : 0x7FFDDC40
0x002276C0 : 0x7C920415
0x002276C4 : 0x7C92041E
0x002276C8 : 0x0000A4B3
0x002276CC : 0x0002AB99
0x002276D0 : 0x002279EC
0x002276D4 : 0x00227980
0x002276D8 : 0x00000000
0x002276DC : 0x00227A14
0x002276E0 : 0x00000008
0x002276E4 : 0x00227990
0x002276E8 : 0x7C924202
0x002276EC : 0x002420A8
0x002276F0 : 0x00000000
0x002276F4 : 0x00000000
0x002276F8 : 0x7C98D600
0x002276FC : 0x00156000
0x00227700 : 0x05D90020
0x00227704 : 0x05D90000
0x00227708 : 0x7FFDDC00
0x0022770C : 0x00156000
0x00227710 : 0x00010002
0x00227714 : 0x03560000
0x00227718 : 0x00227510
0x0022771C : 0x00227B84
0x00227720 : 0x00228424
0x00227724 : 0x7C91E900
0x00227728 : 0x7C9201C0
0x0022772C : 0xFFFFFFFF
0x00227730 : 0x7C9201BB
0x00227734 : 0x0061AA5E
0x00227738 : 0x03560000
0x0022773C : 0x00000000
0x00227740 : 0x00155CC0
0x00227744 : 0x0069D663
0x00227748 : 0x44524542
0x0022774C : 0x317E4E45
0x00227750 : 0x4D33482E
0x00227754 : 0x00617400
0x00227758 : 0x00228430
0x0022775C : 0x00582F0B
0x00227760 : 0x00257120
0x00227764 : 0x05EE6028
0x00227768 : 0x0069D663
0x0022776C : 0x0069886E
0x00227770 : 0x00228820
0x00227774 : 0x00730065
0x00227778 : 0x0048005C
0x0022777C : 0x004D006F
0x00227780 : 0x0033004D
0x00227784 : 0x0044005C
0x00227788 : 0x00540041
0x0022778C : 0x005C0041
0x00227790 : 0x00500048
0x00227794 : 0x00310053
0x00227798 : 0x00300031
0x0022779C : 0x006D0042
0x002277A0 : 0x0050002E
0x002277A4 : 0x00580043
0x002277A8 : 0x00000000
0x002277AC : 0x00000000
0x002277B0 : 0x00000000
0x002277B4 : 0x00000000
0x002277B8 : 0x00000000
0x002277BC : 0x00000000
0x002277C0 : 0x00000000
0x002277C4 : 0x00000000
0x002277C8 : 0x00000000
0x002277CC : 0x00000000
0x002277D0 : 0x00000000
0x002277D4 : 0x00000000
0x002277D8 : 0x00000000
0x002277DC : 0x00000000
0x002277E0 : 0x00000000
0x002277E4 : 0x00000000
0x002277E8 : 0x00000000
0x002277EC : 0x00000000
0x002277F0 : 0x00000000
0x002277F4 : 0x00000000
0x002277F8 : 0x00000000
0x002277FC : 0x00000000
0x00227800 : 0x00000000
0x00227804 : 0x00000000
0x00227808 : 0x00000000
0x0022780C : 0x00000000
0x00227810 : 0x00000000
0x00227814 : 0x00000000
0x00227818 : 0x00000000
0x0022781C : 0x00000000
0x00227820 : 0x00000000
0x00227824 : 0x00000000
0x00227828 : 0x00000000
0x0022782C : 0x00000000
0x00227830 : 0x00000000
0x00227834 : 0x00000000
0x00227838 : 0x00000000
0x0022783C : 0x00000000
0x00227840 : 0x00000000
0x00227844 : 0x03560000
0x00227848 : 0x00000091
0x0022784C : 0x044BCB78
0x00227850 : 0x00227A80
0x00227854 : 0x7C921D45
0x00227858 : 0x7C921066
0x0022785C : 0x7C9201BB
0x00227860 : 0x00000000
0x00227864 : 0x00000480
0x00227868 : 0x00000480
0x0022786C : 0x0687F260
0x00227870 : 0x03560000
0x00227874 : 0x0687F260
0x00227878 : 0x03560004
0x0022787C : 0x03560000
0x00227880 : 0x0000009F
0x00227884 : 0x04570EB0
0x00227888 : 0x00227AB8
0x0022788C : 0x7C921D45
0x00227890 : 0x7C921066
0x00227894 : 0x7C9201BB
0x00227898 : 0x00000000
0x0022789C : 0x000004F0
0x002278A0 : 0x000004E8
0x002278A4 : 0x00000004
0x002278A8 : 0x00000000
0x002278AC : 0x06887268
0x002278B0 : 0x03560178
0x002278B4 : 0x000007B3
0x002278B8 : 0x00227AE8
0x002278BC : 0x7C921008
0x002278C0 : 0x7C921066
0x002278C4 : 0x002278F8
0x002278C8 : 0x00240000
0x002278CC : 0x7C920202
0x002278D0 : 0x00000045
0x002278D4 : 0x00241378
0x002278D8 : 0x00240000
0x002278DC : 0x002420A0
0x002278E0 : 0x002278D0
0x002278E4 : 0x00242098
0x002278E8 : 0x00227B14
0x002278EC : 0x7C91E900
0x002278F0 : 0x7C920208
0x002278F4 : 0xFFFFFFFF
0x002278F8 : 0x7C920202
0x002278FC : 0x7C92017B
0x00227900 : 0x7C9201BB
0x00227904 : 0x00000000
0x00227908 : 0x00227E48
0x0022790C : 0x00227E20
0x00227910 : 0x00000000
0x00227914 : 0x00000000
0x00227918 : 0x00000000
0x0022791C : 0x044BCB80
0x00227920 : 0x00000000
0x00227924 : 0x0687E4E8
0x00227928 : 0x03560178
0x0022792C : 0x00001963
0x00227930 : 0x00227B60
0x00227934 : 0x7C921008
0x00227938 : 0x7C921066
0x0022793C : 0x7C9201BB
0x00227940 : 0x00000082
0x00227944 : 0x000006C0
0x00227948 : 0x03C433F0
0x0022794C : 0x0687F268
0x00227950 : 0x0069DA3C
0x00227954 : 0x04570EB8
0x00227958 : 0x00000000
0x0022795C : 0x00000008
0x00227960 : 0x06650000
0x00227964 : 0x00000000
0x00227968 : 0x00000000
0x0022796C : 0x03560000
0x00227970 : 0x000000D9
0x00227974 : 0x0687A7E0
0x00227978 : 0x00227BA8
0x0022797C : 0x7C921D45
0x00227980 : 0x7C921066
0x00227984 : 0x7C9201BB
0x00227988 : 0x0022848C
0x0022798C : 0x000006C0
0x00227990 : 0x0687A7E8
0x00227994 : 0x00000000
0x00227998 : 0x044BCBF0
0x0022799C : 0x00000009
0x002279A0 : 0x00000000
0x002279A4 : 0x066F7718
0x002279A8 : 0x002279FC
0x002279AC : 0x00000009
0x002279B0 : 0x03560000
0x002279B4 : 0x044BCB78
0x002279B8 : 0x03560000
0x002279BC : 0x03560000
0x002279C0 : 0x03560178
0x002279C4 : 0x00227A90
0x002279C8 : 0x7C920961
0x002279CC : 0x05B00000
0x002279D0 : 0x7C92003D
0x002279D4 : 0x03560000
0x002279D8 : 0x06650000
0x002279DC : 0x00001D55
0x002279E0 : 0x00227A04
0x002279E4 : 0x7C9218A0
0x002279E8 : 0x03560000
0x002279EC : 0x066F7718
0x002279F0 : 0x0687C558
0x002279F4 : 0x03560000
0x002279F8 : 0x06650000