Skip to content
This repository was archived by the owner on Dec 18, 2018. It is now read-only.

Get NullReferenceException when running kestrel for a while #115

Closed
cnblogs-dudu opened this issue Jun 29, 2015 · 5 comments
Closed

Get NullReferenceException when running kestrel for a while #115

cnblogs-dudu opened this issue Jun 29, 2015 · 5 comments

Comments

@cnblogs-dudu
Copy link

# dnx . kestrel
Started

Unhandled Exception: System.NullReferenceException: 
Object reference not set to an instance of an object.
at Microsoft.AspNet.Server.Kestrel.Networking.UvShutdownReq.UvShutdownCb(IntPtr ptr, Int32 status)

# dnx . kestrel
Started
@cnblogs-dudu cnblogs-dudu changed the title Get NullReferenceException when runing kestrel for a while Get NullReferenceException when running kestrel for a while Jun 29, 2015
@Tragetaschen
Copy link
Contributor

#63

@shhsu
Copy link

shhsu commented Jul 7, 2015

I have actually gotten a similar issue during perf test, most of the time I get the NRE as above but sometimes I get this instead

Unhandled Exception: System.InvalidCastException: Unable to cast object of type 'ThisWriteReq' to type 'Microsoft.AspNet.Server.Kestrel.Networking.UvShutdownReq'.
at Microsoft.AspNet.Server.Kestrel.Networking.UvMemory.FromIntPtr[THandle](IntPtr handle)
at Microsoft.AspNet.Server.Kestrel.Networking.UvShutdownReq.UvShutdownCb(IntPtr ptr, Int32 status)

@sajayantony
Copy link
Member

/cc @davidfowl do you guys have someone fixing this already. This is quite a bad blocking issue. @shhsu Do you have a potential fix for this?

@lodejard
Copy link
Contributor

lodejard commented Jul 9, 2015

It sounds like the period of time that the async shutdown is "active" needs to be guarded by a gchandle as well. Same as the uvwritereq - handle created when operation begins and freed in the callback.

@shhsu
Copy link

shhsu commented Jul 9, 2015

The reproduction of this problem is simple.

  • Build and run HelloMvc app with coreclr on linux (I used Ubuntu)
  • Hit the index page with some load test (I used WCat)
    Kestrel should crash pretty fast (10~20 seconds)

Note: I seem to be getting similar trouble with Kestrel on coreclr on Windows as well. After hitting HelloMvc on Kestrel on Windows the dnx process would become unresponsive. I will be debugging it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants