caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Bug in Hashtbl ?
@ 2002-03-21 15:35 Vesa Karvonen
  2002-03-21 15:46 ` Alain Frisch
  0 siblings, 1 reply; 4+ messages in thread
From: Vesa Karvonen @ 2002-03-21 15:35 UTC (permalink / raw)
  To: caml-list

Hi,

The following program raises an Out_of_memory exception. Is this:
- correct behavior,
- bug in Ocaml 3.04, or
- bug somewhere else?

<--- weird_out_of_memory.ml --->
type vertex =
  | D of vertex list

let _ =
  let rec n0 = D [n1]
  and n1 = D [n0] in
  let vertices = [n0;n1] in
  let res = Hashtbl.create 0 in
    List.iter
      (fun v -> 
  assert (not (Hashtbl.mem res v)) ;
  Hashtbl.add res v (ref 0))
      vertices ;
    ()
<--- weird_out_of_memory.ml --->

Under Cygwin (1.3.10):

  $ ocamlc.opt -o a.exe -g weird_out_of_memory.ml
  $ a.exe
  Fatal error: exception Out_of_memory
  Raised from a C function
  Called from module Weird_out_of_memory, character 220
  Called from module List, character 1856
  Called from module Weird_out_of_memory, character 270

Regards,
  Vesa Karvonen


-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 4+ messages in thread
* [Caml-list] Bug in Hashtbl ?
@ 2002-03-21 15:27 Vesa Karvonen
  0 siblings, 0 replies; 4+ messages in thread
From: Vesa Karvonen @ 2002-03-21 15:27 UTC (permalink / raw)
  To: caml-list

Hi,

The following program raises an Out_of_memory exception. Is this:
- correct behavior,
- bug in Ocaml 3.04,
- bug somewhere else?

<--- weird_out_of_memory.ml --->
type vertex =
  | D of vertex list

let _ =
  let rec n0 = D [n1]
  and n1 = D [n0] in
  let vertices = [n0;n1] in
  let res = Hashtbl.create 0 in
    List.iter
      (fun v -> 
  assert (not (Hashtbl.mem res v)) ;
  Hashtbl.add res v (ref 0))
      vertices ;
    ()
<--- weird_out_of_memory.ml --->

Under Cygwin (1.3.10):

  $ ocamlc.opt -o a.exe -g weird_out_of_memory.ml
  $ a.exe
  Fatal error: exception Out_of_memory
  Raised from a C function
  Called from module Weird_out_of_memory, character 220
  Called from module List, character 1856
  Called from module Weird_out_of_memory, character 270

Regards,
  Vesa Karvonen
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-03-21 16:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-03-21 15:35 [Caml-list] Bug in Hashtbl ? Vesa Karvonen
2002-03-21 15:46 ` Alain Frisch
2002-03-21 16:07   ` Vesa Karvonen
  -- strict thread matches above, loose matches on Subject: below --
2002-03-21 15:27 Vesa Karvonen

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).