SegmentationViolation while analyzing an ELF file
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 6.2k
- Forks
- 726
- Avg merge
- 11d 11h
- Merged PRs (30d)
- 7
Description
Dear Developers,
Good afternoon. The description of the issue follows below:
### Description
SegmentationViolation while analyzing an ELF file (on Windows and Linux -- versions 7.4.0, 7.3.0 and 7.2.0 ).
### Steps to Reproduce
**capa test.bin
capa -v test.bin**
(binary hash: **06abc46d5dbd012b170c97d142c6b679183159197e9d3f6a76ba5e5abf999725**)
**Actual behavior:**
While running capa (in multiple versions on Windows and Linux), the output is shown below (with and without --debug option).
The relevant error message is:
**_Traceback (most recent call last):
File "main.py", line 1109, in
File "main.py", line 996, in main
File "main.py", line 839, in get_extractor_from_cli
File "loader.py", line 290, in get_extractor
File "loader.py", line 161, in get_workspace
File "viv_utils/__init__.py", line 118, in getWorkspace
File "vivisect/__init__.py", line 2891, in loadFromFile
File "vivisect/parsers/elf.py", line 32, in parseFile
File "vivisect/parsers/elf.py", line 616, in loadElfIntoWorkspace
File "envi/memory.py", line 213, in readMemoryPtr
File "envi/memory.py", line 195, in readMemValue
File "envi/memory.py", line 607, in readMemory
envi.exc.SegmentationViolation: SegmentationViolation('Bad Memory Read (invalid memory address): 0x0: 0x8')
[PYI-171278:ERROR] Failed to execute script 'main' due to unhandled exception!_**
To the output including --debug option, I pasted only the beginning and the ending:



### Versions
Affected versions: 7.4.0, 7.3.0, 7.2.0 (Windows and Linux)
OS: Linux Ubuntu 24.04.1 x64 LTS (full-updated) ; Windows 11 x64 (full-updated)
### Additional Information
As I have explained above, the binary's hash that causes the problem is: **06abc46d5dbd012b170c97d142c6b679183159197e9d3f6a76ba5e5abf999725**
**I've found this issue while using Python 3.12.3 (on Linux) and Python 3.11.3 (on Windows).**
Contributor 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.
Research direction
Start with the reported reproduction commands and traceback, then inspect main.py, loader.py, vivisect/parsers/elf.py, and envi/memory.py at the cited call path. Use the supplied binary hash to obtain test.bin if available and confirm the failure during ELF analysis. Done means capa analyzes the file without an unhandled SegmentationViolation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- reverse-engineering
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100