Skip to content

Segmentation Fault on new Cairo Error Status #36

@bvaugon

Description

@bvaugon

Hello,

The following (pretty new) cairo error status (see cairo_status_t from cairo.h) are not managed in the OCaml type Cairo.status:

  • CAIRO_STATUS_PNG_ERROR
  • CAIRO_STATUS_FREETYPE_ERROR
  • CAIRO_STATUS_WIN32_GDI_ERROR
  • CAIRO_STATUS_TAG_ERROR

When this kind of error occurs (from C code), the C function caml_cairo_raise_Error from cairo_ocaml_types.h raises the exception Cairo.Error with an argument that is invalid regarding to the OCaml type Cairo.status. Then, the OCaml exception pretty printer, calling Cairo.error_of_status, segfaults.

I suggest to add these cases in the OCaml type Cairo.status and in the OCaml exception pretty printer Cairo.error_of_status, and maybe to add a check in the C function caml_cairo_raise_Error to manage future possible extensions of the C type cairo_status_t.

Thanks,
Benoît.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions