inguma / bokken

Dear user: This is a git mirror of our Mercurial repository in https://bokken.inguma.eu that you can use if you prefer to use pull requests. For instructions, latest updates and such visit our main site at http://www.bokken.re and our blog http://ingumadev.blogspot.com.
GNU General Public License v2.0
120 stars 15 forks source link

Add "Turn off callgraphs" option to analysis #15

Open michalmalik opened 9 years ago

michalmalik commented 9 years ago

I tried Bokken on a certain elf executable (20kB) in a VM (VirtualBox) running Gentoo x86 kernel 3.17.7 and Python 2.7.9 with 1GB RAM.

The callgraphs supposedly ate all the RAM and crashed Bokken.

This is the message I got (sorry for the formatting):

dot: graph is too large for cairo-renderer bitmaps. Scaling by 0.914743 to fit /usr/lib/python2.7/site-packages/PIL/Image.py:2192: DecompressionBombWarning: Image size (511132433 pixels) exceeds limit of 89478485 pixels, could be decompression bomb DOS attack. DecompressionBombWarning) Traceback (most recent call last): File "/home/michal/bokken-1.8/ui/rightnotebook.py", line 131, in on_switch self.xdot_box.set_dot(self.uicore.get_callgraph(self.last_fcn)) File "/home/michal/bokken-1.8/ui/graph.py", line 67, in set_dot self.generate_thumbnail(dotcode) File "/home/michal/bokken-1.8/ui/graph.py", line 96, in generate_thumbnail im.convert('RGBA') File "/usr/lib/python2.7/site-packages/PIL/Image.py", line 895, in convert im = self.im.convert(mode, dither) MemoryError

Traceback (most recent call last): File "/home/michal/bokken-1.8/bokken.py", line 76, in <module> bokken() File "/home/michal/bokken-1.8/bokken.py", line 71, in bokken 'radare' if args.radare else '', File "/home/michal/bokken-1.8/ui/main.py", line 395, in main BokkenGTKClient(target, backend) File "/home/michal/bokken-1.8/ui/main.py", line 183, in __init__ self.show_file_data() File "/home/michal/bokken-1.8/ui/main.py", line 223, in show_file_data self.tviews.update_righttext('Disassembly') File "/home/michal/bokken-1.8/ui/textviews.py", line 212, in update_righttext self.main.dasm_process.start() File "/usr/lib/python2.7/multiprocessing/process.py", line 130, in start self._popen = Popen(self) File "/usr/lib/python2.7/multiprocessing/forking.py", line 121, in __init__ self.pid = os.fork() OSError: [Errno 12] Cannot allocate memory

Jo-Con-El commented 9 years ago

Even if we don't do it, we can at least catch the error and keep up with normal operation.

Stenudd commented 8 years ago

Seems to hang during callgraph on my gentoo also with the following output

    Python version...   OK
    Radare availability...  OK
    GTK UI dependencies...  OK
    GtkSourceView2...   OK
    Graphviz binaries...    OK
Starting bokken 1.8, running on:
  Python version:
    2.7.10 (default, Feb 28 2016, 15:59:27) 
    [GCC 4.8.4]
  GTK version: 2.24.27
  PyGTK version: 2.24.0

Function too big at 0x2410dd5e
Function too big at 0x2410dd93
Function too big at 0x2410de1d
Function too big at 0x510be3a
Function too big at 0x20fd898
Function too big at 0xd0ff64d
Function too big at 0x1c3d9a00
Function too big at 0x1d0fa3f5
Function too big at 0x3d1059c3
Function too big at 0x3d1059c3
Function too big at 0x1104eff
Function too big at 0x1104eff
Function too big at 0x1104eff
Function too big at 0x20fd88a
Function too big at 0x14312b2c
Function too big at 0x30fd151
Function too big at 0x1d0fa0e7
Function too big at 0x1d0fa171
Function too big at 0x1d0fa169
Function too big at 0x1c3d9a00
Function too big at 0x80feb53
Function too big at 0x1104eff
Function too big at 0xf1095d9
Function too big at 0x1c3d9a00
Function too big at 0x1107c74
Function too big at 0xf1095d9
Function too big at 0x30fdbb9
Function too big at 0x30fd9d9
Function too big at 0x3d1059c3
After    0 cycles:  ;-- entry0, ;-- sym._GLOBAL__sub_I_g_FileSystemFactory, ;-- entry0:
0x00049490    31 c0               XOR EAX, EAX     ; [9] va=0x00049490 pa=0x00049490 sz=540092 vsz=540092 rwx=-r-x .text
^Z
[1]+  Stopped                 bokken