You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ERROR:panoramix.decompiler:Problem with name()
Traceback (most recent call last):
File "/opt/homebrew/lib/python3.9/site-packages/panoramix/decompiler.py", line 177, in _decompile_with_loader
trace = dec()
File "/opt/homebrew/lib/python3.9/site-packages/timeout_decorator/timeout_decorator.py", line 75, in new_function
old = signal.signal(signal.SIGALRM, handler)
File "/opt/homebrew/Cellar/[email protected]/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/signal.py", line 47, in signal
handler = _signal.signal(_enum_to_int(signalnum), _enum_to_int(handler)) ValueError: signal only works in main thread of the main interpreter
This happens because panoramix in one place uses timeout-decorator library.
Precisely here in panoramix/decompiler.py
timeout_decorator project actually describes this problem here:
Multithreading
By default, timeout-decorator uses signals to limit the execution time of the given function. This appoach does not work if your function is executed not in a main thread (for example if it’s a worker thread of the web application). There is alternative timeout strategy for this case - by using multiprocessing. To use it, just pass use_signals=False to the timeout decorator function:
But just adding use_signals=False would not work as the object is sophisticated enough and can not be pickled which is required by the multiprocessing module
This solves the failure to work not in main thread problem and should also solve not working in Windows problem (although I can not test the second statement)
I can submit a pull request, just let me know
The text was updated successfully, but these errors were encountered:
ERROR:panoramix.decompiler:Problem with name()
Traceback (most recent call last):
File "/opt/homebrew/lib/python3.9/site-packages/panoramix/decompiler.py", line 177, in _decompile_with_loader
trace = dec()
File "/opt/homebrew/lib/python3.9/site-packages/timeout_decorator/timeout_decorator.py", line 75, in new_function
old = signal.signal(signal.SIGALRM, handler)
File "/opt/homebrew/Cellar/[email protected]/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/signal.py", line 47, in signal
handler = _signal.signal(_enum_to_int(signalnum), _enum_to_int(handler))
ValueError: signal only works in main thread of the main interpreter
This happens because panoramix in one place uses
timeout-decorator
library.Precisely here in panoramix/decompiler.py
timeout_decorator project actually describes this problem here:
Multithreading
By default, timeout-decorator uses signals to limit the execution time of the given function. This appoach does not work if your function is executed not in a main thread (for example if it’s a worker thread of the web application). There is alternative timeout strategy for this case - by using multiprocessing. To use it, just pass use_signals=False to the timeout decorator function:
But just adding
use_signals=False
would not work as the object is sophisticated enough and can not be pickled which is required by themultiprocessing
moduleSo the full solution to this problem is:
pip install wrapt_timeout_decorator
add to panoramix/decompiler.py
with
This solves the failure to work not in main thread problem and should also solve not working in Windows problem (although I can not test the second statement)
I can submit a pull request, just let me know
The text was updated successfully, but these errors were encountered: