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] STRANGE!!!
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2002-06-11 (17:11)
From: Jun P.FURUSE <Jun.Furuse@i...>
Subject: Re: [Caml-list] STRANGE!!!
From: Animesh Pathak <>
Subject: [Caml-list] STRANGE!!!
Date: Tue, 11 Jun 2002 18:40:24 +0200 (MET DST)
Message-ID: <>

> hello people,
> I seem to have a very strange problem,
> I have a client server code (2 separate programs) which transmit data using 
> Marshal.to_channel and Marshal.from_channel on sockets.
> The problem is.. although I AM able to run the program successfully in the caml 
> toplevel by #load ing the appropriate .cma/.cmo files, when I run the programs 
> independently, the server, after getting the data.. allocates memory in 
> megabytes until a segmentation fault or a bus fault occurs!! It cannot even send 
> ints.
> Kindly tell me what can possible be causing the problem.
> thanks for paying attn to my query
> Animesh


This is just a short answer, since I am currently behind a poor PPP line.

You may know that output/input_values are DANGEROUS. 
There is no type checking of input values. 
Once you use output/input_values, you are away from the ML type safety.
Careless use of ML value I/O makes your program easily explode:

# let oc = open_out_bin "data";;
# output_value oc 1;;
# close_out oc

# let ic = open_in "data"
# (input_value ic : float);;
Seg. fault

Also note that between different programs, functions cannot be exchangable,
since they are just expressed as pointers which are only valid inside
one program.

Carefully check whether your two programs exchange values of the same type...

Jun P. Furuse
To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: