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

Consider stripping null byte in frame name #280

Open
Krinkle opened this issue Apr 5, 2022 · 0 comments
Open

Consider stripping null byte in frame name #280

Krinkle opened this issue Apr 5, 2022 · 0 comments

Comments

@Krinkle
Copy link

Krinkle commented Apr 5, 2022

This came up downstream in Wikimedia's PHP profiling stack (https://performance.wikimedia.org/php-profiling/, https://phabricator.wikimedia.org/T273640) where some of the collected samples were formatted using a null byte.

This is how PHP 7.2 represents an unnamed lamba, by joining the surrounding class name with "anonymous" and the defining file's path.

class@anonymous\0/srv/mediawiki/1.36.0-wmf.27/extensions/CirrusSearch/includes/CirrusSearch.php0x7fbdf64f0551::parse 1

Which resulted in the output SVG not rendering well in the browser, due to:

This page contains the following errors:
error on line 2012 at column 23: Char 0x0 out of allowed range
Below is a rendering of the page up to the first error.

We've fixed the producer on our end (as we should have, either way). It may be useful to strip directly in flamegraph.pl if you think its seems probable for other consumers to run into this (if they also instrument PHP and/or from other sources), and if it seems reasonable for such byte to exist in a tracelog file that is otherwise collapsed and well-formatted. I don't mind either way. Thanks for the tool!

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