Bug 18939 - ServiceStack PCL Client causes 'Attempting to JIT compile' exception
Summary: ServiceStack PCL Client causes 'Attempting to JIT compile' exception
Status: RESOLVED DUPLICATE of bug 18688
Alias: None
Product: iOS
Classification: Xamarin
Component: General (show other bugs)
Version: 7.2.1
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2014-04-10 16:54 UTC by Josh Hogan
Modified: 2014-04-14 16:22 UTC (History)
3 users (show)

See Also:
Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Service Stack JIT Compile Exception (2.91 MB, application/x-zip)
2014-04-10 16:54 UTC, Josh Hogan
Details

Description Josh Hogan 2014-04-10 16:54:53 UTC
Created attachment 6552 [details]
Service Stack JIT Compile Exception

I recently upgraded to the ServiceStack Client PCL library and in the most recent Beta release (7.2.1.34) I'm receiving an exception - only when run from the device (Full AOT)

Unhandled managed exception: Attempting to JIT compile method '(wrapper delegate-invoke) <Module>:invoke_callvirt_Nullable`1<bool>_Authenticate (ServiceStack.Authenticate)' while running with --aot-only. See http://docs.xamarin.com/ios/about/limitations for more information.
 (System.ExecutionEngineException)
  at (wrapper unknown) object:gsharedvt_out ()
  at Microsoft.Scripting.Interpreter.FuncCallInstruction`2[ServiceStack.Authenticate,System.Nullable`1[System.Boolean]].Run (Microsoft.Scripting.Interpreter.InterpretedFrame frame) [0x00000] in /Developer/MonoTouch/Source/mono/mcs/class/dlr/Runtime/Microsoft.Dynamic/Interpreter/Instructions/CallInstruction.Generated.cs:692 
  at Microsoft.Scripting.Interpreter.Interpreter.Run (Microsoft.Scripting.Interpreter.InterpretedFrame frame) [0x0001b] in /Developer/MonoTouch/Source/mono/mcs/class/dlr/Runtime/Microsoft.Dynamic/Interpreter/Interpreter.cs:126 

Note that this does NOT occur in the most recent Stable release (7.2.0.2).

At this point it's difficult for me to say whether this is really a bug in the library or not due to the fact it works in Stable.

I've attached a sample project that exhibits the behavior.  
Running the project on the device in the most recent Stable release (7.2.0.2) will still throw an exception, but it will be some form of a "Bad Request" because the test project attempts to connect to a bogus host.  This is expected.

Running the project on the device in the most recent Beta (7.2.1.34) release will throw the "JIT Compile" exception noted above before any request is actually made to the (bogus) host.
Comment 1 Sebastien Pouliot 2014-04-10 17:04:19 UTC
A newer build (post .34) fixed some issue in SLE (even if Expressions are not fully supported).

Running your sample I get this exception:

2014-04-10 17:03:03.473 ServiceStackPCLTest[5684:60b] Unhandled managed exception: Not Found (ServiceStack.WebServiceException)
  at ServiceStack.ServiceClientBase.ThrowWebServiceException[AuthenticateResponse] (System.Exception ex, System.String requestUri) [0x00000] in <filename unknown>:0 
  at ServiceStack.ServiceClientBase.ThrowResponseTypeException[AuthenticateResponse] (System.Object request, System.Exception ex, System.String requestUri) [0x00000] in <filename unknown>:0 
  at ServiceStack.ServiceClientBase.HandleResponseException[AuthenticateResponse] (System.Exception ex, System.Object request, System.String requestUri, System.Func`1 createWebRequest, System.Func`2 getResponse, ServiceStack.AuthenticateResponse& response) [0x00000] in <filename unknown>:0 
  at ServiceStack.ServiceClientBase.Send[AuthenticateResponse] (System.Object request) [0x00000] in <filename unknown>:0 
  at ServiceStack.ServiceClientBase.Send[AuthenticateResponse] (IReturn`1 request) [0x00000] in <filename unknown>:0 
  at ServiceStackPCLTest.AppDelegate.FinishedLaunching (MonoTouch.UIKit.UIApplication app, MonoTouch.Foundation.NSDictionary options) [0x00069] in /Users/sebastienpouliot/Downloads/ServiceStackJITCompile/ServiceStackPCLTest/AppDelegate.cs:45 
  at (wrapper managed-to-native) MonoTouch.UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)
  at MonoTouch.UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0004c] in /Developer/MonoTouch/Source/monotouch/src/UIKit/.pmcs-compat.UIApplication.cs:38 
  at ServiceStackPCLTest.Application.Main (System.String[] args) [0x00008] in /Users/sebastienpouliot/Downloads/ServiceStackJITCompile/ServiceStackPCLTest/Main.cs:16
Comment 2 Josh Hogan 2014-04-10 17:25:43 UTC
That is the exception I would expect to receive in the working case.  This means the request was actually sent, but I purposely sent it to a bad host because a truly "working" example would have required more infrastructure than I have time to deal with.

I apologize for the confusion.

If this is the result from a "post .34" build, it appears to have been fixed?
Comment 3 Marek Safar 2014-04-11 03:46:59 UTC
 Duplicate of #18688

*** This bug has been marked as a duplicate of bug 18688 ***
Comment 4 Sebastien Pouliot 2014-04-14 16:22:35 UTC
@Josh there's a new beta available - and it should fix your issue.

Note You need to log in before you can comment on or make changes to this bug.