[cairo] cairo 1.12.16 cairo_destroy: Assertion `((*&(&cr->ref_count)->ref_count) > 0)' failed.

Florian Lohoff f at zz.de
Thu Sep 19 07:12:33 PDT 2013


Hi,
i am using mapnik from ocitymap - I am getting a 

cairo_destroy: Assertion `((*&(&cr->ref_count)->ref_count) > 0)' failed.

with cairo 1.12.16 on debian - I recompiled the package with -O0 and
used the dbg package to get a backtrace. The corresponding python
code looks like this:

395         ##
396         ## Draw the map, scaled to fit the designated area
397         ##
398         ctx.save()
399 
400         # Prepare to draw the map at the right location
401         ctx.translate(map_coords_dots[0], map_coords_dots[1])
402 
403         # Draw the rescaled Map
404         ctx.save()
405         rendered_map = self._map_canvas.get_rendered_map()
406         LOG.debug('Mapnik scale: 1/%f' % rendered_map.scale_denominator())
407         LOG.debug('Actual scale: 1/%f' % self._map_canvas.get_actual_scale())
408         mapnik.render(rendered_map, ctx)
409         ctx.restore()
410 
411         # Draw a rectangle around the map
412         ctx.rectangle(0, 0, map_coords_dots[2], map_coords_dots[3])
413         ctx.stroke()
414 
415         # Place the vertical and horizontal square labels
416         self._draw_labels(ctx, self.grid,
417                           map_coords_dots[2],
418                           map_coords_dots[3],
419                           commons.convert_pt_to_dots(self._grid_legend_margin_pt,
420                                                    dpi))
421         ctx.restore()
422 


[ ... ]
Mapnik LOG> 2013-09-19 13:12:52: cairo_renderer_base: Start processing layer=grid.shp
Mapnik LOG> 2013-09-19 13:12:52: cairo_renderer_base: -- datasource=0x2dd6740
Mapnik LOG> 2013-09-19 13:12:52: cairo_renderer_base: -- query_extent=box2d(8.1996153009645987,51.7705478670171146,8.4008738572187376,51.9169927796253319)
Mapnik LOG> 2013-09-19 13:12:52: cairo_renderer:start style processing
Mapnik LOG> 2013-09-19 13:12:52: shape_featureset: Total shapes read=120
Mapnik LOG> 2013-09-19 13:12:52: cairo_renderer:end style processing
Mapnik LOG> 2013-09-19 13:12:52: cairo_renderer_base: End layer processing
Mapnik LOG> 2013-09-19 13:12:52: cairo_renderer_base: End map processing
DEBUG:ocitysmap:Cleaning up /tmp/ocitysmapTlo7U4...
Traceback (most recent call last):
  File "./render.py", line 243, in <module>
    sys.exit(main())
  File "./render.py", line 238, in main
    options.output_prefix)
  File "/home/maposmatic/ocitysmap/ocitysmap/__init__.py", line 462, in render
    file_prefix)
  File "/home/maposmatic/ocitysmap/ocitysmap/__init__.py", line 521, in _render_one
    renderer.render(surface, dpi, osm_date)
  File "/home/maposmatic/ocitysmap/ocitysmap/layoutlib/single_page_renderers.py", line 409, in render
    ctx.restore()
cairo.Error: NULL pointer
python: /home/maposmatic/cairo/cairo-1.12.16/src/cairo.c:301: cairo_destroy: Assertion `((*&(&cr->ref_count)->ref_count) > 0)' failed.
Aborted (core dumped)




GNU gdb (GDB) 7.4.1-debian
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/bin/python2.7...Reading symbols from /usr/lib/debug/usr/bin/python2.7...done.
done.

warning: core file may not match specified executable file.
[New LWP 23220]

warning: Can't read pathname for load map: Input/output error.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `python ./render.py -t Rheda --osmid=-78727 -L de_DE.UTF-8'.
Program terminated with signal 6, Aborted.
#0  0x00007fc95e295475 in raise () from /lib/x86_64-linux-gnu/libc.so.6
(gdb) bt
#0  0x00007fc95e295475 in raise () from /lib/x86_64-linux-gnu/libc.so.6
#1  0x00007fc95e2986f0 in abort () from /lib/x86_64-linux-gnu/libc.so.6
#2  0x00007fc95e28e621 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
#3  0x00007fc95d7c2bab in INT_cairo_destroy (cr=0x2679bf0) at /home/maposmatic/cairo/cairo-1.12.16/src/cairo.c:301
#4  0x00007fc95db2fd72 in ?? () from /usr/lib/pymodules/python2.7/cairo/_cairo.so
#5  0x0000000000472c12 in frame_dealloc.14820 (f=
    Frame 0x2c248a0, for file /home/maposmatic/ocitysmap/ocitysmap/layoutlib/single_page_renderers.py, line 409, in render (rendered_map=<Map at remote 0x259a208>)) at ../Objects/frameobject.c:460
#6  0x0000000000472f0d in tb_dealloc.45924 (tb=0x27398c0) at ../Python/traceback.c:28
#7  0x0000000000472f72 in tb_dealloc.45924 (tb=0x2739878) at ../Python/traceback.c:27
#8  0x0000000000472f72 in tb_dealloc.45924 (tb=0x2739950) at ../Python/traceback.c:27
#9  0x0000000000472f72 in tb_dealloc.45924 (tb=0x2739a28) at ../Python/traceback.c:27
#10 0x0000000000472f72 in tb_dealloc.45924 (tb=0x2739a70) at ../Python/traceback.c:27
#11 0x0000000000477df6 in insertdict_by_entry.18418 (mp=mp at entry=0x1e18f90, key=key at entry='last_traceback', hash=hash at entry=5897959712516987849, 
    ep=<optimized out>, value=value at entry=None) at ../Objects/dictobject.c:519
