jevey / idapython

Automatically exported from code.google.com/p/idapython
Other
1 stars 0 forks source link

wxPython GUI Freeze #50

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Windows 7 - IDA 5.5 with IDAPython 1.2.0

Trying to write a plugin for IDAPython using wxPython has freezing issues 
due to IDAPython watchdog timer.

I have created a GUI using wxWidgets, which works fine, but once one of the 
button callbacks is called I get the "Please wait... Running Python script" 
watchdog dialog popup.  This popup causes the wxPython GUI to be frozen and 
unusable.  Clicking cancel on the "Please wait" dialog does not close the 
script and IDA must be forcefully terminated.

I was able work my way around this problem by making sure any GUI event 
handlers also exit the GUI.  This means that my GUI can, at most, can 
execute one action, and then exit.  If any of my handlers do not exit the 
script, I get this problem.

I could recompile a version of the IDAPython plw that would remove the 
watchdog timer, but I don't think this should be necessary.

To reproduce this problem, run any example wxPython script from 
http://wiki.wxpython.org/Getting%20Started that has an event handler in it.

Thank you for any feedback

Original issue reported on code.google.com by vancouve...@gmail.com on 6 May 2010 at 3:01

GoogleCodeExporter commented 9 years ago
I managed to come up with a temporary workaround to this problem.  I added a 
time.sleep of 3.0 seconds before showing my GUI.  This sneaks past the watchdog 
timer 
and doesn't freeze IDA or wxWidgets.

I expanded this into a wx.ProgressDialog that shows a loading bar to the user 
so they 
know what's happening.  It will still be great to have a total fix to this 
problem.

Original comment by vancouve...@gmail.com on 6 May 2010 at 4:48

GoogleCodeExporter commented 9 years ago
Hello,

What about adding an API to allow one to disable this wait box voluntarily for 
example?

By default it is on, but script writers can turn it off before showing dialogs 
for 
instance?

Original comment by elias.ba...@gmail.com on 14 May 2010 at 8:15

GoogleCodeExporter commented 9 years ago
Btw, in init.py add this line:

idaapi.set_script_timeout(0x7fffffff) <- this should increase the timeout value

Original comment by elias.ba...@gmail.com on 14 May 2010 at 2:35

GoogleCodeExporter commented 9 years ago
Thanks, that completely fixes my problem.  Wish I had found that API sooner.

Original comment by vancouve...@gmail.com on 17 May 2010 at 12:28

GoogleCodeExporter commented 9 years ago
With IDAPython 1.4.0+ you can disable the script timeout completely with 
set_script_timeout(0)

Original comment by elias.ba...@gmail.com on 2 Jul 2010 at 4:12