Summary: | Cairo asserts on font-face destroy (SIGABRT) | ||
---|---|---|---|
Product: | cairo | Reporter: | Arjan Molenaar <gaphor> |
Component: | general | Assignee: | Carl Worth <cworth> |
Status: | RESOLVED MOVED | QA Contact: | cairo-bugs mailing list <cairo-bugs> |
Severity: | major | ||
Priority: | high | CC: | boenzlip, erik-freedesktop-bugzilla, gaphor, graham.westlake, pgroce, sw |
Version: | 1.8.6 | Keywords: | have-backtrace |
Hardware: | x86 (IA32) | ||
OS: | Mac OS X (All) | ||
URL: | http://gaphor.devjavu.com/ticket/158 | ||
Whiteboard: | |||
i915 platform: | i915 features: |
Description
Arjan Molenaar
2009-01-19 12:08:21 UTC
I ave no problems with the latest code from GIT, so it's probably just a glitch. Hi, I hope I'm not doing something wrong by reopening this bug. On my system and on all other systems we have in our company (Mac OSX 10.5.6) we have the same problem. cairo @1.8.6_3+macosx code: ctx.set_source_rgb(color[1][0], color[1][1], color[1][2]) ctx.select_font_face("Arial", cairo.FONT_SLANT_NORMAL, cairo.FONT_WEIGHT_NORMAL) ctx.set_font_size(int(min(self.icon_width_, self.icon_height_) / 1.5)) x_bearing, y_bearing, width, height = ctx.text_extents(str(line_number))[:4] # this is where the problem happens unfortunately alone, the bug doesn't show up. only after executing this code in a loop for several 1000 times, always using a new ctx. I have created a minimal test to reproduce this bug: while True: surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, 256, 256) ctx = cairo.Context(surface) ctx.show_text("asdf") After some iterations it will fail (here takes not more than 10 seconds). This looks similar to my use case. I can't reproduce the error with the latest version from Git, though. installed newest source from git. problem fixed. Thank you for your testing. May I inquire as to whether the problem still occurs in the 1.8 branch or MacPorts? To switch to the 1.8 branch, you can use "git checkout -b 1.8 origin/1.8". The problem is still present in the newset version of the cairo macport (cairo @1.8.6_3+macosx). Didn't have a chance to test with your repository directly. This bug is still present in cairo 1.8.8 in a GTK-Quartz based program: Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000 Crashed Thread: 0 Thread 0 Crashed: 0 libSystem.B.dylib 0x94831e42 __kill + 10 1 libSystem.B.dylib 0x948a423a raise + 26 2 libSystem.B.dylib 0x948b0679 abort + 73 3 libcairo.2.dylib 0x002a8194 __eprintf + 84 4 libcairo.2.dylib 0x0025fc5a cairo_font_face_destroy + 154 5 libcairo.2.dylib 0x00275af2 _cairo_scaled_font_fini_internal + 34 6 libcairo.2.dylib 0x00275be0 cairo_scaled_font_destroy + 144 7 libcairo.2.dylib 0x0027831c cairo_scaled_font_create + 396 8 libcairo.2.dylib 0x00260d8f _cairo_gstate_ensure_scaled_font + 111 9 libcairo.2.dylib 0x00263bf5 _cairo_gstate_show_text_glyphs + 101 10 libcairo.2.dylib 0x0025b67d cairo_show_glyphs + 93 11 libpangocairo-1.0.0.dylib 0x00208091 pango_cairo_renderer_show_text_glyphs + 721 12 libpangocairo-1.0.0.dylib 0x002084b5 pango_cairo_renderer_draw_glyphs + 69 13 libpango-1.0.0.dylib 0x0022f9ea pango_renderer_draw_glyphs + 90 14 libpangocairo-1.0.0.dylib 0x00206c91 _pango_cairo_do_glyph_string + 209 15 libpango-1.0.0.dylib 0x0022f9ea pango_renderer_draw_glyphs + 90 16 libpango-1.0.0.dylib 0x002301a6 pango_renderer_draw_layout_line + 1526 17 libpango-1.0.0.dylib 0x00230549 pango_renderer_draw_layout + 249 18 libgdk-quartz-2.0.0.dylib 0x0015757c gdk_draw_layout_with_colors + 412 19 libgdk-quartz-2.0.0.dylib 0x00157736 gdk_draw_layout + 214 20 libgtk-quartz-2.0.0.dylib 0x005af599 gtk_default_draw_layout + 137 21 libgtk-quartz-2.0.0.dylib 0x0046749d gtk_cell_renderer_text_render + 365 22 libgtk-quartz-2.0.0.dylib 0x00643602 gtk_tree_view_column_cell_process_action + 1266 23 libgtk-quartz-2.0.0.dylib 0x0064439c _gtk_tree_view_column_cell_render + 188 24 libgtk-quartz-2.0.0.dylib 0x0063ffef gtk_tree_view_expose + 4943 25 libgtk-quartz-2.0.0.dylib 0x00523a5e _gtk_marshal_BOOLEAN__BOXED + 126 26 libgobject-2.0.0.dylib 0x009329d8 g_closure_invoke + 296 27 libgobject-2.0.0.dylib 0x00948503 signal_emit_unlocked_R + 2963 28 libgobject-2.0.0.dylib 0x00949b9d g_signal_emit_valist + 1437 29 libgobject-2.0.0.dylib 0x0094a219 g_signal_emit + 41 30 libgtk-quartz-2.0.0.dylib 0x00653395 gtk_widget_event_internal + 645 31 libgtk-quartz-2.0.0.dylib 0x0051c5c9 gtk_main_do_event + 1673 32 libgdk-quartz-2.0.0.dylib 0x0017ab4a -[GdkQuartzView drawRect:] + 650 33 com.apple.AppKit 0x91dd422c -[NSView _drawRect:clip:] + 3853 34 com.apple.AppKit 0x91dd1a9d -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView :] + 1819 35 com.apple.AppKit 0x91dcdadf -[NSView _displayRectIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:] + 3090 36 com.apple.AppKit 0x91d0e4b3 -[NSView displayIfNeeded] + 933 37 libgdk-quartz-2.0.0.dylib 0x0016efbb gdk_window_quartz_process_updates_internal + 203 38 libgdk-quartz-2.0.0.dylib 0x00173b67 gdk_window_quartz_update_idle + 151 39 libgdk-quartz-2.0.0.dylib 0x0014bfcb gdk_threads_dispatch + 91 40 libglib-2.0.0.dylib 0x0099c640 g_main_context_dispatch + 352 41 libglib-2.0.0.dylib 0x0099f3e4 g_main_context_iterate + 852 42 libglib-2.0.0.dylib 0x0099f697 g_main_loop_run + 423 43 libgtk-quartz-2.0.0.dylib 0x0051c811 gtk_main + 177 44 nntpgrab_gui 0x0000dbb1 main + 1567 45 nntpgrab_gui 0x000023a3 _start + 209 46 nntpgrab_gui 0x000022d1 start + 41 I'm also seeing this bug on Snow Leopard (10.6.1) using Cairo 1.8.8. Exactly the same stack. I'm writing an app to evaluate Cairo performance. I find that the crash is triggered after a large number of pieces of text are drawn into the same window. My repeatable case does the following Upon window update event: -- create cairo surface and context from the supplied CGContext -- for many text items, using the same font name but a new size: ---- draw text using cairo_select_font_face and cairo_show_text I generate an update event by resizing the window and the crash will occur within a few resizes. Bug is also occurring in 1.9.2 snapshot We're seeing this bug in Cairo 1.8.8 on OSX 10.5.8. (Specifically, it's the 1.8.8-2 package from fink.) A workaround (in Python) seems to be to call ctx.select_font_face("sans-serif"). This script will tickle this bug; the commented-out line will un-tickle it. import cairo s = cairo.ImageSurface(cairo.FORMAT_RGB24, 300, 300) ctx = cairo.Context(s) # This line makes the problem go away #ctx.select_font_face('sans-serif') while True: txt = "hi!" x, y = (140, 140) ctx.save() try: ctx.text_path(txt) ctx.fill() finally: ctx.restore() I get this bug with 1.8.10 but not in 1.9.6 built using gtk-osx jhbuild modulesets. I'm also hitting this bug on the 1.8 branch. Switching to git master fixes it completely. Latest comments say that this was fixed with 1.10. Can anyone still reproduce the problem? -- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/cairo/cairo/issues/301. |
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.