[Mono-dev] Amazon Lambda With Mono

Miguel de Icaza miguel at microsoft.com
Mon Nov 28 19:42:48 UTC 2016


Hello,

The code dies when trying to P/Invoke the function “uname” from the libc library.

This could be the case if your Mono config file that describes how to lookup the system library. 

Miguel.

On 11/22/16, 8:26 AM, "Mono-devel-list on behalf of james.wheeler.pe" <mono-devel-list-bounces at lists.dot.net on behalf of james.wheeler.pe at gmail.com> wrote:

    Thought I posted this yesterday but can't find it.
    
    Forgive me if it shows up twice.
    
    We have a lot of C# code that we would like to run under Amazon Lambda.
    
    Mono would seem to be the most effective way to achieve this.
    
    I have been able to get simple applications to run but things fail
    when I try to use libraries that ultimately make a call via WebRequest.
    
    Here is a partial stack trace....
    
    libc :   at (wrapper managed-to-native) System.Platform:uname (intptr)
      at System.Platform.CheckOS () [0x00022] in
    <bd46d4d4f7964dfa9beea098499ab597>:0 
      at System.Platform.get_IsMacOS () [0x0000a] in
    <bd46d4d4f7964dfa9beea098499ab597>:0 
      at System.Net.WebRequest.GetSystemWebProxy () [0x00149] in
    <bd46d4d4f7964dfa9beea098499ab597>:0 
      at System.Net.WebRequest.GetDefaultWebProxy () [0x0003f] in
    <bd46d4d4f7964dfa9beea098499ab597>:0 
      at System.Net.WebRequest.get_DefaultWebProxy () [0x00024] in
    <bd46d4d4f7964dfa9beea098499ab597>:0 
      at System.Net.GlobalProxySelection.get_Select () [0x00000] in
    <bd46d4d4f7964dfa9beea098499ab597>:0 
      at System.Net.HttpWebRequest..ctor (System.Uri uri) [0x0008d] in
    <bd46d4d4f7964dfa9beea098499ab597>:0 
      at (wrapper remoting-invoke-with-check) System.Net.HttpWebRequest:.ctor
    (System.Uri)
      at System.Net.HttpRequestCreator.Create (System.Uri uri) [0x00000] in
    <bd46d4d4f7964dfa9beea098499ab597>:0 
      at System.Net.WebRequest.Create (System.Uri requestUri) [0x00022] in
    <bd46d4d4f7964dfa9beea098499ab597>:0 
      at Amazon.Runtime.Internal.HttpRequest..ctor (System.Uri requestUri)
    [0x00006] in <5fa4eac2df714faba4a923294bf63545>:0 
      at Amazon.Runtime.Internal.HttpWebRequestFactory.CreateHttpRequest
    (System.Uri requestUri) [0x00000] in <5fa4eac2df714f
    aba4a923294bf63545>:0 
      at Amazon.Runtime.Internal.HttpHandler`1[TRequestContent].CreateWebRequest
    (Amazon.Runtime.IRequestContext requestConte
    xt) [0x0000e] in <5fa4eac2df714faba4a923294bf63545>:0 
      at Amazon.Runtime.Internal.HttpHandler`1[TRequestContent].InvokeSync
    (Amazon.Runtime.IExecutionContext executionContext
    ) [0x00020] in <5fa4eac2df714faba4a923294bf63545>:0 
      at Amazon.Runtime.Internal.PipelineHandler.InvokeSync
    (Amazon.Runtime.IExecutionContext executionContext) [0x0000e] in 
    <5fa4eac2df714faba4a923294bf63545>:0 
      at Amazon.Runtime.Internal.Unmarshaller.InvokeSync
    (Amazon.Runtime.IExecutionContext executionContext) [0x00000] in <5f
    a4eac2df714faba4a923294bf63545>:0 
      at Amazon.Runtime.Internal.PipelineHandler.InvokeSync
    (Amazon.Runtime.IExecutionContext executionContext) [0x0000e] in 
    <5fa4eac2df714faba4a923294bf63545>:0 
      at Amazon.SQS.Internal.ValidationResponseHandler.InvokeSync
    (Amazon.Runtime.IExecutionContext executionContext) [0x0000
    0] in <77e6e07db95447a7b69000e72919cece>:0 
      at Amazon.Runtime.Internal.PipelineHandler.InvokeSync
    (Amazon.Runtime.IExecutionContext executionContext) [0x0000e] in 
    <5fa4eac2df714faba4a923294bf63545>:0 
    
    On the machine I used to create the package to deploy to Amazon Lambda I
    have mono installed and on this machine all the applications work
    flawlessly.
    
    Installing mono for Amazon Lambda is not an option.
    
    I used mkbundle --deps .... to build the package to deploy to Amazon Lambda.
    
    For a while I suspected that the issue might be due to a missing or empty
    mono certificate store.  However I implemented the ICertificatePolicy
    interface and accepted everything and that has no affect.
    
    I'd really like to get this working because Amazon Lambda has many practical
    benefits.
    
    Any help or suggestions would be greatly appreciated.
    
    Also, and don't know if this is related or relevant, but I cannot get the
    --static flag to work with mkbundle.  The link stage always fails saying it
    cannot find -lmono-2.0.
    
    
    
    --
    View this message in context: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmono.1490590.n4.nabble.com%2FAmazon-Lambda-With-Mono-tp4669222.html&data=02%7C01%7Cmiguel%40microsoft.com%7C9fa1237cc7a6479ad91f08d412dcdd09%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636154187211160368&sdata=6dgA9Ljk%2BSsRajVAyn8UK83k1A23XpvONyOXikyHw6o%3D&reserved=0
    Sent from the Mono - Dev mailing list archive at Nabble.com.
    _______________________________________________
    Mono-devel-list mailing list
    Mono-devel-list at lists.dot.net
    https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Flists.dot.net%2Fmailman%2Flistinfo%2Fmono-devel-list&data=02%7C01%7Cmiguel%40microsoft.com%7C9fa1237cc7a6479ad91f08d412dcdd09%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636154187211160368&sdata=0o%2Fh8tp%2BTA4eGL1rORZjQy0SO1fqL6kW%2FpQpPp35wAU%3D&reserved=0
    



More information about the Mono-devel-list mailing list