Bug 52687 - error of wcf working
Summary: error of wcf working
Status: NEW
Alias: None
Product: Runtime
Classification: Mono
Component: JIT (show other bugs)
Version: 4.6.0 (C8)
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-02-22 20:35 UTC by Roman
Modified: 2018-02-20 10:38 UTC (History)
4 users (show)

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

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report for Bug 52687 on GitHub or Developer Community if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: GitHub Markdown or Developer Community HTML
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
NEW

Description Roman 2017-02-22 20:35:27 UTC
[2017-02-22 22:26:18.981368] Error  : Handling exception type NullReferenceException
[2017-02-22 22:26:18.981646] Error  : Message is Object reference not set to an instance of an object
[2017-02-22 22:26:18.981831] Error  : IsTerminating is set to True
[2017-02-22 22:26:18.982076] Error  : Object reference not set to an instance of an object
[2017-02-22 22:26:18.983282] Error  :   at System.ServiceModel.Dispatcher.ListenerLoopManager.ProcessRequest (System.ServiceModel.Channels.IReplyChannel reply, System.ServiceModel.Channels.RequestContext rc) [0x0005c] in /tmp/buildd/mono-4.6.2.16/mcs/class/System.ServiceModel/System.ServiceModel.Dispatcher/ChannelDispatcher.cs:614 
[2017-02-22 22:26:18.983360] Error  :   at System.ServiceModel.Dispatcher.ListenerLoopManager.TryReceiveRequestDone (System.IAsyncResult result) [0x0001a] in /tmp/buildd/mono-4.6.2.16/mcs/class/System.ServiceModel/System.ServiceModel.Dispatcher/ChannelDispatcher.cs:581 
[2017-02-22 22:26:18.983417] Error  :   at (wrapper managed-to-native) System.Runtime.Remoting.Messaging.AsyncResult:Invoke (System.Runtime.Remoting.Messaging.AsyncResult)
[2017-02-22 22:26:18.983471] Error  :   at System.Runtime.Remoting.Messaging.AsyncResult.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem () [0x00000] in /tmp/buildd/mono-4.6.2.16/mcs/class/corlib/System.Runtime.Remoting.Messaging/AsyncResult.cs:210 
[2017-02-22 22:26:18.983522] Error  :   at System.Threading.ThreadPoolWorkQueue.Dispatch () [0x00096] in /tmp/buildd/mono-4.6.2.16/mcs/class/referencesource/mscorlib/system/threading/threadpool.cs:854 
[2017-02-22 22:26:18.983590] Error  :   at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback () [0x00000] in /tmp/buildd/mono-4.6.2.16/mcs/class/referencesource/mscorlib/system/threading/threadpool.cs:1209
Comment 1 Roman 2017-02-22 20:40:25 UTC
before showing stacktrace it happens this http://joxi.ru/4AkvxM1SyRLgq2
Comment 2 Roman 2017-03-19 20:25:43 UTC
I've understood why it happens so but developers have to resolve problem. So I discribe.
It happens first time after starting fast_cgi_mono_server.

First of all I've noticed that fast_cgi_mono_server works excellent when I at begin load my wcf service after starting fast_cgi_mono_server. If I do so: start starting fast_cgi_mono_server and load in browser wcf service (http://mysite.ua/Service.svc) then I can load pages from site without problem. But if I don't load service after starting fast_cgi_mono_server then web server crashes.

Go next.
The main page of my site contains two asynchronous ajax method which is calling at one time:

function callService() {
    	$.ajax({                                                 //first method
	        type: "GET",
	        url: "Service.svc/GetNamesPhoto",
	        contentType: "application/json; charset=utf-8",
	        dataType: "json",
	        processdata: true,
	        success: function(msg) {
	            serviceSucceedPhoto(msg);
	        },
	        error: ServiceFailed
        });
        if (device.desktop())
        {
        	$.ajax({                                        //second method
	        	type: "GET",
		        url: "Service.svc/GetNamesMusic",
		        contentType: "application/json; charset=utf-8",
		        dataType: "json",
		        processdata: true,
		        success: function(msg) {
		            serviceSucceedMusic(msg);
		        },
		        error: ServiceFailed
	        });
        }
    }

And later I've noticed that exception is thrown only after second method calling ("Service.svc/GetNamesMusic"). First method return result successfully but second method crashes fast_cgi_mono_server. And I've decided to remake code. I replace second method in callback of first method in order to call two methods by queue.

function callService() {
    	$.ajax({                                                 //first method
	        type: "GET",
	        url: "Service.svc/GetNamesPhoto",
	        contentType: "application/json; charset=utf-8",
	        dataType: "json",
	        processdata: true,
	        success: function(msg) {
	            serviceSucceedPhoto(msg);
	        },
	        error: ServiceFailed
        });

function serviceSucceedPhoto(result) {
        countPhoto = 0;
        myarrayPhoto = result.GetNamesPhotoResult;
        if (!flux.browser.supportsTransitions) alert("Flux Slider requires a browser that supports CSS3 transitions");
        window.f = new flux.slider('#slider', { pagination: true }, myarrayPhoto);
        if (device.desktop())
        {
            $.ajax({                                        //second method
	        	type: "GET",
		        url: "Service.svc/GetNamesMusic",
		        contentType: "application/json; charset=utf-8",
		        dataType: "json",
		        processdata: true,
		        success: function(msg) {
		            serviceSucceedMusic(msg);
		        },
		        error: ServiceFailed
	        });
        }
    }

  And this action also resolved my problem. 
So what is happening? I guess that first my site loading runs building source code because first loading a very long time. And if at duration of this process again call site of service that it will be crash fastcgi_mono_server. Note that this bug is also in xps4.
It need to lock access to site when site is building or compiling or catch exception in order to not fail fastcgi_mono_server
Comment 3 pascal 2017-07-13 08:14:50 UTC
Confirming that I'm seeing the exact same problem.
Comment 4 Paul Fertser 2018-02-20 10:38:32 UTC
Let us continue the discussion at https://github.com/mono/mono/issues/7134 . Roman, Pascal, is the trivial fix not working for you or have you noticed any ill effects from it?