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] 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 <animesh.pathak@inria.fr>
Subject: [Caml-list] STRANGE!!!
Date: Tue, 11 Jun 2002 18:40:24 +0200 (MET DST)
Message-ID: <200206111640.g5BGeOL03761@payia.inria.fr>

> 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 					 Jun.Furuse@inria.fr
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