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

Cannot pipe frida-ps #16

Closed
trufae opened this issue Apr 2, 2019 · 5 comments · Fixed by #56
Closed

Cannot pipe frida-ps #16

trufae opened this issue Apr 2, 2019 · 5 comments · Fixed by #56

Comments

@trufae
Copy link
Contributor

trufae commented Apr 2, 2019

$ frida-ps -U|head -n 1
 PID  Name
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/local/Cellar/python/3.7.2_2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/threading.py", line 917, in _bootstrap_inner
    self.run()
  File "/usr/local/Cellar/python/3.7.2_2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/threading.py", line 865, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/lib/python3.7/site-packages/frida_tools/application.py", line 431, in _run
    work()
  File "/usr/local/lib/python3.7/site-packages/frida_tools/application.py", line 280, in _try_start
    self._start()
  File "/usr/local/lib/python3.7/site-packages/frida_tools/ps.py", line 69, in _start
    self._print(line_format % (process.pid, process.name))
  File "/usr/local/lib/python3.7/site-packages/frida_tools/application.py", line 346, in _print
    print(*encoded_args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/colorama/ansitowin32.py", line 41, in write
    self.__convertor.write(text)
  File "/usr/local/lib/python3.7/site-packages/colorama/ansitowin32.py", line 162, in write
    self.write_and_convert(text)
  File "/usr/local/lib/python3.7/site-packages/colorama/ansitowin32.py", line 190, in write_and_convert
    self.write_plain_text(text, cursor, len(text))
  File "/usr/local/lib/python3.7/site-packages/colorama/ansitowin32.py", line 196, in write_plain_text
    self.wrapped.flush()
BrokenPipeError: [Errno 32] Broken pipe
``
@otadmor
Copy link
Contributor

otadmor commented May 29, 2019

Can you pipe with Grep and tell if it crashes?

@trufae
Copy link
Contributor Author

trufae commented May 30, 2019

Works with grep because grep waits until the stream is closed to process the output. application.py should add a try catch to handle this case imho. What do you think @oleavr ?

@oleavr
Copy link
Member

oleavr commented May 30, 2019

@trufae I tried adding a try/catch there but it isn't enough, I suspect we need to fix the issue in colorama.

@otadmor
Copy link
Contributor

otadmor commented May 30, 2019

Is there another crash with the try catch?
Maybe the self.wrapped should try catch on all methods?

@oleavr
Copy link
Member

oleavr commented May 30, 2019

@otadmor I don't know the specifics, didn't have time to investigate.

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

Successfully merging a pull request may close this issue.

3 participants