Skip to content

CoreCLR doesn't start if path includes a semicolon (on Windows) #3163

Description

@danmoseley

@JustArchi commented on Thu May 10 2018

Steps to reproduce:

  1. dotnet publish -c Release -r win-x64 -o out (any app)
  2. Manually rename out directory to out; or any other with a semicolon
  3. Run YourApp.exe

Result:

Failed to initialize CoreCLR, HRESULT: 0x80070057

Thank you in advance.

Narzędzia wiersza polecenia programu .NET (2.1.200)

Product Information:
 Version:            2.1.200
 Commit SHA-1 hash:  2edba8d7f1

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.16299
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\2.1.200\

Microsoft .NET Core Shared Framework Host

  Version  : 2.0.7
  Build    : 2d61d0b043915bc948ebf98836fefe9ba942be11

@danmosemsft commented on Thu May 10 2018

00 00000042`2b17d470 00007ffd`4c6cc488 KERNELBASE!RaiseException+0x68 minkernel\kernelbase\xcpt.c @ 922]
01 00000042`2b17d550 00007ffd`4c6cbe2f coreclr!RaiseTheExceptionInternalOnly+0x2fc e:\a\_work\104\s\src\vm\excep.cpp @ 2996]
*** ERROR: Module load completed but symbols could not be loaded for C:\dotnet21\shared\Microsoft.NETCore.App\2.1.0-preview3-26411-06\System.Private.CoreLib.dll
02 00000042`2b17d690 00007ffd`34b675b4 coreclr!IL_Throw+0x16f e:\a\_work\104\s\src\vm\jithelpers.cpp @ 4860]
03 00000042`2b17d850 00007ffd`34671f08 System_Private_CoreLib!System.AppDomain.NormalizeAppPaths(System.String)+0x4f5624
04 00000042`2b17d8c0 00007ffd`4c773283 System_Private_CoreLib!System.AppDomain.Setup(System.Object)+0x2c8
05 00000042`2b17d950 00007ffd`4c70a2ed coreclr!CallDescrWorkerInternal+0x83 E:\A\_work\104\s\src\vm\amd64\CallDescrWorkerAMD64.asm @ 101]

because NormalizeAppPaths splits on ;
int nextPos = values.IndexOf(Path.PathSeparator, pos);

because TRUSTED_PLATFORM_ASSEMBLIES contained a set of semi colon separated paths including the app's binary path. This setup information comes from the host. It is impossible for AppDomain to know that the semicolon is part of the path. The host should either agree on some escaping mechanism, or use a character that is not a valid part of a path, or pass an array in some other way.

Activity

  1. danmoseley commented on May 11, 2018

    @danmoseley
    ContributorAuthor

    @jkotas is it feasible for runtime to dump at least managed exception message to console here

  2. jkotas commented on May 11, 2018

    @jkotas
    Member

    The exception message we would print in this case is something like "Absolute path required" because of we see relative path where absolute path was expected. It would not be really helpful, and it is not easy to do this early during startup.

    I think the error handling for this case would be best in the host because of that's where the problem starts.

    Of course, it would be even better to fix this problem and deal with paths that contain semicolons properly end-to-end. Also, we have similar problems with other types of corner-case paths, like https://github.com/dotnet/coreclr/issues/16162 .

    cc @jeffschwMSFT

  3. transferred this issue fromdotnet/core-setupon Jan 30, 2020
  4. added this to the Future milestone on Jan 30, 2020
  5. removed
    untriagedNew issue has not been triaged by the area owner
    on Feb 24, 2020
  6. dotnet-policy-service commented on Aug 25, 2024

    @dotnet-policy-service
    Contributor

    Due to lack of recent activity, this issue has been marked as a candidate for backlog cleanup. It will be closed if no further activity occurs within 14 more days. Any new comment (by anyone, not necessarily the author) will undo this process.

    This process is part of our issue cleanup automation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    • Status
      No status

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions