[Mono-bugs] [Bug 371562] New: RoleManagerModule NRE or System.Web needs some locking

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Sun Mar 16 11:24:06 EDT 2008


https://bugzilla.novell.com/show_bug.cgi?id=371562


           Summary: RoleManagerModule NRE or System.Web needs some locking
           Product: Mono: Class Libraries
           Version: 1.9.0
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Sys.Web
        AssignedTo: mhabersack at novell.com
        ReportedBy: jit at occams.info
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


Occasionally I am seeing in my website a NRE in
System.Web.Security.RoleManagerModule as follows:

System.NullReferenceException: Object reference not set to an instance of an
object
  at System.Web.Security.RoleManagerModule.OnPostAuthenticateRequest
(System.Object sender, System.EventArgs args) [0x00007] in
/tmp/monobuild/build/BUILD/mono-1.9/mcs/class/System.Web/System.Web.Security/RoleManagerModule.cs:65
  at System.Web.HttpApplication+<>c__CompilerGenerated1.MoveNext ()
[0x001d9] in
/tmp/monobuild/build/BUILD/mono-1.9/mcs/class/System.Web/System.Web/HttpApplication.cs:793
  at System.Web.HttpApplication+<>c__CompilerGenerated2.MoveNext ()
[0x002fd] in
/tmp/monobuild/build/BUILD/mono-1.9/mcs/class/System.Web/System.Web/HttpApplication.cs:913
  at System.Web.HttpApplication.Tick () [0x00000] in
/tmp/monobuild/build/BUILD/mono-1.9/mcs/class/System.Web/System.Web/HttpApplication.cs:697

The offending line is accessing a private field (_config) that has not been
initialized yet. It suggests that the problem is in the class's
IHttpModule.Init, where it adds its event handlers to the HttpApplication
*before* initializing _config, and an event handler is being called in the
middle.

I would just change this myself and make sure the field is set before the
events are registered, but maybe this is a symptom of a larger problem in how
modules are initialized and the order things happen in? (RoleManagerModule has
been like this since r74728, 2007-03-21.)


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list