caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Alessandro Baretta <alex@baretta.com>
To: Ocaml <caml-list@inria.fr>
Subject: [Caml-list] Compiler killer code?
Date: Sat, 08 Jun 2002 16:32:13 +0200	[thread overview]
Message-ID: <3D02156D.7070303@baretta.com> (raw)

Is the type inference algorithm guaranteed to termintate? I 
ask because I have accidentally attempted to evaluate a 
(meaningless) function which almost hanged my Athlon.

The killer code is the following:

type t = t -> t
let f (x:t) :t = f f


If I type this into the toplevel, it starts to allocate 
memory by the tens of megabytes, until I have to kill it to 
prevent a system crash. I let it reach approximately 128MB 
before killing it. (BTW, that was with ocaml 3.04+13 
2002-06-05.)

Is the language really supposed to accept such garbage as 
that which I wrote?

Alex

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


             reply	other threads:[~2002-06-08 14:26 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-08 14:32 Alessandro Baretta [this message]
2002-06-08 14:34 ` William Lee Irwin III
2002-06-08 18:30   ` William Lovas
2002-06-09 13:29   ` Alessandro Baretta
2002-06-09 13:41     ` Xavier Leroy
2002-06-09 18:08       ` Blair Zajac
2002-06-10 10:57         ` [Caml-list] " Michal Moskal
2002-06-12  8:37           ` Xavier Leroy
2002-06-10 15:25         ` [Caml-list] " Xavier Leroy
2002-06-10  2:42     ` Jacques Garrigue
2002-06-10  7:47       ` Alessandro Baretta

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=3D02156D.7070303@baretta.com \
    --to=alex@baretta.com \
    --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).