caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Boutillier, Pierre" <Pierre_Boutillier@hms.harvard.edu>
To: "caml-list@inria.fr" <caml-list@inria.fr>
Subject: [Caml-list] install_printer in ocamldebug segfault
Date: Fri, 13 May 2016 15:27:31 +0000	[thread overview]
Message-ID: <183A08AC-027C-4E84-92C5-68AC2B3A0458@hms.harvard.edu> (raw)

[-- Attachment #1: Type: text/plain, Size: 3004 bytes --]

Dear caml-list,
How can I inspect this so that I can report/workaround this situation?

If I do:
'''
 $ ocaml unix.cma str.cma _build/dev/db_printers.cma -I _build/dataStructures/ -I _build/dev/
        OCaml version 4.03.0

# #install_printer Mods.IntSet.print;;
#  open Mods.IntSet;;
#  add 3 (add 12 (add 14 (add 2 empty)));;
- : Mods.IntSet.t = {2, 3, 12, 14}
'''
I'm happy but if I do
'''
ocamldebug -I _build/dataStructures/ -I _build/dev/ _build/main/KaSim.byte
        OCaml Debugger version 4.03.0

(ocd) load_printer "unix.cma"
File /home/pirbo/.opam/4.03.0+fp+flambda/lib/ocaml/unix.cma loaded
(ocd) load_printer "str.cma"
File /home/pirbo/.opam/4.03.0+fp+flambda/lib/ocaml/str.cma loaded
(ocd) load_printer "db_printers.cma"
File _build/dev/db_printers.cma loaded
(ocd) install_printer Mods.IntSet.print
segfault
'''

Sadly this:
'''
module type Base = sig
    type t
    val print : Format.formatter -> t -> unit
  end

module Make(B:Base) : sig
    type d
    type t

    val print : Format.formatter -> t -> unit
  end with type d=B.t = struct

      type d = B.t
      type t = Nil | Cons of t * d * t

      let rec print f = function
    | Nil -> ()
    | Cons (l,d,r) ->
       Format.fprintf f "%a,%a,%a" print l B.print d print r
    end

module IntTree = Make (struct type t = int let print = Format.pp_print_int end)
'''
is not enough to reproduce the bug so I'm lost.

Do you have any clue?

All the best,
Pierre B.

PS: There is a non minimal way to reproduce the bug anyway: '''git clone https://github.com/Kappa-Dev/KaSim.git && cd KaSim && make debug''’ but it is not OK for a bug tracker...

PPS: Here is the MacOS debug log just in case:
Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_INVALID_ADDRESS at 0xfffffffffffffff9

VM Regions Near 0xfffffffffffffff9:
--> shared memory          00007ffffff40000-00007ffffff41000 [    4K] r-x/r-x SM=SHM


Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   ocamlrun                       0x000000010b9c37e7 caml_array_unsafe_get + 7
1   ocamlrun                       0x000000010b9b707a caml_interprete + 8106
2   ocamlrun                       0x000000010b9b9345 caml_main + 1653
3   ocamlrun                       0x000000010b9d2b1c main + 12
4   libdyld.dylib                 0x00007fff94e8c5ad start + 1

Thread 0 crashed with X86 Thread State (64-bit):
  rax: 0x0000000000000000  rbx: 0x000000010bf7dc10  rcx: 0x0000000000000010  rdx: 0x00007f9afc802a00
  rdi: 0x0000000000000001  rsi: 0x0000000000000049  rbp: 0x00007fff5424b5d0  rsp: 0x00007fff5424b5c0
   r8: 0x000000010bf83750   r9: 0x0000000000000001  r10: 0x0000000000000001  r11: 0x0000000000000004
  r12: 0x000000010c29ae54  r13: 0x000000010b9e2c88  r14: 0x00007f9afc016270  r15: 0x0000000000000000
  rip: 0x000000010b9c37e7  rfl: 0x0000000000010246  cr2: 0xfffffffffffffff9



[-- Attachment #2: Type: text/html, Size: 6027 bytes --]

             reply	other threads:[~2016-05-13 15:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-13 15:27 Boutillier, Pierre [this message]
2016-05-14 15:22 ` Boutillier, Pierre

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=183A08AC-027C-4E84-92C5-68AC2B3A0458@hms.harvard.edu \
    --to=pierre_boutillier@hms.harvard.edu \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).