[cairo] [Bug?] Differences in error detection between a native linux-64 and a mingw (Windows) crossbuild.

Knut Petersen knupero at gmail.com
Fri Jul 30 13:12:10 UTC 2021


Hi everybody!

Because of a programming error in the new cairo backend for lilypond we occasionally generated insane hyperlink rect definitions. One example is:

    cairo_tag_begin (context, CAIRO_TAG_LINK, attr.c_str ());
    cairo_tag_end (context, CAIRO_TAG_LINK);

with attr  set to

    rect=[ inf -inf 0.000000 -0.000000 ] uri='textedit:///foo/bar.ly:136:10:10' <textedit:/home/knut/sources/lilybuilt/cairotests/teil3.ly:136:10:10>

Obviously using infinity and 0.0000 here is nonsense. But it is interesting to note differences in cairo error detection between builds for different platforms:

A build for linux x86-64  accepted attribute strings with "inf" and "-inf" without problems and without ever generating a context or surface error.

A mingw crossbuild tested on a Windows 10 system also never produced a context or surface error immediately after cairo_tag_begin() or cairo_tag_end(). But after cairo_surface_finish() a context error 'invalid tag name, attributes, or
nesting' was detected.

I really don't know if cairo should silently ignore such a request to generate a link or if it should produce an error status != success. But at least I would have expected that such a condition is handled identically on different platforms.

I used cairo git 6872490e77fb2d0cc7d7bb for both builds.

Knut


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cairographics.org/archives/cairo/attachments/20210730/0573db1d/attachment.htm>


More information about the cairo mailing list