Gettext function f_ calls Obj.magic on a format string

Bug #1684507 reported by Stéphane Glondu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
marionnet
New
Undecided
Unassigned
ocamlbricks
New
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.

Revision history for this message
Stéphane Glondu (glondu) wrote :

Attached is a patch that fixes the issue.

Revision history for this message
Jean-Vincent Loddo (loddo) wrote : Re: [Marionnet-dev] [Bug 1684507] Re: Gettext function f_ calls Obj.magic on a format string

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  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.