English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
[Caml-list] OCaml-announcements
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2002-05-08 (14:58)
From: John Max Skaller <skaller@o...>
Subject: [Caml-list] Weird bug
I've just produced some strange behaviour in my program.
I get "Not_found" exception.. when I turn on my programs
debug tracing, the program works.

Some trivial input that previously worked now causes my
program to core dump. [Heh .. some test input
to the compiler works fine .. but when I add

print "Hello world\n";

to the end, my compiler core dumps ..
the same statement compiles find in other places,
and it compiles fine with debug tracing on]

So .. this sounds like memory corruption to me.
But the only way a "nice" ocaml program should
be able to corrupt memory is by a stack overflow.

[My code is "nice" NO arrays, NO magic, NO C routines
called .. its a compiler, all list and hashtable stuff --
the only nasty thing is that I have ocamlopt.opt --rectypes]

Previously I noticed that this was trapped
(an actual infinite recursion gracefully exited
with a stack overflow message .. nice!!)

I find it hard to believe my program has exceeded
any sensible limitations (some of the typing
in the parser is really flogging the ocaml compiler
.. 20 second compilation .. was 1 second ..
but the generated code should be small).

Question: any known bugs in ocaml that could cause this?

Question: I previously found a serious bug with polymorphic
variants in Ocaml 3.02.  The code that triggered the bug
works fine with 3.01 and with 3.04. Has that bug been
identified and fixed (or was I just lucky ..and now unlucky again)?

Question: is stack overflow always trapped?

It seems unlikely that I have an infinite recursion .. since
turning on debug output shouldn't change the flow
of control [though it is possible .. since the output
is controlled by a flag ..]

John Max Skaller, mailto:skaller@ozemail.com.au
snail:10/1 Toxteth Rd, Glebe, NSW 2037, Australia.

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