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

ocamldebug segfault on install_printer using module aliasing #7258

Closed
vicuna opened this issue May 14, 2016 · 2 comments
Closed

ocamldebug segfault on install_printer using module aliasing #7258

vicuna opened this issue May 14, 2016 · 2 comments
Milestone

Comments

@vicuna
Copy link

vicuna commented May 14, 2016

Original bug ID: 7258
Reporter: pboutill
Status: resolved (set by @xavierleroy on 2017-02-18T17:16:50Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 4.03.0
Target version: 4.05.0 +dev/beta1/beta2/beta3/rc1
Fixed in version: 4.05.0 +dev/beta1/beta2/beta3/rc1
Category: tools (ocaml{lex,yacc,dep,debug,...})
Monitored by: @gasche

Bug description

Consider the file install_printer.ml:

module type B =
  sig
    type t
    val print : Format.formatter -> t -> unit
  end

module Foo :
sig
  module Bar : B
end =
  struct
    module Bar : B =
      struct
        type t = int
        let print = Format.pp_print_int
      end
  end

module FooBar = Foo.Bar
$ ocamlc -c install_printer.ml
$ ocamlc -debug -o a.out install_printer.ml
$ ocamldebug a.out
(ocd) load_printer "install_printer.cmo"
File ./install_printer.cmo loaded

Now if you install_printer Install_printer.Foo.Bar.print everything is fine BUT
if you install_printer Install_printer.FooBar.print it segfault under MacOS and Debian with 4.02 and 4.03

@vicuna
Copy link
Author

vicuna commented Feb 18, 2017

Comment author: @xavierleroy

Tentative fix in commits [trunk b350002] and [4.05 b43beee], will be in release 4.05.

@vicuna vicuna closed this as completed Feb 18, 2017
@vicuna
Copy link
Author

vicuna commented May 5, 2017

Comment author: nbb

i saw i think the same bug with Lacaml printers:

directory ~/.opam/4.04.0+flambda/lib/lacaml

load_printer bigarray.cma
load_printer lacaml.cma

install_printer Lacaml.Io.pp_fmat segfaults while
install_printer Lacaml__io.pp_fmat works fine.

@vicuna vicuna added the tools label Mar 14, 2019
@vicuna vicuna added this to the 4.05.0 milestone Mar 14, 2019
@vicuna vicuna added the bug label Mar 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant