frida / frida-tools

Frida CLI tools
Other
338 stars 95 forks source link

Error message when using Frida-Tools with Frida 16.0.7: "ValueError: file descriptor cannot be a negative integer" #128

Closed agreenbhm closed 1 year ago

agreenbhm commented 1 year ago

It appears that something in Frida 16.0.7 causes an error message to appear on launch of multiple tools within Frida-Tools (frida-ls-devices and frida-ps have been confirmed). 16.0.6 does not experience the same issue. I've experienced this with Python 3.9, 3.10, and 3.11. Frida-Tools is the latest version (12.0.3). This is on MacOS. See screenshot for example. Error message is:

~/Desktop/objection $ frida-ls-devices
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.11/bin/frida-ls-devices", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/frida_tools/lsd.py", line 109, in main
    app.run()
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/frida_tools/application.py", line 386, in run
    self._reactor.run()
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/frida_tools/reactor.py", line 44, in run
    self._run_until_return(self)
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/frida_tools/application.py", line 71, in await_enter
    input_with_cancellable(reactor.ui_cancellable)
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/frida_tools/application.py", line 59, in input_with_cancellable
    rlist, _, _ = select.select([sys.stdin, cancellable_fd], [], [])
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: file descriptor cannot be a negative integer (-42)

image

oleavr commented 1 year ago

Thanks for reporting! Fixed in 5767856c5a38c745c1f2084e11de2800c14adb27, just released in frida-tools 12.0.4.

agreenbhm commented 1 year ago

Thanks so much for the prompt fix! Just confirmed that 12.0.4 does indeed fix it with 16.0.7.