[cairo-bugs] [Bug 18977] New: Bus error or Segfault inside cairo_show_text
bugzilla-daemon at freedesktop.org
bugzilla-daemon at freedesktop.org
Tue Dec 9 03:00:29 PST 2008
http://bugs.freedesktop.org/show_bug.cgi?id=18977
Summary: Bus error or Segfault inside cairo_show_text
Product: cairo
Version: 1.8.4
Platform: All
OS/Version: Mac OS X (All)
Status: NEW
Severity: normal
Priority: medium
Component: quartz font backend
AssignedTo: vladimir at pobox.com
ReportedBy: askok at dnainternet.net
QAContact: cairo-bugs at cairographics.org
CC: askok at dnainternet.net
The sample code below crashes on OS X and Cairo 1.8.4 (via fink packaging) and
with current GIT code (see below):
<<
#include <cairo.h>
#include <cairo-pdf.h>
int main ()
{
cairo_surface_t *surface = cairo_pdf_surface_create("out_c.pdf", 120, 120);
cairo_t *cr = cairo_create (surface);
cairo_arc(cr, 60, 60, 25, 0, 6.283);
cairo_set_source_rgb(cr, 0.5, 0.6, 0.8);
cairo_fill_preserve(cr);
cairo_set_line_width(cr, 5.0);
cairo_set_source_rgb(cr, 0.3, 0.4, 0.6);
cairo_stroke(cr);
cairo_move_to( cr, 60,60 );
cairo_show_text( cr, "abc" ); // <--- BUS ERROR if gets here
cairo_stroke(cr);
cairo_destroy (cr);
cairo_surface_destroy (surface);
}
<<
This one gives "Bus error", other circumstances can give "Segmentation fault".
Most likely it's the same issue, though (always within 'cairo_show_text()'.
$ gcc `pkg-config cairo --cflags --libs` -o testme_c testme.c
$ ./testme_c
Bus error
$ uname -a
Darwin PowerBook-G4.dlan.fmi.fi 9.5.0 Darwin Kernel Version 9.5.0: Wed Sep 3
11:31:44 PDT 2008; root:xnu-1228.7.58~1/RELEASE_PPC Power Macintosh
$ gcc -v
Using built-in specs.
Target: powerpc-apple-darwin9
Configured with: /var/tmp/gcc/gcc-5484~1/src/configure --disable-checking
-enable-werror --prefix=/usr --mandir=/share/man
--enable-languages=c,objc,c++,obj-c++
--program-transform-name=/^[cg][^.-]*$/s/$/-4.0/
--with-gxx-include-dir=/include/c++/4.0.0 --with-slibdir=/usr/lib
--build=i686-apple-darwin9 --program-prefix= --host=powerpc-apple-darwin9
--target=powerpc-apple-darwin9
Thread model: posix
gcc version 4.0.1 (Apple Inc. build 5484)
$ pkg-config --modversion cairo
1.8.4
$ fink --version
Package manager version: 0.28.6
The bug exists also in the current (2008-Dec-09) GIT code.
I spotted this in the compilation:
<<
gcc -DHAVE_CONFIG_H -I. -I.. -I. -I/sw/include/pixman-1
-I/sw/lib/freetype219/include/freetype2 -I/sw/lib/freetype219/include
-I/usr/X11/include -I/sw/include/libpng12 -I/usr/X11/include -I/usr/X11/include
-Wall -Wextra -Wsign-compare -Werror-implicit-function-declaration
-Wpointer-arith -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes
-Wmissing-declarations -Wnested-externs -Wpacked -Wswitch-enum
-Wstrict-aliasing=2 -Winit-self -Wdeclaration-after-statement
-Wold-style-definition -Wno-missing-field-initializers -Wno-unused-parameter
-Wno-long-long -Winline -fno-strict-aliasing -fno-common
-Wp,-D_FORTIFY_SOURCE=2 -g -O2 -MT cairo-quartz-font.lo -MD -MP -MF
.deps/cairo-quartz-font.Tpo -c cairo-quartz-font.c -fno-common -DPIC -o
.libs/cairo-quartz-font.o
cairo-quartz-font.c: In function ‘_cairo_quartz_font_get_implementation’:
cairo-quartz-font.c:296: warning: assignment from incompatible pointer type
cairo-quartz-font.c:371: warning: assignment from incompatible pointer type
cairo-quartz-font.c: In function ‘_cairo_quartz_font_create_toy’:
cairo-quartz-font.c:386: warning: passing argument 2 of
‘_cairo_quartz_font_get_implementation’ from incompatible pointer type
cairo-quartz-font.c: In function ‘_cairo_quartz_init_glyph_metrics’:
cairo-quartz-font.c:455: warning: unused variable ‘textMatrix’
cairo-quartz-font.c: At top level:
cairo-quartz-font.c:778: warning: initialization from incompatible pointer type
<<
And also:
<<
gcc -DHAVE_CONFIG_H -I. -I../.. -I../../src -I../../src -I/sw/include/pixman-1
-I/sw/lib/freetype219/include/freetype2 -I/sw/lib/freetype219/include
-I/usr/X11/include -I/sw/include/libpng12 -I/usr/X11/include -I/usr/X11/include
-Wall -Wextra -Wsign-compare -Werror-implicit-function-declaration
-Wpointer-arith -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes
-Wmissing-declarations -Wnested-externs -Wpacked -Wswitch-enum
-Wstrict-aliasing=2 -Winit-self -Wdeclaration-after-statement
-Wold-style-definition -Wno-missing-field-initializers -Wno-unused-parameter
-Wno-long-long -Winline -fno-strict-aliasing -fno-common
-Wp,-D_FORTIFY_SOURCE=2 -g -O2 -MT
libcairo_script_interpreter_la-cairo-script-operators.lo -MD -MP -MF
.deps/libcairo_script_interpreter_la-cairo-script-operators.Tpo -c
cairo-script-operators.c -fno-common -DPIC -o
.libs/libcairo_script_interpreter_la-cairo-script-operators.o
cairo-script-operators.c: In function ‘_image_load_from_dictionary’:
cairo-script-operators.c:2529: warning: ‘len’ may be used uninitialized in
this function
cairo-script-operators.c:2798: warning: ‘image’ may be used uninitialized
in this function
cairo-script-operators.c: In function ‘_font’:
cairo-script-operators.c:1848: warning: ‘font_face’ may be used
uninitialized in this function
cairo-script-operators.c: In function ‘_set_scaled_font’:
cairo-script-operators.c:4478: warning: ‘font’ may be used uninitialized in
this function
<<
Compilation options:
<<
The following surface backends:
Image: yes (always builtin)
Xlib: yes
Xlib Xrender: yes
Quartz: yes
Quartz-image: no (disabled, use --enable-quartz-image to enable)
XCB: no (disabled, use --enable-xcb to enable)
Win32: no (requires a Win32 platform)
OS2: no (disabled, use --enable-os2 to enable)
CairoScript: no (disabled, use --enable-script to enable)
PostScript: yes
PDF: yes
SVG: yes
glitz: no (disabled, use --enable-glitz to enable)
BeOS: no (disabled, use --enable-beos to enable)
DirectFB: no (disabled, use --enable-directfb to enable)
SDL: no (disabled, use --enable-sdl to enable)
The following font backends:
User: yes (always builtin)
FreeType: yes
Win32: no (requires a Win32 platform)
Quartz: yes
The following functions:
PNG functions: yes
And the following internal features:
gcov support: no
test surfaces: yes
ps testing: yes
pdf testing: no (requires poppler-glib >= 0.9.2)
svg testing: no (requires librsvg-2.0 >= 2.15.0)
<<
--
Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
More information about the cairo-bugs
mailing list