caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] STRANGE!!!
@ 2002-06-11 16:40 Animesh Pathak
  2002-06-11 17:11 ` Jun P.FURUSE
  0 siblings, 1 reply; 2+ messages in thread
From: Animesh Pathak @ 2002-06-11 16:40 UTC (permalink / raw)
  To: caml-list

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

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Caml-list] STRANGE!!!
  2002-06-11 16:40 [Caml-list] STRANGE!!! Animesh Pathak
@ 2002-06-11 17:11 ` Jun P.FURUSE
  0 siblings, 0 replies; 2+ messages in thread
From: Jun P.FURUSE @ 2002-06-11 17:11 UTC (permalink / raw)
  To: animesh.pathak; +Cc: caml-list

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

Hello,

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-06-11 17:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-06-11 16:40 [Caml-list] STRANGE!!! Animesh Pathak
2002-06-11 17:11 ` Jun P.FURUSE

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