[Mono-list] Crash in cairo

Julien Sobrier julien at sobrier.net
Thu Mar 22 00:11:37 EDT 2007


[Sorry, this e-mail was sent to Juan only]

Hello,
I ran the same application on 2 FC6 with same mono and Cairo version.
One is in 1024x768, works fine, the other is 640x480 and crashes with
this method:
protected override bool OnExposeEvent(Gdk.EventExpose evnt)
{
  if (!IsRealized)
  {
    return false;
  }

  Cairo.Context cr = Gdk.CairoHelper.Create(GdkWindow);
  bool retval = true;

  foreach (Gdk.Rectangle rect in evnt.Region.GetRectangles())
  {
    Console.WriteLine(String.Format("{0} {1} {2} {3}", rect.X, rect.Y,
rect.Width, rect.Height));
    cr.Rectangle(rect.X, rect.Y, rect.Width, rect.Height); // CRASH
    cr.Clip();
    retval |= DrawCover(cr);
    }
  }

  ((IDisposable)cr).Dispose();
            return retval;
}

It crashes on the 2nd iteration. The rectangle values are:
390 0 250 24
586 24 54 95

I don't get any exception, but a crash:
=================================================================
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.
=================================================================

Stacktrace:

  at (wrapper managed-to-native) Cairo.CairoAPI.cairo_rectangle
(intptr,double,double,double,double) <0x00004>
  at (wrapper managed-to-native) Cairo.CairoAPI.cairo_rectangle
(intptr,double,double,double,double) <0xffffffff>
  at Cairo.Context.Rectangle (double,double,double,double) [0x00000] in
/builddir/build/BUILD/mono-1.1.17.1/mcs/clas
s/Mono.Cairo/Mono.Cairo/Context.cs:453

Thank you
Julien

Juan C. Olivares wrote:
> Julien:
> 
> Can you send a testcase? What exception do you catch?
> 
> JCO
> 
> On 3/21/07, *Julien Sobrier* <julien at sobrier.net
> <mailto:julien at sobrier.net>> wrote:
> 
>     Juan C. Olivares wrote:
>     > Take a look at mcs/class/Mono.Cairo (just like your path). I think
>     you
>     > should update your mono installation to 1.2.3 or SVN.
>     >
>     > http://svn.myrealbox.com/viewcvs/trunk/mcs/class/Mono.Cairo/
>     > < http://svn.myrealbox.com/viewcvs/trunk/mcs/class/Mono.Cairo/>
>     >
>     > Best regards.
>     > JCO
> 
>     Thank you. It rashes in this method:
>     public void Rectangle (double x, double y, double width, double height)
>     {
>         CairoAPI.cairo_rectangle (state, x, y, width, height);
>     }
> 
>     I wonder what could possibly go wrong.
> 
>     Julien
>     _______________________________________________
>     Mono-list maillist  -  Mono-list at lists.ximian.com
>     <mailto:Mono-list at lists.ximian.com>
>     http://lists.ximian.com/mailman/listinfo/mono-list
> 
> 
> 
> 
> -- 
> Juan Cristóbal Olivares




More information about the Mono-list mailing list