-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
mojo2austin expecting utf-8, found latin-1 #30
Comments
@dooferlad thanks for reporting this. Does this happen with every MOJO file generated by Austin? Sometimes some files might be corrupted because of bad samples so it's worth trying collecting them again. |
It definitely is happening every time for this project. I get a lot of invalid samples, so I suppose this is something I just have to live with?
|
Of course, I say that and then I tried the latest github release instead of the latest snap and the conversion worked. I still have a lot of invalid samples though! |
Yes, it seems like invalid samples are the problem. Re-running multiple times gives me a selection of bytes that can't be decoded as UTF-8 arriving at different positions in the profile. I already have a large heap (4GiB). Is there anything else I can do to reduce errors? |
FWIW, this does the right thing, I think! # austin/stats.py line 428
def __iter__(self) -> Iterator:
"""Iterator over the samples in the Austin file."""
def _() -> Generator[str, None, None]:
assert self._stream_iter is not None
while True:
try:
line = self._stream.readline()
if line == "\n":
break
yield line
except UnicodeDecodeError:
pass
self._read_meta()
return _() Would you like me to submit a PR? |
@dooferlad yes please, any contribution is very welcome. As for the invalid samples, if you're specifically referring to the stats reported by Austin at the end, there isn't much that can be done about that. That's just the nature of an out-of-process profiler like Austin. |
Description
Running mojo2austin on a file I just generated gives an error:
Steps to Reproduce
austin --output /home/dooferlad/supportsite.austin --binary --heap=2048 ./manage.py runserver 8001 --noreload --skip-checks
mojo2austin /home/dooferlad/supportsite.austin /home/dooferlad/supportsite.austin-txt
Versions
My environment is set up with:
Additional Information
To get mojo2austin and austin2speedscope to work, I made these changes: In austin/format/mojo.py at line 331:
And also austin/stats.py line 419:
I assume that the string in the Mojo file is from the Python application, but I don't actually know. I am not sure if the above change is actually a fix or just masking the real bug!
The text was updated successfully, but these errors were encountered: