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 crashes when asked to print a value #7015

Closed
vicuna opened this issue Oct 13, 2015 · 3 comments
Closed

ocamldebug crashes when asked to print a value #7015

vicuna opened this issue Oct 13, 2015 · 3 comments

Comments

@vicuna
Copy link

vicuna commented Oct 13, 2015

Original bug ID: 7015
Reporter: dariusf
Status: closed (set by @xavierleroy on 2015-11-15T16:57:24Z)
Resolution: not a bug
Priority: normal
Severity: crash
Platform: Mac OS X
OS: Mac OS X
OS Version: 10.10.5
Version: 4.02.3
Category: tools (ocaml{lex,yacc,dep,debug,...})
Monitored by: @gasche

Bug description

I get

Fatal error: exception End_of_file
fish: Job 1, '~/ocaml/ocaml/debugger/ocamldebug a.out ' terminated by signal SIGSEGV (Address boundary error)

when asking ocamldebug to print a value.

I'm building from source, so the version of the debugger this happens in is 4.03.0+dev10-2015-07-29.

Steps to reproduce

A very simple program will do it, and it happens consistently.

let a = 1 in
print_endline "hello"

Start ocamldebug, then

goto 12 (this puts the breakpoint before print_endline)
print a

@vicuna
Copy link
Author

vicuna commented Oct 13, 2015

Comment author: @damiendoligez

Works for me.

We'll need more details:
Which version of Xcode, what was the output of configure, what's in your environment, are you sure the debugged program is launched with the right runtime?

@vicuna
Copy link
Author

vicuna commented Oct 21, 2015

Comment author: dariusf

Found the problem: I was compiling the debugged program with an older version of the compiler. Thanks for the suggestions, and sorry for the false alarm!

So in general, does the debugger for version X only work on programs compiled by the compiler in version X?

@vicuna
Copy link
Author

vicuna commented Nov 15, 2015

Comment author: @xavierleroy

That explains it, then. In order to print values, the debugger looks for typing information in .cmi files, whose format is very dependent on the version of OCaml used. There is a magic number to prevent such version mismatches, but the truth is that it is not updated as often as needed to prevent all of them... Sorry for the inconvenience.

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