[Mono-bugs] [Bug 442647] New: Runtime crash when nested delegates are used with async callbacks in a static generic function

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Fri Nov 7 05:51:34 EST 2008


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


           Summary: Runtime crash when nested delegates are used with async
                    callbacks in a static generic function
           Product: Mono: Runtime
           Version: 2.0
          Platform: i686
        OS/Version: Ubuntu
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: generics
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: brian at sooloos.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: Community User


Created an attachment (id=250608)
 --> (https://bugzilla.novell.com/attachment.cgi?id=250608)
<100 line program to reproduce this bug

Description of Problem:

Code using nested delegates in a generic static function causes either native
runtime crash or runtime type load error on mono 2.0.1 as well as SVN trunk.
Both built to source with gcc 4.2.4. Example program works fine on the
microsoft stack.

Steps to reproduce the problem:
1. Compile attached .cs file
2. Run attached .cs file 

Actual Results:

Crashes like this:

Unhandled Exception: System.TypeLoadException: A type load exception has
occurred.
  at Foo.CacheHelper[String] (System.String key, IDictionary`2 dict,
Callback`1 startrequest, .EndRequestDelegate`1 endrequest, .Callback`1 cb)
[0x000a7] in /home/zorander/t.cs:87 
  at Foo.Main (System.String[] args) [0x00026] in /home/zorander/t.cs:22 

Expected Results:

Should print out the html for http://google.com

How often does this happen? 

Every time.

Additional Information:

I distilled this example from a much larger system that crashes in this code,
but in a different way. It seems very likely that the crashes are related,
however. When I run this as part of the larger system, I get a stack trace that
lives completely in the framework code and the runtime blows up on a
g_assert_not_reached:

         :                 **
         :                 ** ERROR:(object.c:681):compute_class_bitmap: code
should not be reached
         :                 Stacktrace:
         :                 
         :                   at
System.Web.Services.Protocols.WebClientAsyncResult.SetCompleted
(object,System.Exception,bool) <0xffffffff>
         :                   at
System.Web.Services.Protocols.WebClientAsyncResult.SetCompleted
(object,System.Exception,bool) <0x00070>
         :                   at
System.Web.Services.Protocols.SoapHttpClientProtocol.AsyncGetResponseDone
(System.IAsyncResult) <0x00232>
         :                   at System.Net.WebAsyncResult.DoCallback ()
<0x00020>
         :                   at System.Net.HttpWebRequest.SetResponseData
(System.Net.WebConnectionData) <0x00263>
         :                   at (wrapper remoting-invoke-with-check)
System.Net.HttpWebRequest.SetResponseData (System.Net.WebConnectionData)
<0xffffffff>
         :                   at System.Net.WebConnection.ReadDone
(System.IAsyncResult) <0x00555>
         :                   at SocketAsyncResult.Complete () <0x0017b>
         :                   at Worker.Receive () <0x00010>
         :                   at (wrapper delegate-invoke)
System.MulticastDelegate.invoke_void () <0xffffffff>
         :                   at (wrapper runtime-invoke)
System.Net.Configuration.NetSectionGroup.runtime_invoke_void
(object,intptr,intptr,intptr) <0xffffffff>
         :                 
         :                 Native stacktrace:
         :                 
         :                      mono [0x816b1fa]
         :                      [0xb7f1a440]
         :                      /lib/tls/i686/cmov/libc.so.6(abort+0x101)
[0xb7ce7a01]
         :                     
/usr/lib/libglib-2.0.so.0(g_assertion_message+0x121) [0xb7ea7651]
         :                      mono [0x80977c2]
         :                      mono [0x80979af]
         :                      mono(mono_class_vtable+0x15b) [0x809837b]
         :                      mono [0x814c32d]
         :                      mono [0x8156b71]
         :                      mono [0x81583b1]
         :                      mono [0x807f420]
         :                      [0xb7b5e574]
         :                      [0xb4b16a03]
         :                      [0xb6970ed1]
         :                      [0xb696f95c]
         :                      [0xb696f6c6]
         :                      [0xb696dbb6]
         :                      [0xb6c46b5c]
         :                      [0xb696d659]
         :                      [0xb6c46172]
         :                      [0xb6c5dde1]
         :                      mono(mono_runtime_invoke_array+0x433)
[0x809a6b3]
         :                      mono [0x809ad9d]
         :                      mono [0x80d09e3]
         :                      mono [0x80d1bd0]
         :                      mono [0x80cef04]
         :                      mono [0x811a7c2]
         :                      mono [0x81317a5]
         :                      /lib/tls/i686/cmov/libpthread.so.0 [0xb7e344fb]
         :                      /lib/tls/i686/cmov/libc.so.6(clone+0x5e)
[0xb7d91e5e]

There are a bunch of other threads, all of them blocked in __kernel_vsyscall,
that I have omitted from this trace since they are almost certainly irrelevant.

The crash seems to happen when attempting to invoke the async callback.


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


More information about the mono-bugs mailing list