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: 2017-07-13 08:14 UTC (History)
3 users (show)

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


Attachments

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.

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