Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_tracer.py test_basics prints stack trace #150

Open
smcpeak opened this issue Jan 26, 2024 · 0 comments
Open

test_tracer.py test_basics prints stack trace #150

smcpeak opened this issue Jan 26, 2024 · 0 comments

Comments

@smcpeak
Copy link
Contributor

smcpeak commented Jan 26, 2024

When tests/test_tracer.py is run, the test_basics test (which is the only test) prints a stack trace:

$ python3 -m unittest -v tests/test_tracer.py 
test_basics (tests.test_tracer.TestTracer) ... Exception in thread Thread-1:
Traceback (most recent call last):
  File "/home/scott/opt/python-3.9.13/lib/python3.9/threading.py", line 980, in _bootstrap_inner
    self.run()
  File "/home/scott/opt/python-3.9.13/lib/python3.9/threading.py", line 917, in run
    self._target(*self._args, **self._kwargs)
  File "/home/scott/wrk/frida/frida-tools/frida_tools/reactor.py", line 70, in _run
    work()
  File "/home/scott/wrk/frida/frida-tools/frida_tools/tracer.py", line 363, in <lambda>
    self._reactor.schedule(lambda: self._on_message(message, data, ui))
  File "/home/scott/wrk/frida/frida-tools/frida_tools/tracer.py", line 402, in _on_message
    handled = self._try_handle_message(*params)
  File "/home/scott/wrk/frida/frida-tools/frida_tools/tracer.py", line 433, in _try_handle_message
    self._script.post(response)
AttributeError: 'NoneType' object has no attribute 'post'
ok

----------------------------------------------------------------------
Ran 1 test in 0.515s

OK

After some preliminary debugging, it seems that self._script is None at the call point because the stop method has already been called. But I can't tell if the _try_handle_message method should gracefully handle that (presumably by just returning, but True or False?) or if the problem is with the way the test works.

It's also troubling that the failure causing this stack trace to be printed does not also cause the test to fail.

frida-tools version c10668f
Python 3.9.13
Linux Mint 20.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant