[Bug]: Campaign upgrade falls over on large campaigns
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 32/100
Research direction
Campaign load runs a version check that reads the whole embedded content.xml into memory and applies regexes. Start from the campaign-upgrade / content.xml load path (search for the OutOfMemoryError message and content.xml). Done means a campaign whose content.xml exceeds 2GiB can be upgraded without allocating a single huge array, using streaming or a real XML transform instead of regex on the full file.
Written by the indexing model from the issue text.
Description
Describe the Bug
When loading a campaign, a version check is done to see whether any data in the campaign needs to be modified to work in the current version of MapTool. In particular, this is applied to the embedded content.xml file by loading the entire file into memory, then applying regular expressions to modify the XML.
In addition to the problem of regexes being insufficient for transforming general XML, this approach prevents upgrading campaigns whose content.xml is greater than ~2GiB.
To Reproduce
- Create a campaign in 1.14.3 or earlier.
- Populate the campaign with many maps containing many tokens, until the saved campaign has a
content.xmlover 2,147,483,647 bytes in size. - Load the campaign in 1.15.0 or later.
- Notice this message get shown:
Out of memory while reading campaign. java.lang.OutOfMemoryError: Required array length 2147483638 + 10 is too large
Expected Behaviour
Any campaign that can be saved and loaded in one version of MapTool can also be loaded in later versions (assuming system resources are available for the upgrade).
Screenshots
No response
MapTool Info
All versions
Desktop
Linux Mint 22.3
Additional Context
No response
- Dominant language
- Java
- Stars
- 927
- Forks
- 286
- Avg merge
- 3d 17h
- Merged PRs (30d)
- 94
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from RPTools/maptool
-
[Bug]: An initiative list with no current entry logs an error on every changePossibly taken @dwizard0 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
[Maintenance]: Migrate gradle dependency submission to modern alternativePossibly taken @VelpulaGangavardhan claimed this 18 days ago. Opencode-maintenance
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
RPTools/maptool#6156 · 2 comments · 1 assignee ·
Maintainers usually reply within 1 day
-
code-maintenance
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
feature
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
Similar issues
-
Cleanup: restore the interrupt flag in AiFailureAnalyzerPossibly taken @Rishankgupta08 claimed this today. Opengood first issue
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
seleniumboot/selenium-boot#258 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
johanhaleby/occurrent#1505 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
FasterXML/jackson-databind#6443 ·
Maintainers usually reply within 1 day
-
Docs: 2 broken linksOpen
Difficulty 1/5 Under an hour Newbie friendliness 78/100
Maintainers usually reply within 1 day