title: Kestrel no Mono Error -14 EFAULT bad address in system call argument
body: <p>First of all, I realise that AspNetCore is no longer supported or tested on Mono. </p>
  
  <p>Still, I have an existing project (AspNet 1.0.0-rc1-final), which targets net461 and I need to migrate it to AspNetCore 1.1.0. After a couple hours of struggle, I did it, only to be surprised by it no longer working on Mono.</p>
  
  <p>I tried switching to netcoreapp1.1 but ended np in DLL hell - way to many unsupported libraries to go for it.</p>
  
  <p>I'm using Docker with Mono and additional LibUV installed</p>
  
  <pre><code>FROM debian:wheezy
  
  MAINTAINER Jo Shields &lt;jo.shields@xamarin.com&gt;
  
  #based on dockerfile by Michael Friis &lt;friism@gmail.com&gt;
  
  ENV MONO_VERSION 4.6.2.7
  
  RUN apt-get update \
    &amp;&amp; apt-get install -y curl \
    &amp;&amp; rm -rf /var/lib/apt/lists/*
  
  RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
  
  RUN echo "deb http://download.mono-project.com/repo/debian wheezy/snapshots/$MONO_VERSION main" &gt; /etc/apt/sources.list.d/mono-xamarin.list \
    &amp;&amp; apt-get update \
    &amp;&amp; apt-get install -y binutils mono-devel ca-certificates-mono fsharp mono-vbnc nuget referenceassemblies-pcl \
    &amp;&amp; rm -rf /var/lib/apt/lists/* /tmp/*
  
  
  # Install libuv for Kestrel from source code (binary is not in wheezy and one in jessie is still too old)
  # Combining this with the uninstall and purge will save us the space of the build tools in the image
  RUN LIBUV_VERSION=1.9.1 \
      &amp;&amp; apt-get -qq update \
      &amp;&amp; apt-get -qqy install autoconf automake build-essential libtool \
      &amp;&amp; curl -sSL https://github.com/libuv/libuv/archive/v${LIBUV_VERSION}.tar.gz | tar zxfv - -C /usr/local/src \
      &amp;&amp; cd /usr/local/src/libuv-$LIBUV_VERSION \
      &amp;&amp; sh autogen.sh &amp;&amp; ./configure &amp;&amp; make &amp;&amp; make install \
      &amp;&amp; rm -rf /usr/local/src/libuv-$LIBUV_VERSION \
      &amp;&amp; ldconfig \
      &amp;&amp; apt-get -y purge autoconf automake build-essential libtool \
      &amp;&amp; apt-get -y autoremove \
      &amp;&amp; apt-get -y clean \
      &amp;&amp; rm -rf /var/lib/apt/lists/*
  </code></pre>
  
  <p>Every http request to my app causes a Kestrel error:</p>
  
  <pre><code>info: Microsoft.AspNetCore.Server.Kestrel[14]
        Connection id "0HL2PMPE1RGS7" communication error.
  Microsoft.AspNetCore.Server.Kestrel.Internal.Networking.UvException: Error -14 EFAULT bad address in system call argument
  info: Microsoft.AspNetCore.Server.Kestrel[20]
        Connection id "0HL2PMPE1RGS7" request processing ended abnormally.
  System.IO.IOException: Error -14 EFAULT bad address in system call argument ---&gt; Microsoft.AspNetCore.Server.Kestrel.Internal.Networking.UvException: Error -14
  EFAULT bad address in system call argument
     --- End of inner exception stack trace ---
    at Microsoft.AspNetCore.Server.Kestrel.Internal.Http.SocketInput.CheckConnectionError () [0x00020] in &lt;43555eec0dc34d2abb4f01227fa5a2e9&gt;:0
    at Microsoft.AspNetCore.Server.Kestrel.Internal.Http.SocketInput.GetResult () [0x00013] in &lt;43555eec0dc34d2abb4f01227fa5a2e9&gt;:0
    at Microsoft.AspNetCore.Server.Kestrel.Internal.Http.Frame`1+&lt;RequestProcessingAsync&gt;d__2[TContext].MoveNext () [0x00194] in &lt;43555eec0dc34d2abb4f01227fa5a2e9
  &gt;:0
  info: Microsoft.AspNetCore.Server.Kestrel[14]
        Connection id "0HL2PMPE1RGS8" communication error.
  Microsoft.AspNetCore.Server.Kestrel.Internal.Networking.UvException: Error -14 EFAULT bad address in system call argument
  info: Microsoft.AspNetCore.Server.Kestrel[20]
        Connection id "0HL2PMPE1RGS8" request processing ended abnormally.
  System.IO.IOException: Error -14 EFAULT bad address in system call argument ---&gt; Microsoft.AspNetCore.Server.Kestrel.Internal.Networking.UvException: Error -14
  EFAULT bad address in system call argument
     --- End of inner exception stack trace ---
    at Microsoft.AspNetCore.Server.Kestrel.Internal.Http.SocketInput.CheckConnectionError () [0x00020] in &lt;43555eec0dc34d2abb4f01227fa5a2e9&gt;:0
    at Microsoft.AspNetCore.Server.Kestrel.Internal.Http.SocketInput.GetResult () [0x00013] in &lt;43555eec0dc34d2abb4f01227fa5a2e9&gt;:0
    at Microsoft.AspNetCore.Server.Kestrel.Internal.Http.Frame`1+&lt;RequestProcessingAsync&gt;d__2[TContext].MoveNext () [0x00194] in &lt;43555eec0dc34d2abb4f01227fa5a2e9
  &gt;:0
  info: Microsoft.AspNetCore.Server.Kestrel[14]
        Connection id "0HL2PMPE1RGS9" communication error.
  Microsoft.AspNetCore.Server.Kestrel.Internal.Networking.UvException: Error -14 EFAULT bad address in system call argument
  info: Microsoft.AspNetCore.Server.Kestrel[20]
        Connection id "0HL2PMPE1RGS9" request processing ended abnormally.
  System.IO.IOException: Error -14 EFAULT bad address in system call argument ---&gt; Microsoft.AspNetCore.Server.Kestrel.Internal.Networking.UvException: Error -14
  EFAULT bad address in system call argument
     --- End of inner exception stack trace ---
    at Microsoft.AspNetCore.Server.Kestrel.Internal.Http.SocketInput.CheckConnectionError () [0x00020] in &lt;43555eec0dc34d2abb4f01227fa5a2e9&gt;:0
    at Microsoft.AspNetCore.Server.Kestrel.Internal.Http.SocketInput.GetResult () [0x00013] in &lt;43555eec0dc34d2abb4f01227fa5a2e9&gt;:0
    at Microsoft.AspNetCore.Server.Kestrel.Internal.Http.Frame`1+&lt;RequestProcessingAsync&gt;d__2[TContext].MoveNext () [0x00194] in &lt;43555eec0dc34d2abb4f01227fa5a2e9
  &gt;:0
  </code></pre>
  
  <p>Did anyone manage to make AspNetCore v 1.1 run on Mono? Any help appreciated.</p>