angr / angr-management

The official angr GUI.
BSD 2-Clause "Simplified" License
868 stars 109 forks source link

qt exception triggered when loading simple binary #335

Open zardus opened 3 years ago

zardus commented 3 years ago

The exception:

/home/yans/code/angr-dev/angr-management/angrmanagement/ui/widgets/qlinear_viewer.py:302: RuntimeWarning: libshiboken: Overflow: Value 18560471431 exceeds limits of type  [signed] "i" (4bytes).
  self.verticalScrollBar().setRange(0, self.max_offset * self._line_height - self.height() // 2)
ERROR   | 2021-06-28 14:48:00,832 | angrmanagement.data.jobs.cfg_generation | Exception occurred in CFGGenerationJob.finish().
Traceback (most recent call last):
  File "/home/yans/code/angr-dev/angr-management/angrmanagement/data/jobs/cfg_generation.py", line 59, in finish
    super(CFGGenerationJob, self).finish(inst, result)
  File "/home/yans/code/angr-dev/angr-management/angrmanagement/data/jobs/job.py", line 22, in finish
    gui_thread_schedule_async(self._on_finish)
  File "/home/yans/code/angr-dev/angr-management/angrmanagement/logic/threads.py", line 150, in gui_thread_schedule_async
    callable()
  File "/home/yans/code/angr-dev/angr-management/angrmanagement/ui/workspace.py", line 112, in on_cfg_generated
    self.view_manager.first_view_in_category('disassembly')._linear_viewer.initialize()
  File "/home/yans/code/angr-dev/angr-management/angrmanagement/ui/widgets/qlinear_viewer.py", line 236, in initialize
    self.refresh()
  File "/home/yans/code/angr-dev/angr-management/angrmanagement/ui/widgets/qlinear_viewer.py", line 210, in refresh
    self._update_size()
  File "/home/yans/code/angr-dev/angr-management/angrmanagement/ui/widgets/qlinear_viewer.py", line 302, in _update_size
    self.verticalScrollBar().setRange(0, self.max_offset * self._line_height - self.height() // 2)
OverflowError

The linear view doesn't work afterwards, and clicking it again causes angr-management to become unresponsive, take up all my RAM, and get oomkilled.

File attached.

a.gz

rhelmot commented 3 years ago

> simple binary > gigabyte-large bss

zardus commented 3 years ago

Hahaha, I have no idea how that happened to that binary... It was supposed to be a simple input checker :-)

rhelmot commented 3 years ago

:/

rhelmot commented 3 years ago

suggested solution: 1) when the view gets too large switch the scrollbar to step per-line instead of per-pixel. 2) only render the on-screen bytes in qmemory_data_block

ltfish commented 3 years ago

We should redesign how QMemoryDataBlock works. It should never render that much data immediately.

But I believe this issue has a different cause...

github-actions[bot] commented 2 years ago

This issue has been marked as stale because it has no recent activity. Please comment or add the pinned tag to prevent this issue from being closed.