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

Segmentation Fault on new Cairo Error Status #36

Open
bvaugon opened this issue Sep 19, 2023 · 1 comment
Open

Segmentation Fault on new Cairo Error Status #36

bvaugon opened this issue Sep 19, 2023 · 1 comment

Comments

@bvaugon
Copy link

bvaugon commented Sep 19, 2023

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.

@Chris00
Copy link
Owner

Chris00 commented Sep 20, 2023

Thanks for reporting this issue. Would you have time to submit a PR?

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