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

strace: fix strace-graph shebang which points to perl #84133

Merged
merged 1 commit into from May 4, 2020

Conversation

hlolli
Copy link
Member

@hlolli hlolli commented Apr 2, 2020

Motivation for this change

strace-graph which is a perl executeable provided from the strace package isn't working

Things done

just apply the builtin patch

before

#!/usr/bin/perl

# This script processes strace -f output.  It displays a graph of invoked
# subprocesses, and is useful for finding out what complex commands do.

after

#!/nix/store/ch582glklkdav50j0rrslkimm7i1zy7z-perl-5.30.1/bin/perl

# This script processes strace -f output.  It displays a graph of invoked
# subprocesses, and is useful for finding out what complex commands do.
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@enolan
Copy link
Contributor

enolan commented Apr 3, 2020

Either this is broken or I don't understand how to use it:

[nix-shell:~/.cache/nixpkgs-review/pr-84133]$ strace -f -o log -t -q -s 100 bash -c 'sleep 5 & sleep 10'

[nix-shell:~/.cache/nixpkgs-review/pr-84133]$ strace-graph log
Hexadecimal number > 0xffffffff non-portable at /nix/store/zrxdmn5c1348dwjmff2335ayq9ppjx9l-strace-5.5/bin/strace-graph line 126, <> line 1.
/nix/store/zrxdmn5c1348dwjmff2335ayq9ppjx9l-strace-5.5/bin/strace-graph: log: 1: missing comma.
Use of uninitialized value $filename in pattern match (m//) at /nix/store/zrxdmn5c1348dwjmff2335ayq9ppjx9l-strace-5.5/bin/strace-graph line 220, <> line 1.
Use of uninitialized value in string ne at /nix/store/zrxdmn5c1348dwjmff2335ayq9ppjx9l-strace-5.5/bin/strace-graph line 221, <> line 1.
Use of uninitialized value $result in pattern match (m//) at /nix/store/zrxdmn5c1348dwjmff2335ayq9ppjx9l-strace-5.5/bin/strace-graph line 79, <> line 348.
/nix/store/zrxdmn5c1348dwjmff2335ayq9ppjx9l-strace-5.5/bin/strace-graph: log: 348: cannot parse line.
Use of uninitialized value $result in pattern match (m//) at /nix/store/zrxdmn5c1348dwjmff2335ayq9ppjx9l-strace-5.5/bin/strace-graph line 79, <> line 353.
/nix/store/zrxdmn5c1348dwjmff2335ayq9ppjx9l-strace-5.5/bin/strace-graph: log: 353: cannot parse line.
Use of uninitialized value $result in pattern match (m//) at /nix/store/zrxdmn5c1348dwjmff2335ayq9ppjx9l-strace-5.5/bin/strace-graph line 79, <> line 356.
/nix/store/zrxdmn5c1348dwjmff2335ayq9ppjx9l-strace-5.5/bin/strace-graph: log: 356: cannot parse line.
Use of uninitialized value $result in pattern match (m//) at /nix/store/zrxdmn5c1348dwjmff2335ayq9ppjx9l-strace-5.5/bin/strace-graph line 79, <> line 364.
/nix/store/zrxdmn5c1348dwjmff2335ayq9ppjx9l-strace-5.5/bin/strace-graph: log: 364: cannot parse line.
Use of uninitialized value $result in pattern match (m//) at /nix/store/zrxdmn5c1348dwjmff2335ayq9ppjx9l-strace-5.5/bin/strace-graph line 79, <> line 365.
/nix/store/zrxdmn5c1348dwjmff2335ayq9ppjx9l-strace-5.5/bin/strace-graph: log: 365: cannot parse line.
Use of uninitialized value $result in pattern match (m//) at /nix/store/zrxdmn5c1348dwjmff2335ayq9ppjx9l-strace-5.5/bin/strace-graph line 79, <> line 368.
/nix/store/zrxdmn5c1348dwjmff2335ayq9ppjx9l-strace-5.5/bin/strace-graph: log: 368: cannot parse line.
Use of uninitialized value $result in pattern match (m//) at /nix/store/zrxdmn5c1348dwjmff2335ayq9ppjx9l-strace-5.5/bin/strace-graph line 79, <> line 369.
/nix/store/zrxdmn5c1348dwjmff2335ayq9ppjx9l-strace-5.5/bin/strace-graph: log: 369: cannot parse line.
Use of uninitialized value $result in pattern match (m//) at /nix/store/zrxdmn5c1348dwjmff2335ayq9ppjx9l-strace-5.5/bin/strace-graph line 79, <> line 372.
/nix/store/zrxdmn5c1348dwjmff2335ayq9ppjx9l-strace-5.5/bin/strace-graph: log: 372: cannot parse line.
Use of uninitialized value $result in pattern match (m//) at /nix/store/zrxdmn5c1348dwjmff2335ayq9ppjx9l-strace-5.5/bin/strace-graph line 79, <> line 373.
/nix/store/zrxdmn5c1348dwjmff2335ayq9ppjx9l-strace-5.5/bin/strace-graph: log: 373: cannot parse line.
Use of uninitialized value $result in pattern match (m//) at /nix/store/zrxdmn5c1348dwjmff2335ayq9ppjx9l-strace-5.5/bin/strace-graph line 79, <> line 377.
/nix/store/zrxdmn5c1348dwjmff2335ayq9ppjx9l-strace-5.5/bin/strace-graph: log: 377: cannot parse line.
Use of uninitialized value $result in pattern match (m//) at /nix/store/zrxdmn5c1348dwjmff2335ayq9ppjx9l-strace-5.5/bin/strace-graph line 79, <> line 378.
/nix/store/zrxdmn5c1348dwjmff2335ayq9ppjx9l-strace-5.5/bin/strace-graph: log: 378: cannot parse line.
Use of uninitialized value $result in pattern match (m//) at /nix/store/zrxdmn5c1348dwjmff2335ayq9ppjx9l-strace-5.5/bin/strace-graph line 79, <> line 381.

That's followed by many many more error messages. It seems to completely fail to parse the log file.

@flokli
Copy link
Contributor

flokli commented May 4, 2020

I had the same issue yesterday - seems I'm also too dumb to use it :-D

While the PR definitely makes things more correct, @hlolli how do I invoke it afterwards?

@hlolli
Copy link
Member Author

hlolli commented May 4, 2020

It runs, more I don't know, I've never used it :D

it was out of pure curiousity and experimentation that I discovered this executable. We could try to figure this out togeather.

@flokli
Copy link
Contributor

flokli commented May 4, 2020

Well, it's surely more correct for sure. Let's merge this for now :-)

@flokli flokli merged commit 2d5deea into NixOS:master May 4, 2020
@Ma27
Copy link
Member

Ma27 commented Jun 16, 2020

Ported to stable as 02b95cf.

@Ma27 Ma27 added the 8.has: port to stable A PR already has a backport to the stable release. label Jun 16, 2020
@flokli
Copy link
Contributor

flokli commented Jun 16, 2020

@Ma27 ha! so you know how to use it? ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.has: port to stable A PR already has a backport to the stable release. 10.rebuild-darwin: 0 10.rebuild-linux: 1-10
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants