JSON deserialization infinite loop

Topics: ASP.NET Web API
Aug 1, 2012 at 4:55 PM

I just posted this JSON.NET bug that we encountered while using Web API:

http://json.codeplex.com/workitem/23115

We've also discovered that when JSON.NET gets in this bad state during a request, it pegs a core. If another request has the same problem it pegs another core and so on.

Why doesn't the request time out? We've had to manually kill the w3p process - recycling the app pool is not sufficient.

We are using IIS 7.5 on Windows Service 2008 R2 x64. The web site connection timeout is set to 120 seconds.

Aug 2, 2012 at 6:23 PM

This issue has been fixed by James:

https://github.com/JamesNK/Newtonsoft.Json/commit/be82ab9f0b7e74ab77921ce5c41b78b3471d0d9d

and I expect the fix will be available in the next release of Json.NET.

Thanks for reporting the issue

Aug 2, 2012 at 6:29 PM
Edited Aug 2, 2012 at 6:30 PM

Wow, James - thanks!

Am I stuck until the next version of Json.NET is released? 

From what I understand, I can't build and use Json.NET in Web API because it's unsigned and there doesn't seem to be any nightly or pre-release NuGet packages available. Is there a way around this?

Aug 24, 2012 at 11:24 PM

The fix should be available in Json.NET 4.5.8:

http://nuget.org/packages/Newtonsoft.Json/4.5.8

Youssef