ghidra: DumpFileLoader: IndexOutOfBoundsException

Describe the bug I hope it’s not too soon to open an issue for this as it was recently added. Anyway, most of the time loading a dump file from procdump results in an IndexOutOfBoundsException.

To Reproduce Steps to reproduce the behavior:

  1. Try to import attached dump of demangler_gnu_v2_33_1 (couldn’t find the decompiler process and it wouldn’t let me do Ghidra)

Attachments

stacktrace
2022-06-16 19:33:50 ERROR (ImporterUtilities) Error Importing File: Error importing file: demangler_gnu_v2_33_1.exe_220616_193343.dmp java.lang.IndexOutOfBoundsException: Specified length extends beyond file bytes length
	at ghidra.program.database.mem.MemoryMapDB.checkFileBytesRange(MemoryMapDB.java:697)
	at ghidra.program.database.mem.MemoryMapDB.createInitializedBlock(MemoryMapDB.java:660)
	at ghidra.app.util.MemoryBlockUtils.createInitializedBlock(MemoryBlockUtils.java:227)
	at ghidra.file.formats.dump.DumpFileLoader.loadRanges(DumpFileLoader.java:183)
	at ghidra.file.formats.dump.DumpFileLoader.parseDumpFile(DumpFileLoader.java:150)
	at ghidra.file.formats.dump.DumpFileLoader.load(DumpFileLoader.java:122)
	at ghidra.app.util.opinion.AbstractLibrarySupportLoader.doLoad(AbstractLibrarySupportLoader.java:356)
	at ghidra.app.util.opinion.AbstractLibrarySupportLoader.loadProgram(AbstractLibrarySupportLoader.java:84)
	at ghidra.app.util.opinion.AbstractProgramLoader.load(AbstractProgramLoader.java:115)
	at ghidra.plugin.importer.ImporterUtilities.importSingleFile(ImporterUtilities.java:368)
	at ghidra.plugin.importer.ImporterDialog.lambda$okCallback$7(ImporterDialog.java:351)
	at ghidra.util.task.TaskBuilder$TaskBuilderTask.run(TaskBuilder.java:306)
	at ghidra.util.task.Task.monitoredRun(Task.java:134)
	at ghidra.util.task.TaskRunner.lambda$startTaskThread$0(TaskRunner.java:106)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:829)

demangler_gnu_v2_33_1.exe_220616_193343.zip

Environment (please complete the following information):

  • OS: Microsoft Windows [Version 10.0.22000.708]
  • Java Version: 11
  • Ghidra Version: Approximately f0089b8efb5f0ab2717154d8b67676b673c4b561
  • Ghidra Origin: [e.g. official GitHub distro, third party distro, locally built]

Additional context I do have more, mostly enhancements I think, related to the new loaders. I don’t want to open a ton of things that might just be making their way through the pipeline though.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 17 (8 by maintainers)

Most upvoted comments

@ghidra1 has tweaked the options so they CAN be set per-dump-type now, so I feel like we can do whatever we feel is best. I just don’t have a good sense of what actually would be best. I don’t want to set the default to something most users won’t tolerate, and making a decision based on some arbitrary size cutoff feels a bit dodgy.

Revisited and (surprise) definitely an error on my part. Not doing the right thing for the CommentStreams (which were missing in my test examples), resulting in bad blocks that exceeded the file bounds. Fix in the queue…