Bug 925 - NRE at System.Web.SessionState.SessionInProcHandler.GetItemInternal(..)
Summary: NRE at System.Web.SessionState.SessionInProcHandler.GetItemInternal(..)
Status: NEW
Alias: None
Product: Class Libraries
Classification: Mono
Component: System.Web (show other bugs)
Version: unspecified
Hardware: All All
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2011-09-20 06:19 UTC by Pablo Ruiz García
Modified: 2011-09-26 08:10 UTC (History)
2 users (show)

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

Test case (7.09 KB, application/x-gzip)
2011-09-26 08:07 UTC, Nikita Tsukanov

Description Pablo Ruiz García 2011-09-20 06:19:30 UTC
Randomly an ASP/ASP.MVC application running on mono throws the following exception:

System.NullReferenceException: Object reference not set to an instance of an object
  at System.Web.SessionState.SessionInProcHandler.GetItemInternal (System.Web.HttpContext context, System.String id, System.Boolean& locked, System.TimeSpan& lockAge, System.Object& lockId, System.Web.SessionState.SessionStateActions& actions, Boolean exclusive) [0x00054] in mono-2.10.2/mcs/class/System.Web/System.Web.SessionState_2.0/SessionInProcHandler.cs:166

This bug is related (but not the same) to: https://bugzilla.novell.com/show_bug.cgi?id=669807

From looking at the code looks like the session item object has been disposed before entering GetItemInternal.. and as there is a missing item.rwlock == null check, however due to the complexity of the code I'm not sure which should be the optimal fix (assume already locked?  to
Comment 1 Nikita Tsukanov 2011-09-26 08:07:33 UTC
Created attachment 490 [details]
Test case

I have the same problem, but I've managed to create some kind of test case that reproduces it quickly.

Just start it and click the button several times.
Comment 2 Nikita Tsukanov 2011-09-26 08:10:50 UTC
Oh, sorry, this "test case" is already exists in the bug report from your link. I've not seen it, because I get here when tried to report the same bug and saw it in possible duplicates list.

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