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

Comments

Projects
None yet
1 participant
@vicuna
Copy link
Collaborator

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

This comment has been minimized.

Copy link
Collaborator 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 Feb 18, 2017

@vicuna

This comment has been minimized.

Copy link
Collaborator 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
You can’t perform that action at this time.