timbunce / devel-nytprof

Devel::NYTProf is a powerful feature-rich source code profiler for Perl. (Mostly in maintenance mode, so PRs are much more likely to be acted upon than Issues.)
http://blog.timbunce.org/tag/nytprof/
67 stars 51 forks source link

Calling 'nytprofhtml' emits error messages about WSL interoperability. #221

Open jkeenan opened 1 week ago

jkeenan commented 1 week ago

I am encountering some problems in the execution of nytprofhtml on Ubuntu Linux 22.04 LTS. Here is my environment:

$ uname -a
Linux tpadx1 6.8.0-40-generic #40~22.04.3-Ubuntu SMP PREEMPT_DYNAMIC Tue Jul 30 17:30:19 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

$ perl -v | head -2 | tail -1
This is perl 5, version 40, subversion 0 (v5.40.0) built for x86_64-linux

$ perl -MDevel::NYTProf -E 'say $Devel::NYTProf::VERSION;' 2>/dev/null
6.14

I have a locally installed Perl program called get-pod-outline. It takes a single argument: a path to a POD file. I go to profile it.

$ perl -d:NYTProf /home/jkeenan/bin/perl/get-pod-outline /home/jkeenan/gitwork/perl/pod/perldelta.pod

[0906-01] 2066 $ nytprofhtml --open
Reading nytprof.out
Processing nytprof.out data
Writing line reports to nytprof directory
 100% ... 
Extracting subroutine call data ...
Extracting subroutine links
Generating subroutine stack flame graph ...
grep: /proc/sys/fs/binfmt_misc/WSLInterop: No such file or directory
WSL Interopability is disabled. Please enable it before using WSL.
grep: /proc/sys/fs/binfmt_misc/WSLInterop: No such file or directory
[0906-01] 2067 $ [error] WSL Interoperability is disabled. Please enable it before using WSL.
/usr/bin/wslview: line 216: /mnt/c/Windows/System32/reg.exe: No such file or directory
/usr/bin/wslview: line 308: [: -ge: unary operator expected
[error] This protocol is not supported before version 1903.
^C

The program hangs here. Once I Ctrl-C, I get the files I expect in the nytprof/ subdirectory.

I have never attempted to install or use WSL interoperability on this Ubuntu 22.04 LTS machine, so I don't understand why I am getting these error messages. Moreover, I searched for WSL in my checkout of the master branch and came up with nothing.

Can anyone provide guidance?

choroba commented 1 week ago

Does it happen without --open, too?

jkeenan commented 1 week ago

Does it happen without --open, too?

No.

 $ nytprofhtml -o /tmp/0906-02
Reading nytprof.out
Processing nytprof.out data
Writing line reports to /tmp/0906-02 directory
 100% ... 
Extracting subroutine call data ...
Extracting subroutine links
Generating subroutine stack flame graph ...

$ ls -ltr 0906-02
total 2872
-rw-rw-r-- 1 jkeenan jkeenan   3380 Sep  6 13:05  style.css
-rw-rw-r-- 1 jkeenan jkeenan  37780 Sep  6 13:05  home-jkeenan-bin-perl-get-pod-outline-1-line.html
-rw-rw-r-- 1 jkeenan jkeenan 131949 Sep  6 13:05  warnings-pm-2-line.html
...
-rw-rw-r-- 1 jkeenan jkeenan   2850 Sep  6 13:06  packages-callgraph.dot
-rw-rw-r-- 1 jkeenan jkeenan  24832 Sep  6 13:06  subs-callgraph.dot
-rw-rw-r-- 1 jkeenan jkeenan  28225 Sep  6 13:06  index.html
drwxrwxr-x 3 jkeenan jkeenan   4096 Sep  6 13:06  js
choroba commented 1 week ago

No.

That means the problem probably comes from running the browser.

jkeenan commented 1 week ago

No.

That means the problem probably comes from running the browser.

A recognized problem, apparently.

commit 65cb2634f880985697210ca4dbebecc3cf9c90be
Author:     Tim Bunce <Tim.Bunce@pobox.com>
AuthorDate: Fri Jun 15 16:04:32 2012 +0000
Commit:     Tim Bunce <Tim.Bunce@pobox.com>
CommitDate: Fri Jun 15 16:04:32 2012 +0000

    Add --debug, add --open docs, use Browser::Open if available, rework related logic.

...    

It is likely that I never previously had occasion to run a freestanding instance of nytprofhtml. Out of time now; will have to debug further later.