Chris00 / ocaml-cairo

Binding to Cairo, a 2D Vector Graphics Library.
GNU Lesser General Public License v3.0
54 stars 8 forks source link

Segmentation Fault on new Cairo Error Status #36

Open bvaugon opened 1 year ago

bvaugon commented 1 year ago

Hello,

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

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 commented 1 year ago

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