[cairo-bugs] [Bug 49719] Assert failures in cairo-surface.c on Ubuntu 11.10/12.04

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Thu May 10 11:55:34 PDT 2012


--- Comment #12 from Uli Schlachter <psychon at znc.in> 2012-05-10 11:55:34 PDT ---
Let me quote the (shortened) source:

cairo_surface_set_device_offset (cairo_surface_t *surface, double x_offset,
double y_offset)
    cairo_status_t status;

    if (unlikely (surface->status))


    surface->device_transform.x0 = x_offset;
    surface->device_transform.y0 = y_offset;

    surface->device_transform_inverse = surface->device_transform;
    status = cairo_matrix_invert (&surface->device_transform_inverse);
    /* should always be invertible unless given pathological input */
    assert (status == CAIRO_STATUS_SUCCESS);


You can see different things:
- This function doesn't do anything on error surface (=> cairo correctly
ignores operations on error surfaces)
- The only assert() in there has a comment which says "it's virtually
impossible for this to fail"

I agree with this assert(). The device_transform should always be a translation
matrix and those are always invertible. So unless I missed something, this
leaves "random memory corruption" as the most likely case for this assert() to
trigger (and debugging random memory corruption is hard and most likely not a
bug in cairo).

Also, this is why I asked for someone to ask gdb which values the
device_transform contains after a crash.

Configure bugmail: https://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