ocaml-community / utop

Universal toplevel for OCaml
Other
846 stars 113 forks source link

utop crashes on OSX #16

Closed stass closed 10 years ago

stass commented 11 years ago

% utop Fatal error: exception UChar.Out_of_range Exit 2

% utop -version The universal toplevel for OCaml, version 1.5, compiled for OCaml version 4.01.0+dev16-2013-06-03

It crashes with 4.00.1 as well. Let me know if I can do some extra debugging.

Thanks.

ghost commented 11 years ago

I wouldn't say utop crashes on OSX since I do use it on OSX ;)

A backtrace would be of great help, could you try running it with OCAMLPARAM=b?

Also what's the contents of your LANG environment variable? Try running it with LANG=C.

stass commented 11 years ago

You are right, LANG was the issue. My LANG was set to en_US which for some reason causes utop to crash. I wonder if en_US means en_US.UTF-8.

ghost commented 11 years ago

The character encoding for en_US is ISO-8859-1. I can reproduce the error by setting LANG to en_US. Though it seems to be a bug in Camomile which raises UChar.Out_of_range instead of CharEncoding.Out_of_range. I'll modify lambda-term to treat the former as the latter.

stass commented 11 years ago

I think OSX might do something special when LANG is set to en_US. The reason I said "utop crashes on OSX" in the bug report is that I was using it on FreeBSD without any problems for a while, however my LANG is set to ru_RU.KOI8-R on FreeBSD (with LC_MESSAGES being C). I just verified that it still works on FreeBSD if I set LANG to enUS and unset all LC (like I have on OS X).

ghost commented 11 years ago

It should be fixed by this commit:

https://github.com/diml/lambda-term/commit/2b8abec6986ec20420c14e302a00eec1a2d6140f