Skip to content

jit-analyze issues on Unix #275

@am11

Description

@am11

There seems to be few issues, which I think are worth the investigation for Unix.

Setup on macOS x64:

$ pushd runtime_base; ./build.sh -c Release; ./src/coreclr/build-test.sh -generatelayoutonly -release; popd
$ pushd runtime_pr;   ./build.sh -c Release; ./src/coreclr/build-test.sh -generatelayoutonly -release; popd

$ mkdir /tmp/diffs

$ jitutils/bin/jit-diff diff                                                         \
    --base runtime_base/artifacts/bin/coreclr/OSX.x64.Release                        \
    --base_root runtime_base                                                         \
    --core_root runtime_base/artifacts/tests/coreclr/OSX.x64.Release/Tests/Core_Root \
    --output /tmp/diffs --pmi -f

...
Diffs (if any) can be viewed by comparing: /tmp/diffs/dasmset_1/base /tmp/diffs/dasmset_1/diff
...

$ jitutils/bin/jit-diff diff                                                       \
    --diff runtime_pr/artifacts/bin/coreclr/OSX.x64.Release                        \
    --diff_root runtime_pr                                                         \
    --core_root runtime_pr/artifacts/tests/coreclr/OSX.x64.Release/Tests/Core_Root \
    --output /tmp/diffs --pmi -f

...
Diffs (if any) can be viewed by comparing: /tmp/diffs/dasmset_2/base /tmp/diffs/dasmset_2/diff
...
  1. allow symlinks.

    $ ln -s /tmp/diffs/dasmset_2/diff/ /tmp/diffs/diff
    $ ln -s /tmp/diffs/dasmset_1/base/ /tmp/diffs/base
    $ jitutils/bin/jit-analyze --base /tmp/diffs/base --diff /tmp/diffs/diff
    Couldn't parse --numstat output '1	1	/tmp/diffs/{diff => base}` : '/tmp/diffs/base' does not exist

    looks like jit-analyze is strict about directory type and does not accept link-to-directory.

  2. allow sub directories:

    $ jitutils/bin/jit-analyze --base /tmp/diffs/dasmset_1/base --diff /tmp/diffs/dasmset_2/diff

    currently it fails with these errors:

    Couldn't parse --numstat output '1	1	/tmp/diffs/{dasmset_2/diff => dasmset_1/base}/CommandLine.dasm` : '/tmp/diffs/{dasmset_2/diff' does not exist
    Couldn't parse --numstat output '1	1	/tmp/diffs/{dasmset_2/diff => dasmset_1/base}/Dia2Lib.dasm` : '/tmp/diffs/{dasmset_2/diff' does not exist
    Couldn't parse --numstat output '1	1	/tmp/diffs/{dasmset_2/diff => dasmset_1/base}/ILCompiler.Reflection.ReadyToRun.dasm` : '/tmp/diffs/{dasmset_2/diff' does not exist
    Couldn't parse --numstat output '1	1	/tmp/diffs/{dasmset_2/diff => dasmset_1/base}/Microsoft.CSharp.dasm` : '/tmp/diffs/{dasmset_2/diff' does not exist
    Couldn't parse --numstat output '1	1	/tmp/diffs/{dasmset_2/diff => dasmset_1/base}/Microsoft.CodeAnalysis.CSharp.dasm` : '/tmp/diffs/{dasmset_2/diff' does not exist
    Couldn't parse --numstat output '1	1	/tmp/diffs/{dasmset_2/diff => dasmset_1/base}/Microsoft.CodeAnalysis.VisualBasic.dasm` : '/tmp/diffs/{dasmset_2/diff' does not exist
    ...

    from @AndyAyersMS:

    jit-analyze uses git diff under the covers and sometimes git diff decides there are renames and messes up our parsing.

  3. crossgen2 does not produce executable on Unix:

    and crossgen2.dll fails:

    $ jitutils/bin/jit-diff diff --diff runtime_base/artifacts/bin/coreclr/OSX.x64.Release --diff_root runtime_base --core_root runtime_base/artifacts/tests/coreclr/OSX.x64.Release/Tests/Core_Root --output /tmp/diffs --crossgen runtime_base/artifacts/bin/coreclr/OSX.x64.Release/crossgen2/crossgen2.dll -f
    Beginning Crossgen CodeSize Diffs for System.Private.CoreLib.dll, framework assemblies
    - Finished 0/0 Base 0/265 Diff [0.1 sec]Unhandled exception. System.ComponentModel.Win32Exception (13): Permission denied
       at System.Diagnostics.Process.ForkAndExecProcess(String filename, String[] argv, String[] envp, String cwd, Boolean redirectStdin, Boolean redirectStdout, Boolean redirectStderr, Boolean setCredentials, UInt32 userId, UInt32 groupId, UInt32[] groups, Int32& stdinFd, Int32& stdoutFd, Int32& stderrFd, Boolean usesTerminal, Boolean throwOnNoExec)
       at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
       at System.Diagnostics.Process.Start()
       at Microsoft.DotNet.Cli.Utils.Command.Execute()

    i think we can either produce crossgen2 executable on Unix in dotnet/runtime, or accept the base path of crossgen2, then invoke with dotnet as a process name.

Originally posted by @am11 in dotnet/runtime#39730

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions