Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cairo assertion failure in testing::run_cleanup #3304

Open
lightmare opened this issue Feb 18, 2016 · 1 comment
Open

cairo assertion failure in testing::run_cleanup #3304

lightmare opened this issue Feb 18, 2016 · 1 comment

Comments

@lightmare
Copy link
Contributor

test/cleanup.hpp:39 calls cairo_debug_reset_static_data

WARNING: It is only safe to call this function when there are no active cairo objects remaining, (ie. the appropriate destroy functions have been called as necessary). If there are active cairo objects, this call is likely to cause a crash, (eg. an assertion failure due to a hash table being destroyed when non-empty).

This assert in cairo-ft-font.c fires in cleanup after using TextSymbolizer:

/**
 * _cairo_ft_unscaled_font_fini:
 * 
 * Free all data associated with a cairo_ft_unscaled_font_t.
 *
 * CAUTION: The unscaled->face field must be NULL before calling this
 * function. This is because the cairo_ft_unscaled_font_map keeps a
 * count of these faces (font_map->num_open_faces) so it maintains the
 * unscaled->face field while it has its lock held. See
 * _font_map_release_face_lock_held().
 **/
static void
_cairo_ft_unscaled_font_fini (cairo_ft_unscaled_font_t *unscaled)
{
    assert (unscaled->face == NULL);

    if (unscaled->filename) {
    free (unscaled->filename);
    unscaled->filename = NULL;
    }
}
Breakpoint 1, _cairo_ft_unscaled_font_fini (unscaled=0x7dfbf0) at /build/buildd/cairo-1.13.0~20140204/src/cairo-ft-font.c:450
450 /build/buildd/cairo-1.13.0~20140204/src/cairo-ft-font.c: No such file or directory.
(gdb) bt
#0  _cairo_ft_unscaled_font_fini (unscaled=0x7dfbf0) at /build/buildd/cairo-1.13.0~20140204/src/cairo-ft-font.c:450
#1  0x00007ffff5ce5958 in _cairo_ft_unscaled_font_map_pluck_entry (entry=0x7dfbf0, closure=0x7dda70) at /build/buildd/cairo-1.13.0~20140204/src/cairo-ft-font.c:309
#2  0x00007ffff5c60d84 in _cairo_hash_table_foreach (hash_table=0x7e03a0, hash_callback=hash_callback@entry=0x7ffff5ce5910 <_cairo_ft_unscaled_font_map_pluck_entry>, 
    closure=closure@entry=0x7dda70) at /build/buildd/cairo-1.13.0~20140204/src/cairo-hash.c:567
#3  0x00007ffff5ce6682 in _cairo_ft_unscaled_font_map_destroy () at /build/buildd/cairo-1.13.0~20140204/src/cairo-ft-font.c:324
#4  _cairo_ft_font_reset_static_data () at /build/buildd/cairo-1.13.0~20140204/src/cairo-ft-font.c:3576
#5  0x00007ffff5c58c83 in cairo_debug_reset_static_data () at /build/buildd/cairo-1.13.0~20140204/src/cairo-debug.c:72
#6  0x0000000000435b19 in testing::run_cleanup () at test/cleanup.hpp:39
#7  0x00000000004343bd in main (argc=3, argv=0x7fffffffd878) at test/visual/run.cpp:197

(Linux Mint 17 (ubuntu trusty))

@springmeyer
Copy link
Member

I added cairo_debug_reset_static_data just for cleaner valgrind runs. We can remove it and just add a valgrind suppression if needed. But it is still odd that this causes a crash...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants