[Mono-bugs] [Bug 668767] New: Graphics.FillPolygon threading crash (TPL)

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Tue Feb 1 18:16:07 EST 2011


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

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


           Summary: Graphics.FillPolygon threading crash (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

Using Graphics.FillPolygon() in separate threads on different objects
frequently crashes the Mono runtime.

Reproducible: Sometimes

Steps to Reproduce:
using System;
using System.Drawing;
using System.Threading.Tasks;
class TestFillPolygon
{
    public static void Main()
    {
        Parallel.For(0, 100, j =>
        {
            var bitmap = new Bitmap(800, 600);
            var brush = new SolidBrush(Color.White);
            Point[] points = {new Point(10, 10), new Point(790, 300), new
Point(10, 590)};
            using (var graphics = Graphics.FromImage(bitmap))
graphics.FillPolygon(brush, points);
        });
    }
}
Actual Results:  
SAMPLE OUTPUT 1:
===============

*** glibc detected *** mono: double free or corruption (!prev):
0x00000000015bfe00 ***
======= Backtrace: =========
/lib/libc.so.6(+0x774b6)[0x7f3e850e14b6]
/lib/libc.so.6(cfree+0x73)[0x7f3e850e7c83]
/usr/lib/libpixman-1.so.0(pixman_image_unref+0x96)[0x7f3e79470176]
/usr/lib/libcairo.so.2(+0x291b3)[0x7f3e7b0211b3]
/usr/lib/libcairo.so.2(+0x2a61c)[0x7f3e7b02261c]
/usr/lib/libcairo.so.2(+0x2bf1f)[0x7f3e7b023f1f]
/usr/lib/libcairo.so.2(+0x2c380)[0x7f3e7b024380]
/usr/lib/libcairo.so.2(+0x2c55e)[0x7f3e7b02455e]
/usr/lib/libcairo.so.2(+0x49f56)[0x7f3e7b041f56]
/usr/lib/libcairo.so.2(+0x2243e)[0x7f3e7b01a43e]
/usr/lib/libcairo.so.2(cairo_fill_preserve+0x1d)[0x7f3e7b01143d]
/usr/lib/libcairo.so.2(cairo_fill+0x9)[0x7f3e7b011469]
/opt/mono-git/lib/libgdiplus.so(+0x19ff6)[0x7f3e7b5afff6]
[0x41e18597]
======= Memory map: ========
00400000-006e0000 r-xp 00000000 08:05 2752632                           
/opt/mono-git/bin/mono
008e0000-008e1000 r--p 002e0000 08:05 2752632                           
/opt/mono-git/bin/mono
008e1000-008ea000 rw-p 002e1000 08:05 2752632                           
/opt/mono-git/bin/mono
008ea000-00924000 rw-p 00000000 00:00 0 
014d5000-01661000 rw-p 00000000 00:00 0                                  [heap]
4074e000-4074f000 r--p 00000000 00:00 0 
409f9000-40a0a000 rwxp 00000000 00:00 0 
412e5000-412f6000 rwxp 00000000 00:00 0 
41758000-41759000 ---p 00000000 00:00 0 
41e0b000-41e1c000 rwxp 00000000 00:00 0 
7f3e5c000000-7f3e5c02e000 rw-p 00000000 00:00 0 
7f3e5c02e000-7f3e60000000 ---p 00000000 00:00 0 
7f3e63dea000-7f3e63dff000 r-xp 00000000 08:05 1179704                   
/lib/libgcc_s.so.1
7f3e63dff000-7f3e63ffe000 ---p 00015000 08:05 1179704                   
/lib/libgcc_s.so.1
7f3e63ffe000-7f3e63fff000 r--p 00014000 08:05 1179704                   
/lib/libgcc_s.so.1
7f3e63fff000-7f3e64000000 rw-p 00015000 08:05 1179704                   
/lib/libgcc_s.so.1
7f3e64000000-7f3e64036000 rw-p 00000000 00:00 0 
7f3e64036000-7f3e68000000 ---p 00000000 00:00 0 
7f3e68000000-7f3e6805f000 rw-p 00000000 00:00 0 
7f3e6805f000-7f3e6c000000 ---p 00000000 00:00 0 
7f3e6c1e2000-7f3e6f703000 rw-p 00000000 00:00 0 
7f3e6f703000-7f3e6f8ac000 r--p 00000000 08:05 2755269                   
/opt/mono-2.8.2/lib/mono/gac/System/4.0.0.0__b77a5c561934e089/System.dll
7f3e6f8ac000-7f3e70000000 rw-p 00000000 00:00 0 
7f3e70000000-7f3e70065000 rw-p 00000000 00:00 0 
7f3e70065000-7f3e74000000 ---p 00000000 00:00 0 
7f3e74000000-7f3e74099000 rw-p 00000000 00:00 0 
7f3e74099000-7f3e78000000 ---p 00000000 00:00 0 
7f3e780aa000-7f3e787fe000 rw-p 00000000 00:00 0 
7f3e787fe000-7f3e78803000 r-xp 00000000 08:05 11930405                  
/usr/lib/libXdmcp.so.6.0.0
7f3e78803000-7f3e78a02000 ---p 00005000 08:05 11930405                  
/usr/lib/libXdmcp.so.6.0.0
7f3e78a02000-7f3e78a03000 r--p 00004000 08:05 11930405                  
/usr/lib/libXdmcp.so.6.0.0
7f3e78a03000-7f3e78a04000 rw-p 00005000 08:05 11930405                  
/usr/lib/libXdmcp.so.6.0.0
7f3e78a04000-7f3e78a06000 r-xp 00000000 08:05 11933400                  
/usr/lib/libXau.so.6.0.0
7f3e78a06000-7f3e78c05000 ---p 00002000 08:05 11933400                  
/usr/lib/libXau.so.6.0.0
7f3e78c05000-7f3e78c06000 r--p 00001000 08:05 11933400                  
/usr/lib/libXau.so.6.0.0
7f3e78c06000-7f3e78c07000 rw-p 00002000 08:05 11933400                  
/usr/lib/libXau.so.6.0.0
7f3e78c07000-7f3e78c2d000 r-xp 00000000 08:05 1179720                   
/lib/libexpat.so.1.5.2
7f3e78c2d000-7f3e78e2d000 ---p 00026000 08:05 1179720                   
/lib/libexpat.so.1.5.2
7f3e78e2d000-7f3e78e2f000 r--p 00026000 08:05 1179720                   
/lib/libexpat.so.1.5.2
7f3e78e2f000-7f3e78e30000 rw-p 00028000 08:05 1179720                   
/lib/libexpat.so.1.5.2
7f3e78e30000-7f3e78e4b000 r-xp 00000000 08:05 11930416                  
/usr/lib/libxcb.so.1.1.0
7f3e78e4b000-7f3e7904b000 ---p 0001b000 08:05 11930416                  
/usr/lib/libxcb.so.1.1.0
7f3e7904b000-7f3e7904c000 r--p 0001b000 08:05 11930416                  
/usr/lib/libxcb.so.1.1.0
7f3e7904c000-7f3e7904d000 rw-p 0001c000 08:05 11930416                  
/usr/lib/libxcb.so.1.1.0
7f3e7904d000-7f3e79054000 r-xp 00000000 08:05 11927883                  
/usr/lib/libxcb-render.so.0.0.0
7f3e79054000-7f3e79254000 ---p 00007000 08:05 11927883                  
/usr/lib/libxcb-render.so.0.0.0
7f3e79254000-7f3e79255000 r--p 00007000 08:05 11927883                  
/usr/lib/libxcb-render.so.0.0.0
7f3e79255000-7f3e79256000 rw-p 00008000 08:05 11927883                  
/usr/lib/libxcb-render.so.0.0.0
7f3e79256000-7f3e79258000 r-xp 00000000 08:05 11928434                  
/usr/lib/libxcb-shm.so.0.0.0
7f3e79258000-7f3e79457000 ---p 00002000 08:05 11928434                  
/usr/lib/libxcb-shm.so.0.0.0
7f3e79457000-7f3e79458000 r--p 00001000 08:05 11928434                  
/usr/lib/libxcb-shm.so.0.0.0
7f3e79458000-7f3e79459000 rw-p 00002000 08:05 11928434                  
/usr/lib/libxcb-shm.so.0.0.0
7f3e79459000-7f3e794b4000 r-xp 00000000 08:05 11927711                  
/usr/lib/libpixman-1.so.0.18.4
7f3e794b4000-7f3e796b3000 ---p 0005b000 08:05 11927711                  
/usr/lib/libpixman-1.so.0.18.4
7f3e796b3000-7f3e796b7000 r--p 0005a000 08:05 11927711                  
/usr/lib/libpixman-1.so.0.18.4
7f3e796b7000-7f3e796b8000 rw-p 0005e000 08:05 11927711                  
/usr/lib/libpixman-1.so.0.18.4
7f3e796b8000-7f3e796e8000 r-xp 00000000 08:05 1179715                   
/lib/libpcre.so.3.12.1
7f3e796e8000-7f3e798e7000 ---p 00030000 08:05 1179715                   
/lib/libpcre.so.3.12.1
7f3e798e7000-7f3e798e8000 r--p 0002f000 08:05 1179715                   
/lib/libpcre.so.3.12.1
7f3e798e8000-7f3e798e9000 rw-p 00030000 08:05 1179715                   
/lib/libpcre.so.3.12.1
7f3e798e9000-7f3e7991c000 r-xp 00000000 08:05 11930698                  
/usr/lib/libfontconfig.so.1.4.4
7f3e7991c000-7f3e79b1c000 ---p 00033000 08:05 11930698                  
/usr/lib/libfontconfig.so.1.4.4
7f3e79b1c000-7f3e79b1d000 r--p 00033000 08:05 11930698                  
/usr/lib/libfontconfig.so.1.4.4
7f3e79b1d000-7f3e79b1e000 rw-p 00034000 08:05 11930698                  
/usr/lib/libfontconfig.so.1.4.4
7f3e79b1e000-7f3e79b4f000 r-xp 00000000 08:05 11930690                  
/usr/lib/libexif.so.12.3.1
7f3e79b4f000-7f3e79d4f000 ---p 00031000 08:05 11930690                  
/usr/lib/libexif.so.12.3.1
7f3e79d4f000-7f3e79d62000 r--p 00031000 08:05 11930690                  
/usr/lib/libexif.so.12.3.1Stacktrace:

  at (wrapper managed-to-native) System.Drawing.GDIPlus.GdipFillPolygon2I
(intptr,intptr,System.Drawing.Point[],int) <0xffffffff>
  at System.Drawing.Graphics.FillPolygon
(System.Drawing.Brush,System.Drawing.Point[]) <0x000cf>
  at (wrapper remoting-invoke-with-check) System.Drawing.Graphics.FillPolygon
(System.Drawing.Brush,System.Drawing.Point[]) <0xffffffff>
  at TestBitmap.<Main>m__0 (int) <0x00193>
  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 ()
<0x002d9>
  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 () <0x000cc>
  at System.Threading.Tasks.Task.Execute
(System.Action`1<System.Threading.Tasks.Task>) <0x00033>
  at System.Threading.Tasks.ThreadWorker.ParticipativeWorkerMethod
(System.Threading.Tasks.Task,System.Threading.ManualResetEventSlim,int,System.Collections.Concurrent.IProducerConsumerCollection`1<System.Threading.Tasks.Task>,System.Threading.Tasks.ThreadWorker[],System.Threading.ManualResetEvent)
<0x00153>
  at System.Threading.Tasks.Scheduler.ParticipateUntilInternal
(System.Threading.Tasks.Task,System.Threading.ManualResetEventSlim,int)
<0x0003f>
  at System.Threading.Tasks.Scheduler.ParticipateUntil
(System.Threading.Tasks.Task) <0x000eb>
  at System.Threading.Tasks.Task.Wait () <0x00045>
  at System.Threading.Tasks.Task.WaitAll (System.Threading.Tasks.Task[])
<0x0005b>
  at System.Threading.Tasks.Parallel.For<TLocal>
(int,int,System.Threading.Tasks.ParallelOptions,System.Func`1<TLocal>,System.Func`4<int,
System.Threading.Tasks.ParallelLoopState, TLocal,
TLocal>,System.Action`1<TLocal>) <0x00457>
  at System.Threading.Tasks.Parallel.For
(int,int,System.Threading.Tasks.ParallelOptions,System.Action`2<int,
System.Threading.Tasks.ParallelLoopState>) <0x00163>
  at System.Threading.Tasks.Parallel.For
(int,int,System.Threading.Tasks.ParallelOptions,System.Action`1<int>) <0x0008f>
  at System.Threading.Tasks.Parallel.For (int,int,System.Action`1<int>)
<0x0003b>
  at TestBitmap.Main () <0x0007b>
  at (wrapper runtime-invoke) object.runtime_invoke_void
(object,intptr,intptr,intptr) <0xffffffff>

Native stacktrace:

    mono() [0x48f3ab]
    /lib/libpthread.so.0(+0xfb40) [0x7f3e853fcb40]
    /lib/libc.so.6(gsignal+0x35) [0x7f3e8509dba5]
    /lib/libc.so.6(abort+0x180) [0x7f3e850a16b0]
    /lib/libc.so.6(+0x6d43b) [0x7f3e850d743b]
    /lib/libc.so.6(+0x774b6) [0x7f3e850e14b6]
    /lib/libc.so.6(cfree+0x73) [0x7f3e850e7c83]
    /usr/lib/libpixman-1.so.0(pixman_image_unref+0x96) [0x7f3e79470176]
    /usr/lib/libcairo.so.2(+0x291b3) [0x7f3e7b0211b3]
    /usr/lib/libcairo.so.2(+0x2a61c) [0x7f3e7b02261c]
    /usr/lib/libcairo.so.2(+0x2bf1f) [0x7f3e7b023f1f]
    /usr/lib/libcairo.so.2(+0x2c380) [0x7f3e7b024380]
    /usr/lib/libcairo.so.2(+0x2c55e) [0x7f3e7b02455e]
    /usr/lib/libcairo.so.2(+0x49f56) [0x7f3e7b041f56]
    /usr/lib/libcairo.so.2(+0x2243e) [0x7f3e7b01a43e]
    /usr/lib/libcairo.so.2(cairo_fill_preserve+0x1d) [0x7f3e7b01143d]
    /usr/lib/libcairo.so.2(cairo_fill+0x9) [0x7f3e7b011469]
    /opt/mono-git/lib/libgdiplus.so(+0x19ff6) [0x7f3e7b5afff6]
    [0x41e18597]

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



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


Stacktrace:


Native stacktrace:

    mono() [0x48f3ab]
    mono() [0x4e3cbf]
    mono() [0x41500b]
    /lib/libpthread.so.0(+0xfb40) [0x7fc60b292b40]
    /lib/libc.so.6(+0x7763a) [0x7fc60af7763a]
    /lib/libc.so.6(+0x7ae82) [0x7fc60af7ae82]
    /lib/libc.so.6(__libc_calloc+0xc4) [0x7fc60af7e254]
    /usr/lib/libpixman-1.so.0(pixman_image_create_bits+0x1d5) [0x7fc5ef224015]
    /usr/lib/libcairo.so.2(+0x29102) [0x7fc604f3e102]
    /usr/lib/libcairo.so.2(+0x2a61c) [0x7fc604f3f61c]
    /usr/lib/libcairo.so.2(+0x2bf1f) [0x7fc604f40f1f]
    /usr/lib/libcairo.so.2(+0x2c380) [0x7fc604f41380]
    /usr/lib/libcairo.so.2(+0x2c55e) [0x7fc604f4155e]
    /usr/lib/libcairo.so.2(+0x49f56) [0x7fc604f5ef56]
    /usr/lib/libcairo.so.2(+0x2243e) [0x7fc604f3743e]
    /usr/lib/libcairo.so.2(cairo_fill_preserve+0x1d) [0x7fc604f2e43d]
    /usr/lib/libcairo.so.2(cairo_fill+0x9) [0x7fc604f2e469]
    /opt/mono-git/lib/libgdiplus.so(+0x19ff6) [0x7fc6054ccff6]
    [0x41c7d5e7]

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 SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your application.
=================================================================


SAMPLE OUTPUT 3:
===============
Segmentation fault

Expected Results:  
No crash.

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