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
crashing ocamlopt (Alpha) #2396
Comments
Comment author: administrator Hi,
I'm trying to reproduce your bug, but I'm afraid we'll need the file -- Damien |
Comment author: administrator Hello,
I am awefully sorry! Trying to reduce the size of the file as much as There is a funny aspect about the problem: Compiling "strat.ml" and "pres_impl.ml" as follows: ocamlopt -c strat.ml pres_impl.ml works without problems! But: ocamlopt -c strat.ml This messes up the terminal, but using "copy&paste" with the mouse shows spilled-i/116 spilled-x/117 spilled-env/118 spilled-res/119
In the terminal window, only the first line (spilled...) is readable, I received many other strange messages while reducing the file more and Best regards, File: strat.mlmodule type T = sig val default : t val grow : t -> (int -> unit) -> int -> unit
|
Comment author: administrator Having read your notes in the bugtracking list: Yes, sorry: I also forgot to mention that I normally move "ocamlopt.opt" to Regards, -- |
Comment author: administrator Thanks for the missing file. Damien and I were able to find the bug. Thanks for the well-delineated bug report,
|
Comment author: administrator Crashes "ocamlopt.opt" but not "ocamlopt" on my machine. -- Damien |
Original bug ID: 58
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)
Bug description
Hello,
when I tried out my additions to the standard library with your latest
CVS-version (OCaml 2.99+10, date 15.03.2000), I found a bug which is
obviously in the native code generator.
Platform: Digital Unix 4.0e / Alpha
I have attached a simplified version of an offending module at the end of
this report. Other programs may also cause this, as I noticed.
The output of the compiler varies when one changes offending files:
sometimes it core dumps, sometimes it raises an exception, etc. With this
specific file, the following output occurs on my machine:
spilled-i/116 spilled-x/117 spilled-env/118 spilled-res/119
@`ï``b`````/119
I know that the CVS-version is alpha-software, but I wanted to test
compilation of the system with my new stdlib-functions (which work well, as
I have verified).
Best regards and good bug hunting,
Markus Mottl
--
Markus Mottl, mottl@miss.wu-wien.ac.at, http://miss.wu-wien.ac.at/~mottl
file: pres_impl.ml
compile with: ocamlopt.opt -c pres_impl.ml
module type Implementation = sig
type 'a t
val name : string
val length : 'a t -> int
val make : int -> 'a -> 'a t
val unsafe_get : 'a t -> int -> 'a
val unsafe_set : 'a t -> int -> 'a -> unit
end
module Make (S : Strat.T) (Impl : Implementation) = struct
module Strategy = S
type strategy = Strategy.t
type 'a t = {mutable ar : 'a Impl.t;
mutable vlix : int;
mutable strategy : strategy}
let name = Impl.name
let invalid_arg str = invalid_arg (name ^ "." ^ str)
let length ra = succ ra.vlix
let real_length ra = Impl.length ra.ar
let real_lix ra = pred (real_length ra)
let unsafe_get ra = Impl.unsafe_get ra.ar
let unsafe_set ra = Impl.unsafe_set ra.ar
let dummy_loc = 0
let no_obj () = Obj.magic dummy_loc
let creator n = let nothing = no_obj () in Impl.make n nothing
let screate_fresh strategy n =
let res = {ar = no_obj (); vlix = pred n; strategy = strategy} in
Strategy.grow strategy (fun rlen -> res.ar <- creator rlen) n; res
let create_fresh n = screate_fresh Strategy.default n
let create_from ra =
{ar = creator (length ra); vlix = ra.vlix; strategy = ra.strategy}
let sempty strategy =
let res = {ar = no_obj (); vlix = -1; strategy = strategy} in
Strategy.grow strategy (fun rlen -> res.ar <- creator rlen) 0; res
let screate strategy n x =
let res = screate_fresh strategy n in
for i = 0 to pred n do unsafe_set res i x done; res
let sinit strategy n f =
let res = screate_fresh strategy n in
for i = 0 to pred n do unsafe_set res i (f i) done; res
let resizer some_lix ra len =
let ar = creator len in
for i = 0 to some_lix do Impl.unsafe_set ar i (unsafe_get ra i) done;
ra.ar <- ar
let enforce_strategy ra =
let real_len = real_length ra and len = length ra in
Strategy.shrink ra.strategy (resizer ra.vlix ra) real_len len
end
The text was updated successfully, but these errors were encountered: