[Mono-bugs] [Bug 668489] New: Bitmap constructor crashes in multi-threaded (TPL)

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Jan 31 18:55:25 EST 2011


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

https://bugzilla.novell.com/show_bug.cgi?id=668489#c0


           Summary: Bitmap constructor crashes in multi-threaded (TPL)
    Classification: Mono
           Product: Mono: Runtime
           Version: SVN
          Platform: x86-64
        OS/Version: Ubuntu
            Status: NEW
          Severity: Critical
          Priority: P5 - None
         Component: misc
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: john.costella at petermac.org
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


User-Agent:       Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.10
(KHTML, like Gecko) Chrome/8.0.552.237 Safari/534.10

Constructing bitmaps in different threads frequently crashes the current SVN
runtime.

Reproducible: Sometimes

Steps to Reproduce:
using System;
using System.Drawing;
using System.Threading.Tasks;
class TestBitmap
{
    public static void Main()
    {
        Parallel.For(0, 10, j => new Bitmap(800, 600));
    }
}

Actual Results:  
SAMPLE OUTPUT 1:
===============

* Assertion at method-to-ir.c:9188, condition `helper->slot' not met

Stacktrace:

  at System.Drawing.Bitmap..ctor (int,int,System.Drawing.Imaging.PixelFormat)
<0x00053>
  at System.Drawing.Bitmap..ctor (int,int) <0x0001b>
* Assertion at method-to-ir.c:9188, condition `helper->slot' not met
  at (wrapper remoting-invoke-with-check) System.Drawing.Bitmap..ctor (int,int)
<0xffffffff>

  at TestBitmap.<Main>m__0 (int) <0x0002b>




SAMPLE OUTPUT 2:
===============

* Assertion at method-to-ir.c:9188, condition `helper->slot' not met

Stacktrace:

  at System.Drawing.Bitmap..ctor (int,int,System.Drawing.Imaging.PixelFormat)
<0x00053>
  at System.Drawing.Bitmap..ctor (int,int) <0x0001b>
  at (wrapper remoting-invoke-with-check) System.Drawing.Bitmap..ctor (int,int)
<0xffffffff>
  at TestBitmap.<Main>m__0 (int) <0x00027>
  at System.Threading.Tasks.Parallel/<For>c__AnonStorey40.<>m__3C
(int,System.Threading.Tasks.ParallelLoopState) <0x0001e>
  at System.Threading.Tasks.Parallel/<For>c__AnonStorey41.<>m__3E
(int,System.Threading.Tasks.ParallelLoopState,object) <0x00028>
  at System.Threading.Tasks.Parallel/<For>c__AnonStorey42`1.<>m__40 ()
<0x00297>
  at System.Threading.Tasks.TaskFactory/<StartNew>c__AnonStorey15.<>m__B
(object) <0x00014>
  at System.Threading.Tasks.Task.InnerInvoke () <0x00021>
  at System.Threading.Tasks.Task.ThreadStart () <0x00109>
  at System.Threading.Tasks.Task.Execute
(System.Action`1<System.Threading.Tasks.Task>) <0x00051>
  at System.Threading.Tasks.ThreadWorker.WorkerMethod () <0x00236>
  at System.Threading.Tasks.ThreadWorker.WorkerMethodWrapper () <0x0006f>
  at System.Threading.Thread.StartUnsafe () <0x000a8>
  at (wrapper runtime-invoke) object.runtime_invoke_void__this__
(object,intptr,intptr,intptr) <0xffffffff>

Native stacktrace:

    mono() [0x48f30b]
    /lib/libpthread.so.0(+0xfb40) [0x7f9035b25b40]
    /lib/libc.so.6(gsignal+0x35) [0x7f90357c6ba5]
    /lib/libc.so.6(abort+0x180) [0x7f90357ca6b0]
    mono() [0x5d2b4a]
    mono() [0x5d2cfb]
    mono() [0x44f9e2]
    mono() [0x418ee7]
    mono() [0x41b05d]
    mono() [0x41b8fd]
    mono() [0x492d24]
    mono() [0x49391d]
    [0x40b4516a]

Debug info from gdb:

Could not attach to process.  If your uid matches the uid of the target
process, check the setting of /proc/sys/kernel/yama/ptrace_scope, or try
again as the root user.  For more details, see /etc/sysctl.d/10-ptrace.conf
ptrace: Operation not permitted.

=================================================================
Got a SIGABRT while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your application.
=================================================================


Expected Results:  
No crash

I was whittling down similar TPL crashes on FillPolygon (on different Bitmap
instances) when I realised that just constructing separate Bitmap instances was
even crashing the runtime.

-- 
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