You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When importing an (object) file with many sections, the import crashes with the following exception:
ERROR REPORT: Unique space id must be between 0 and 32767 inclusive (HeadlessAnalyzer) java.lang.IllegalArgumentException: Unique space id must be between 0 and 32767 inclusive
at ghidra.program.model.address.AbstractAddressSpace.<init>(AbstractAddressSpace.java:70)
at ghidra.program.model.address.OverlayAddressSpace.<init>(OverlayAddressSpace.java:36)
at ghidra.program.database.ProgramOverlayAddressSpace.<init>(ProgramOverlayAddressSpace.java:45)
at ghidra.program.database.ProgramAddressFactory.addOverlaySpace(ProgramAddressFactory.java:180)
at ghidra.program.database.OverlaySpaceDBAdapterV1.createOverlaySpace(OverlaySpaceDBAdapterV1.java:89)
at ghidra.program.database.ProgramDB.createOverlaySpace(ProgramDB.java:1205)
at ghidra.program.database.mem.MemoryMapDB.createUniqueOverlaySpace(MemoryMapDB.java:662)
at ghidra.program.database.mem.MemoryMapDB.createOverlaySpace(MemoryMapDB.java:636)
at ghidra.program.database.mem.MemoryMapDB.createInitializedBlock(MemoryMapDB.java:752)
at ghidra.app.util.MemoryBlockUtils.createInitializedBlock(MemoryBlockUtils.java:227)
at ghidra.app.util.opinion.ElfProgramBuilder.createInitializedBlock(ElfProgramBuilder.java:3727)
at ghidra.app.util.opinion.MemorySectionResolver.processSectionRanges(MemorySectionResolver.java:391)
at ghidra.app.util.opinion.MemorySectionResolver.resolveSectionMemory(MemorySectionResolver.java:310)
at ghidra.app.util.opinion.MemorySectionResolver.resolve(MemorySectionResolver.java:286)
at ghidra.app.util.opinion.ElfProgramBuilder.load(ElfProgramBuilder.java:140)
at ghidra.app.util.opinion.ElfProgramBuilder.loadElf(ElfProgramBuilder.java:111)
at ghidra.app.util.opinion.ElfLoader.load(ElfLoader.java:147)
at ghidra.app.util.opinion.AbstractLibrarySupportLoader.doLoad(AbstractLibrarySupportLoader.java:864)
at ghidra.app.util.opinion.AbstractLibrarySupportLoader.loadProgram(AbstractLibrarySupportLoader.java:107)
at ghidra.app.util.opinion.AbstractProgramLoader.load(AbstractProgramLoader.java:129)
at ghidra.app.util.importer.AutoImporter.importFresh(AutoImporter.java:723)
at ghidra.app.util.importer.AutoImporter.importFresh(AutoImporter.java:633)
at ghidra.app.util.importer.AutoImporter.importByLookingForLcs(AutoImporter.java:342)
at ghidra.app.util.headless.HeadlessAnalyzer.loadPrograms(HeadlessAnalyzer.java:1658)
at ghidra.app.util.headless.HeadlessAnalyzer.processFileWithImport(HeadlessAnalyzer.java:1538)
at ghidra.app.util.headless.HeadlessAnalyzer.processWithLoader(HeadlessAnalyzer.java:1745)
at ghidra.app.util.headless.HeadlessAnalyzer.processWithImport(HeadlessAnalyzer.java:1686)
at ghidra.app.util.headless.HeadlessAnalyzer.processWithImport(HeadlessAnalyzer.java:1770)
at ghidra.app.util.headless.HeadlessAnalyzer.processLocal(HeadlessAnalyzer.java:457)
at ghidra.app.util.headless.AnalyzeHeadless.launch(AnalyzeHeadless.java:198)
at ghidra.GhidraLauncher.launch(GhidraLauncher.java:81)
at ghidra.Ghidra.main(Ghidra.java:54)
To Reproduce
Unfortunately I cannot share the binary in question, but any file with enough sections should exhibit this behaviour. This comes up somewhat-commonly when compilers produce function-sections (i.e. one section per function).
Expected behavior
There's no reason for this limitation, so Ghidra should be able to load the file normally.
Environment (please complete the following information):
OS: Manjaro
Java Version: 21
Ghidra Version: 11.3.1
Ghidra Origin: Locally built, but no modifications related to this at all.
The text was updated successfully, but these errors were encountered:
I did some more digging and maybe it's not the text sections that cause this, but all the other, non-loaded sections. They are all thrown into the address space "other" and thus have to be distinguished by the unique space id, which is limited to 30k. There's around 90k sections total and roughly a 8:1 ratio of non-loaded to loaded sections, so loaded sections alone should not hit the limit (if they use this sort of space id at all).
Describe the bug
When importing an (object) file with many sections, the import crashes with the following exception:
To Reproduce
Unfortunately I cannot share the binary in question, but any file with enough sections should exhibit this behaviour. This comes up somewhat-commonly when compilers produce function-sections (i.e. one section per function).
Expected behavior
There's no reason for this limitation, so Ghidra should be able to load the file normally.
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: