Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] [Early announce] Text Mode Kit
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2002-03-19 (13:48)
From: Nicolas George <>
Subject: [Caml-list] Strange bug with dynamic loading (was: Text Mode Kit)
Le nonidi 29 ventôse, an CCX, Nicolas George a écrit :

This project has a binding for the curses library, and uses the dynamic
loading. But a strange bug appears. With the following program:

open Curses

let main () =
  let w = initscr () in
  assert (cbreak ());
  assert (noecho ());
  assert (move 3 4);
  hline 0 42;
  ignore (getch ());
  assert (move 4 5);
  hline 0 42;
  ignore (getch ());
  endwin ()

let () = main ()

everything works good. But if the first line with getch becomes

  let () = ignore (getch ()) in

the second horizontal lines becomes a line of `q'. Further experiments
show that in some cases, the ncurses library is totally confused after
the first refresh. The problem does not appears when the binding is
statically linked (-custom, -use-runtime or ocamlopt) (but still
dynamically linked to ncurses). All this happens on Linux/i386. On
Solaris/sparc, anything segfaults at startup.

Does anyone here understand what is happening?