Summary: | Cairo causes GTK2 apps to crash on Solaris 9 | ||
---|---|---|---|
Product: | cairo | Reporter: | Leo Zhadanovsky <leozh> |
Component: | xlib backend | Assignee: | Carl Worth <cworth> |
Status: | RESOLVED FIXED | QA Contact: | cairo-bugs mailing list <cairo-bugs> |
Severity: | blocker | ||
Priority: | highest | CC: | dberkholz, fred, he, stric |
Version: | 1.2.4 | ||
Hardware: | SPARC | ||
OS: | Solaris | ||
Whiteboard: | |||
i915 platform: | i915 features: |
Description
Leo Zhadanovsky
2006-08-21 21:15:36 UTC
Confirming : I've got a similar bug report ( http://qa.mandriva.com/show_bug.cgi?id=24298 ) with people doing ssh between an linux i586 and linux ppc : copy of bug report still crashing, here the backtrace with cairo-debug: Program received signal SIGSEGV, Segmentation fault. [Switching to Thread -1223092528 (LWP 7978)] 0xb786827a in _cairo_xlib_surface_show_glyphs (abstract_dst=0x8914b90, op=CAIRO_OPERATOR_OVER, src_pattern=0xbff39e08, glyphs=0x8915c08, num_glyphs=8, scaled_font=0x876adf8) at cairo-xlib-surface.c:2455 2455 n[3] = d[0]; (gdb) bt #0 0xb786827a in _cairo_xlib_surface_show_glyphs (abstract_dst=0x8914b90, op=CAIRO_OPERATOR_OVER, src_pattern=0xbff39e08, glyphs=0x8915c08, num_glyphs=8, scaled_font=0x876adf8) at cairo-xlib-surface.c:2455 #1 0xb784c5ba in _cairo_surface_show_glyphs (surface=0x8914b90, op=CAIRO_OPERATOR_OVER, source=0xbff39f1c, glyphs=0x8915c08, num_glyphs=8, scaled_font=0x876adf8) at cairo-surface.c:1820 #2 0xb784039d in _cairo_gstate_show_glyphs (gstate=0x8915a90, glyphs=0xbff39fe8, num_glyphs=8) at cairo-gstate.c:1449 #3 0xb783a873 in cairo_show_glyphs (cr=0x8914ca8, glyphs=0xbff39fe8, num_glyphs=8) at cairo.c:2539 #4 0xb78e3590 in pango_cairo_show_glyph_string () from /usr/lib/libpangocairo-1.0.so.0 It seems to be specifically related to arch, as the distant compter is an i586 and the client a ppc: 2411 /* flip formats around */ 2412 switch (scaled_glyph->surface->format) { ... 2440 case CAIRO_FORMAT_ARGB32: 2441 if (_native_byte_order_lsb() != (ImageByteOrder (dpy) == LSBFirst)) { 2442 unsigned int c = glyph_surface->stride * glyph_surface->height; 2443 unsigned char *d; 2444 unsigned char *new, *n; 2445 2446 new = malloc (c); 2447 if (new == NULL) { 2448 status = CAIRO_STATUS_NO_MEMORY; 2449 goto BAIL; 2450 } 2451 n = new; 2452 d = data; 2453 while ((c -= 4) >= 0) 2454 { 2455 n[3] = d[0]; 2456 n[2] = d[1]; 2457 n[1] = d[2]; 2458 n[0] = d[3]; 2459 d += 4; 2460 n += 4; 2461 } 2462 data = new; 2463 } 2464 break; 2465 case CAIRO_FORMAT_RGB24: 2466 default: 2467 ASSERT_NOT_REACHED; 2468 break; 2469 } btw, I don't understand the content of the var "c" which is supposed to be an interger: (gdb) p c $1 = {mmx_4x00ff = 71777214294589695, mmx_4x0080 = 36029346783166592, mmx_565_rgb = 2130307907615, mmx_565_unpack_multiplier = 567003842624, mmx_565_r = 1065151889408, mmx_565_g = 16515072, mmx_565_b = 248, mmx_mask_0 = 18446744073709486080, mmx_mask_1 = 18446744069414649855, mmx_mask_2 = 18446462603027808255, mmx_mask_3 = 281474976710655, mmx_full_alpha = 71776119061217280, mmx_ffff0000ffff0000 = 18446462603027742720, mmx_0000ffff00000000 = 281470681743360, mmx_000000000000ffff = 65535} 2442 unsigned int c = glyph_surface->stride * glyph_surface->height; 2443 unsigned char *d; 2444 unsigned char *new, *n; 2445 2446 new = malloc (c); 2447 if (new == NULL) { 2448 status = CAIRO_STATUS_NO_MEMORY; 2449 goto BAIL; 2450 } 2451 n = new; 2452 d = data; 2453 while ((c -= 4) >= 0) 2454 { 2455 n[3] = d[0]; 2456 n[2] = d[1]; 2457 n[1] = d[2]; 2458 n[0] = d[3]; 2459 d += 4; 2460 n += 4; 2461 } 2462 data = new; Since c is unsigned, ((c -= 4) >= 0) is ALWAYS true. Compiling with -Wextra says so too: cairo-xlib-surface.c:880: warning: comparison of unsigned expression >= 0 is always true cairo-xlib-surface.c:2453: warning: comparison of unsigned expression >= 0 is always true I've now pushed Behdad's fix for this bug out: http://gitweb.freedesktop.org/?p=cairo;a=commit;h=1b7ced6614d809262cca08e7c5141b7ce740bfca Though it might still be nice for someone to rewrite this code to use a more conventional/safer loop style. -Carl Ok, I rewrote the loop: http://gitweb.freedesktop.org/?p=cairo;a=commit;h=b6e5f2b0fef00352930dfcc47a13f330a13b1d68 Please test. (In reply to comment #3) > I've now pushed Behdad's fix for this bug out: > > http://gitweb.freedesktop.org/?p=cairo;a=commit;h=1b7ced6614d809262cca08e7c5141b7ce740bfca > > Though it might still be nice for someone to rewrite this code to use a more > conventional/safer loop style. > > -Carl > Ok, this worked, thanks! *** Bug 8398 has been marked as a duplicate of this bug. *** |
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.