#12 0x0000000000464cc8 in insertdict (value=None, hash=5897959712516987849, key='last_traceback', mp=0x1e18f90) at ../Objects/dictobject.c:556
#13 dict_set_item_by_hash_or_entry (value=None, ep=0x0, hash=5897959712516987849, key='last_traceback', op=
    {'setrecursionlimit': <built-in function setrecursionlimit>, 'dont_write_bytecode': False, 'getrefcount': <built-in function getrefcount>, 'long_info': <sys.long_info at remote 0x7fc95f27a530>, 'path_importer_cache': {'/usr/lib/python2.7/dist-packages/shapely': None, '/usr/lib/python2.7/encodings': None, '/usr/lib/python2.7/plat-linux2': None, '/home/maposmatic/ocitysmap/ocitysmap/indexlib': None, '/usr/lib/python2.7/dist-packages/gobject': None, '/usr/lib/python2.7/dist-packages/shapely/algorithms': None, '/home/maposmatic/ocitysmap/ocitysmap/indexlib/../indexlib': None, '/usr/lib/python2.7/logging': None, './render.py': <imp.NullImporter at remote 0x7fc95f1de050>, '/home/maposmatic/ocitysmap/ocitysmap/indexlib/..': None, '/usr/lib/python2.7/dist-packages': None, '/usr/lib/pymodules/python2.7/cairo': None, '/usr/lib/python2.7/dist-packages/shapely/geometry': None, '/home/maposmatic/ocitysmap/ocitysmap/maplib': None, '/usr/lib/python2.7/lib-dynload': None, '/usr/lib/python2.7/lib-tk': None, '/usr/lib/python2....(truncated)) at ../Objects/dictobject.c:765
#14 PyDict_SetItem (op=op at entry=
    {'setrecursionlimit': <built-in function setrecursionlimit>, 'dont_write_bytecode': False, 'getrefcount': <built-in function getrefcount>, 'long_info': <sys.long_info at remote 0x7fc95f27a530>, 'path_importer_cache': {'/usr/lib/python2.7/dist-packages/shapely': None, '/usr/lib/python2.7/encodings': None, '/usr/lib/python2.7/plat-linux2': None, '/home/maposmatic/ocitysmap/ocitysmap/indexlib': None, '/usr/lib/python2.7/dist-packages/gobject': None, '/usr/lib/python2.7/dist-packages/shapely/algorithms': None, '/home/maposmatic/ocitysmap/ocitysmap/indexlib/../indexlib': None, '/usr/lib/python2.7/logging': None, './render.py': <imp.NullImporter at remote 0x7fc95f1de050>, '/home/maposmatic/ocitysmap/ocitysmap/indexlib/..': None, '/usr/lib/python2.7/dist-packages': None, '/usr/lib/pymodules/python2.7/cairo': None, '/usr/lib/python2.7/dist-packages/shapely/geometry': None, '/home/maposmatic/ocitysmap/ocitysmap/maplib': None, '/usr/lib/python2.7/lib-dynload': None, '/usr/lib/python2.7/lib-tk': None, '/usr/lib/python2....(truncated), key='last_traceback', value=None) at ../Objects/dictobject.c:818
#15 0x000000000054c6c3 in PyDict_SetItemString (item=<optimized out>, key=<optimized out>, v=
    {'setrecursionlimit': <built-in function setrecursionlimit>, 'dont_write_bytecode': False, 'getrefcount': <built-in function getrefcount>, 'long_info': <sys.long_info at remote 0x7fc95f27a530>, 'path_importer_cache': {'/usr/lib/python2.7/dist-packages/shapely': None, '/usr/lib/python2.7/encodings': None, '/usr/lib/python2.7/plat-linux2': None, '/home/maposmatic/ocitysmap/ocitysmap/indexlib': None, '/usr/lib/python2.7/dist-packages/gobject': None, '/usr/lib/python2.7/dist-packages/shapely/algorithms': None, '/home/maposmatic/ocitysmap/ocitysmap/indexlib/../indexlib': None, '/usr/lib/python2.7/logging': None, './render.py': <imp.NullImporter at remote 0x7fc95f1de050>, '/home/maposmatic/ocitysmap/ocitysmap/indexlib/..': None, '/usr/lib/python2.7/dist-packages': None, '/usr/lib/pymodules/python2.7/cairo': None, '/usr/lib/python2.7/dist-packages/shapely/geometry': None, '/home/maposmatic/ocitysmap/ocitysmap/maplib': None, '/usr/lib/python2.7/lib-dynload': None, '/usr/lib/python2.7/lib-tk': None, '/usr/lib/python2....(truncated)) at ../Objects/dictobject.c:2438
#16 PyImport_Cleanup () at ../Python/import.c:456
#17 0x0000000000437f85 in Py_Finalize () at ../Python/pythonrun.c:454
#18 0x0000000000447d6a in Py_Main (argc=<optimized out>, argv=0x7fffe1759898) at ../Modules/main.c:664
#19 0x00007fc95e281ead in __libc_start_main () from /lib/x86_64-linux-gnu/libc.so.6
---Type <return> to continue, or q <return> to quit---
#20 0x00000000004c7f39 in _start ()
(gdb) frame 3
#3  0x00007fc95d7c2bab in INT_cairo_destroy (cr=0x2679bf0) at /home/maposmatic/cairo/cairo-1.12.16/src/cairo.c:301
301	    assert (CAIRO_REFERENCE_COUNT_HAS_REFERENCE (&cr->ref_count));
(gdb) print *cr
$1 = {ref_count = {ref_count = 0}, status = CAIRO_STATUS_NULL_POINTER, user_data = {size = 0, num_elements = 0, element_size = 24, elements = 0x0}, backend = 
    0x7fc95db1bc40}
(gdb) quit


Flo
-- 
Florian Lohoff                                                 f at zz.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 828 bytes
Desc: Digital signature
URL: <http://lists.cairographics.org/archives/cairo/attachments/20130919/ad9ff78e/attachment.pgp>


More information about the cairo mailing list