Bug 18632

Summary: failed assertion `CAIRO_REFERENCE_COUNT_HAS_REFERENCE (&pattern->ref_count)' when using cairo quartz backend
Product: cairo Reporter: Paolo Bonzini <bonzini>
Component: quartz backendAssignee: Vladimir Vukicevic <vladimir>
Status: RESOLVED FIXED QA Contact: cairo-bugs mailing list <cairo-bugs>
Severity: major    
Priority: medium CC: askok
Version: 1.9.1   
Hardware: PowerPC   
OS: Mac OS X (All)   
URL: https://bugs.freedesktop.org/attachment.cgi?id=16307
Whiteboard:
i915 platform: i915 features:

Description Paolo Bonzini 2008-11-20 04:22:03 UTC
Trying to reproduce bug 15797 with current git (63a86a470f) I found that the bug is not anymore reproducible because cairo crashes earlier with an assertion failure.

The program is at https://bugs.freedesktop.org/attachment.cgi?id=16307

It works correctly with an image surface (try uncommenting this line:

  /* #undef CAIRO_HAS_QUARTZ_SURFACE */

to test).
Comment 1 Asko Kauppi 2008-12-09 02:12:24 UTC
I can reproduce this bug on any of the systems (OS X PowerPC/Intel, Linux x86, Windows XP).

It is a statistical bug, happening randomly. To repeat:

1. Get "TexasFlag" project from Google pages or subversion (recommended):

   http://akauppi.googlepages.com/TX-20081127.tgz
   svn co svn://slugak.dyndns.org/public/2009/TX

2. "make run"

4. There should be a Texas flag drawn in a GUI window. 

5. Start resizing the window by dragging from its corner.  Within a second or so, you'd get a crash.

On OS X, it may be beneficial to start the utility like (gives you the console log):

$ TexasFlag.app/Contents/MacOS/TexasFlag 
Assertion failed: (CAIRO_REFERENCE_COUNT_HAS_REFERENCE (&cr->ref_count)), function cairo_destroy, file cairo.c, line 218.

Running Cairo 1.8.4 on all the systems.

Comment 2 Paolo Bonzini 2008-12-09 06:48:31 UTC
See http://permalink.gmane.org/gmane.comp.lib.cairo/15727 for analysis and patches.
Comment 3 Paolo Bonzini 2008-12-09 06:49:48 UTC
Asko's failure is not related to this bug (this bug is for a failure in cairo-quartz-surface.c with the example program in the attachment).
Comment 4 Chris Wilson 2008-12-14 05:10:49 UTC
(In reply to comment #1)
> $ TexasFlag.app/Contents/MacOS/TexasFlag 
> Assertion failed: (CAIRO_REFERENCE_COUNT_HAS_REFERENCE (&cr->ref_count)),
> function cairo_destroy, file cairo.c, line 218.
> 
> Running Cairo 1.8.4 on all the systems.

This is most likely to be an application bug - if you can reproduce this with a minimal test case please open a new bug.

Jeff Muizelaar fixed the invalid referencing of the uncopied pattern, the original bug, with commit 
d93bf10edc7e432349524221a3d1b0f0b2ec8090.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.