caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Jun P.FURUSE" <Jun.Furuse@inria.fr>
To: animesh.pathak@inria.fr
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] STRANGE!!!
Date: Tue, 11 Jun 2002 19:11:47 +0200 (CEST)	[thread overview]
Message-ID: <20020611.191147.730554460.Jun.Furuse@inria.fr> (raw)
In-Reply-To: <200206111640.g5BGeOL03761@payia.inria.fr>

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


      reply	other threads:[~2002-06-11 17:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-11 16:40 Animesh Pathak
2002-06-11 17:11 ` Jun P.FURUSE [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020611.191147.730554460.Jun.Furuse@inria.fr \
    --to=jun.furuse@inria.fr \
    --cc=animesh.pathak@inria.fr \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).