Bug 45866

Summary: Crash in _cairo_surface_fill() because backend->fill wasn't populated
Product: cairo Reporter: John Ralls <jralls>
Component: quartz backendAssignee: Vladimir Vukicevic <vladimir>
Status: RESOLVED FIXED QA Contact: cairo-bugs mailing list <cairo-bugs>
Severity: critical    
Priority: medium    
Version: 1.10.3   
Hardware: All   
OS: Mac OS X (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: Add a NULL for backend->source to cairo_quartz_surface_backend

Description John Ralls 2012-02-09 22:47:10 UTC
Created attachment 56846 [details] [review]
Add a NULL for backend->source to cairo_quartz_surface_backend

The tip of the backtrace:

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x00000000
0x00000000 in ?? ()
(gdb) bt
#0  0x00000000 in ?? ()
#1  0x008bf039 in _cairo_surface_fill (surface=0x1150160, op=CAIRO_OPERATOR_OVER, source=0xbfff9b80, path=0x30072c4, fill_rule=CAIRO_FILL_RULE_EVEN_ODD, tolerance=0.10000000000000001, antialias=CAIRO_ANTIALIAS_DEFAULT, clip=0x1151710) at cairo-surface.c:2003
#2  0x00873d44 in _cairo_gstate_fill (gstate=0x11515c0, path=0x30072c4) at cairo-gstate.c:1268

The dump of the backend structure showing the misaligned function pointers:
(gdb) p *surface->backend
$4 = {
  type = CAIRO_SURFACE_TYPE_QUARTZ, 
  finish = 0x8f43aa <_cairo_quartz_surface_finish>, 
  create_context = 0x86e020 <_cairo_default_context_create>, 
  create_similar = 0x8f45a5 <_cairo_quartz_surface_create_similar>, 
  create_similar_image = 0, 
  map_to_image = 0x8f4529 <_cairo_quartz_surface_map_to_image>, 
  unmap_image = 0x8f458d <_cairo_quartz_surface_unmap_image>, 
  source = 0x8f4470 <_cairo_quartz_surface_acquire_source_image>, 
  acquire_source_image = 0x8f4516 <_cairo_quartz_surface_release_source_image>, 
  release_source_image = 0x8f44bd <_cairo_quartz_surface_snapshot>, 
  snapshot = 0, 
  copy_page = 0, 
  show_page = 0x8f4697 <_cairo_quartz_surface_get_extents>, 
  get_extents = 0, 
  get_font_options = 0, 
  flush = 0, 
  mark_dirty_rectangle = 0x8f5b5a <_cairo_quartz_surface_paint>, 
  paint = 0x8f5b97 <_cairo_quartz_surface_mask>, 
  mask = 0x8f5c44 <_cairo_quartz_surface_stroke>, 
  stroke = 0x8f5bdb <_cairo_quartz_surface_fill>, 
  fill = 0, 
  fill_stroke = 0x8f5cbb <_cairo_quartz_surface_glyphs>, 
  show_glyphs = 0, 
  has_show_text_glyphs = 0, 
  show_text_glyphs = 0, 
  get_supported_mime_types = 0
}
Comment 1 Chris Wilson 2012-02-10 01:22:53 UTC
commit 154e6b052bca4189ef067dc9385b224803e6f053
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Fri Feb 10 09:20:21 2012 +0000

    quartz: Add missing source hook
    
    Regression from 2061cd81f2.
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45866
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

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.