[cairo] BUG: Cairo reports CAIRO_STATUS_SUCCESS even if writing to disk failed (SVG and PS backend)

Knut Petersen knupero at gmail.com
Fri Jul 23 06:55:34 UTC 2021


Hi erverybody!

I'm testing a cairo backend I wrote for the GNU Lilypond music engraver.

I generate several output formats in parallel and test for errors using this C++ code:

       for (auto &cr : Cairo_output.contexts) // loop over a set of crs
         {
           auto status = cairo_status (cr);
           if (status != CAIRO_STATUS_SUCCESS)
             error (_f ("Cairo status %s", cairo_status_to_string (status))); // display an error msg and abort
         }

If writing to an output file fails because there is no more free disk space and the cr is connected to a pdf surface this works fine:

    Fitting music on 1 or 2 pages...
    Drawing systems...
    Generating test.cairo.pdf ...
    fatal error: Cairo status reports 'error while writing to output stream'

Unfortunately this code fails for the cairo postscript backend and the cairo svg backend - cairo_status reports CAIRO_STATUS_SUCCESS even if writing to disk failed because there is no free disk space.

Tested versions: 1.16.0, git master

Knut

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cairographics.org/archives/cairo/attachments/20210723/227f8a1e/attachment.htm>


More information about the cairo mailing list