plasma-disassembler / plasma

Plasma is an interactive disassembler for x86/ARM/MIPS. It can generates indented pseudo-code with colored syntax.
GNU General Public License v3.0
3.05k stars 275 forks source link

TypeError exception randomly triggered when disassembling unexistant symbols #34

Closed epinna closed 9 years ago

epinna commented 9 years ago

As reported in the subject.

$ python3 reverse.py /bin/ls -x asd
error: symbol asd not found
error: Try with --sym to see all symbols.
error: If you have set the option --dump or --calls you need to set
error: the option -x (see --help).
Exception ignored in: <bound method Cs.__del__ of <capstone.Cs object at 0x7f48d81a8d68>>
Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/capstone/__init__.py", line 696, in __del__
TypeError: 'NoneType' object is not callable

Another minor issue here: the --sym option does not exists, you may intend --symbol. Please note that the exception is randomly triggered (maybe 1 out of 5 executions). Let me know if can't reproduce it and need further information.

ghost commented 9 years ago

Yes I've already seen this exception. After an internal error I call sys.exit like here, I think Capstone try to exit properly and sometimes it triggers an exception. I haven't look for an issue yet.

Maybe by doing something like this ?

try:
   sys.exit(1)
except:
   pass

Thanks.

epinna commented 9 years ago

I don't know - maybe it's worth to create a script to reproduce it reliably and open an issue to capstone

ghost commented 9 years ago

Bug submitted on capstone #387

ghost commented 9 years ago

Fixed on capstone aquynh/capstone@3808eec03330341a09f8017c5370dbf6a4fa1c13

epinna commented 9 years ago

Thanks