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

Compiler Server Fails on 32-bit Linux (Mono) #38211

Closed
steveisok opened this issue Aug 22, 2019 · 0 comments · Fixed by #38239
Closed

Compiler Server Fails on 32-bit Linux (Mono) #38211

steveisok opened this issue Aug 22, 2019 · 0 comments · Fixed by #38239
Labels
Area-Compilers Bug Tenet-Performance Regression in measured performance of the product from goals.
Milestone

Comments

@steveisok
Copy link
Member

Version Used: 3.3.0-beta2-19381-14 (ef3a7a3)

Steps to Reproduce:

Note - this fails because of the following code that assumes GlobalMemoryStatusEx is available. It's not on mono.

public static bool IsMemoryAvailable()
{
MemoryHelper status = new MemoryHelper();
GlobalMemoryStatusEx(status);
ulong max = status.MaxVirtual;
ulong free = status.AvailableVirtual;
int shift = 20;
string unit = "MB";
if (free >> shift == 0)
{
shift = 10;
unit = "KB";
}
CompilerServerLogger.Log("Free memory: {1}{0} of {2}{0}.", unit, free >> shift, max >> shift);
return free >= 800 << 20; // Value (500MB) is arbitrary; feel free to improve.
}
[DllImport("kernel32.dll", SetLastError = true)]
private static extern bool GlobalMemoryStatusEx([In, Out] MemoryHelper buffer);
}

  1. Get your favorite 32-bit OS
  2. Clone mono master (http://github.com/mono/mono)
  3. Build it

Expected Behavior:
The named pipe connection to the compiler server should work. The logs in /mcs/build/compiler-server.log should indicate normal activity.

Actual Behavior:
Each call to the compiler server fails and falls back to local CSC. Normal build times take at least 2x as long.

Here's the exception in the logs:

--- PID=55254 TID=1 Ticks=50369644: Exception 'GlobalMemoryStatusEx assembly:<unknown assembly> type:<unknown type> member:(null)' occurred during 'Error creating client named pipe'. Stack trace:
  at (wrapper managed-to-native) Microsoft.CodeAnalysis.CompilerServer.MemoryHelper.GlobalMemoryStatusEx(Microsoft.CodeAnalysis.CompilerServer.MemoryHelper)
  at Microsoft.CodeAnalysis.CompilerServer.MemoryHelper.IsMemoryAvailable () [0x00005] in <b4db9195626c4d599771f618990c13f2>:0 
  at Microsoft.CodeAnalysis.CompilerServer.NamedPipeClientConnectionHost.CreateListenTaskCore (System.Threading.CancellationToken cancellationToken) [0x000e2] in <b4db9195626c4d599771f618990c13f2>:0 
  at Microsoft.CodeAnalysis.CompilerServer.NamedPipeClientConnectionHost.CreateListenTask (System.Threading.CancellationToken cancellationToken) [0x00075] in <b4db9195626c4d599771f618990c13f2>:0 
  at Microsoft.CodeAnalysis.CompilerServer.ServerDispatcher.HandleClientConnection (System.Threading.Tasks.Task`1[TResult] clientConnectionTask, System.Boolean allowCompilationRequests, System.Threading.CancellationToken cancellationToken) [0x00073] in <b4db9195626c4d599771f618990c13f2>:0 
@gafter gafter added this to the Compiler.Next milestone Aug 26, 2019
@gafter gafter added the Tenet-Performance Regression in measured performance of the product from goals. label Aug 26, 2019
akoeplinger added a commit to akoeplinger/roslyn that referenced this issue Aug 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compilers Bug Tenet-Performance Regression in measured performance of the product from goals.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants