Skip to content

Instantly share code, notes, and snippets.

@c-spencer
Created August 9, 2012 08:21
Show Gist options
  • Save c-spencer/3302300 to your computer and use it in GitHub Desktop.
Save c-spencer/3302300 to your computer and use it in GitHub Desktop.
gcc `pkg-config pangocairo --cflags --libs` pangocairotest.c -o pangocairotest
...
(gdb) run
Starting program: /Users/chris/Dev/node-canvas/pangocairotest
...
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000010
0x00000001002a0bd8 in cairo_get_target (cr=0x1000f22d0) at cairo.c:3678
3678 return cr->backend->get_original_target (cr);
(gdb) bt full
#0 0x00000001002a0bd8 in cairo_get_target (cr=0x1000f22d0) at cairo.c:3678
No locals.
#1 0x00000001000040a2 in pango_cairo_create_context ()
No symbol table info available.
#2 0x0000000100000ee9 in main () at pangocairotest.c:8
surface = (cairo_surface_t *) 0x100815300
cr = (cairo_t *) 0x1000f22d0
c = (PangoContext *) 0x0
(gdb)
otool -L pangocairotest
pangocairotest:
/usr/local/lib/libpangocairo-1.0.0.dylib (compatibility version 3001.0.0, current version 3001.1.0)
/usr/local/lib/libpango-1.0.0.dylib (compatibility version 3001.0.0, current version 3001.1.0)
/usr/X11/lib/libcairo.2.dylib (compatibility version 11003.0.0, current version 11003.2.0)
/usr/local/lib/libgobject-2.0.0.dylib (compatibility version 3201.0.0, current version 3201.4.0)
/usr/local/lib/libglib-2.0.0.dylib (compatibility version 3201.0.0, current version 3201.4.0)
/usr/local/Cellar/gettext/0.18.1.1/lib/libintl.8.dylib (compatibility version 10.0.0, current version 10.1.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.1.0)
#include <pango/pangocairo.h>
int main() {
cairo_surface_t *surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, 10, 10);
cairo_t *context = cairo_create(surface);
PangoContext *c = pango_cairo_create_context(context);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment