Gettext function f_ calls Obj.magic on a format string

Bug #1684507 reported by Stéphane Glondu on 2017-04-20
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
marionnet
Undecided
Unassigned
ocamlbricks
Undecided
Unassigned

Bug Description

Hello,

In Debian, Marionnet is currently broken. A bug has been submitted:

  https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=860405

This is due to the f_ function of Gettext_builder calling Obj.magic on a format string:

  http://bazaar.launchpad.net/~marionnet-drivers/ocamlbricks/trunk/view/head:/GETTEXT/gettext_builder.ml#L61

Since ocaml 4.02.0, format strings are no longer strings internally, but a more complex datatype based on GADTs. Therefore, f_ now triggers a segmentation fault.

To convert a string to a format string, one has to use Scanf.format_from_string.

Stéphane Glondu (glondu) wrote :

Attached is a patch that fixes the issue.

The bug fix is now in the repository (ocamlbricks).
Merci Stéphane,
Jean-Vincent

Le 20/04/2017 à 11:13, Stéphane Glondu a écrit :
> Since ocaml 4.02.0, format strings are no longer strings internally,
> but a more complex datatype based on GADTs. Therefore, f_ now triggers
> a segmentation fault.
>
> To convert a string to a format string, one has to use
> Scanf.format_from_string.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers