demexp-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Demexp-dev] [RPC] Exception on invalid input: bug or feature?


From: David MENTRE
Subject: [Demexp-dev] [RPC] Exception on invalid input: bug or feature?
Date: Tue, 08 Feb 2005 21:29:53 +0100
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux)

Hello Gerd,

As I said before, I'm using your RPC (v0.4.1) package in my server. I
can easily trigger following exception by entering invalid
(i.e. garbage) input in the socket of the waiting server:

Fatal error: exception Rtypes.Cannot_represent("int_of_uint4")
Raised at file "rtypes.ml", line 28, character 28
Called from file "rpc_transport.ml", line 287, character 45
Called from file "rpc_server.ml", line 504, character 52
Re-raised at file "rpc_server.ml", line 528, character 5
Called from file "unixqueue.ml", line 761, character 50
Re-raised at file "unixqueue.ml", line 757, character 5
Called from file "equeue.ml", line 103, character 13
Re-raised at file "equeue.ml", line 113, character 3
Called from file "list.ml", line 174, character 20
Called from file "equeue.ml", line 115, character 18
Re-raised at file "equeue.ml", line 129, character 6
Re-raised at file "equeue.ml", line 155, character 10
Called from file "unixqueue.ml", line 951, character 29
Called from file "srv/demexp-server.ml.nw", line 160, character 20
Called from unknown location
Called from file "srv/demexp-server.ml.nw", line 185, character 35

On my side, file "srv/demexp-server.ml.nw", line 160, character 20
corresponds to a call to Unixqueue.run.

On your side, file "rpc_transport.ml", line 287, character 45 seems to
be a routine decoding the record marking before decoding an XDR
message. So it seems that the invalid record marking triggers the
exception.

However, I'm quite surprised that exception Rtypes.Cannot_represent is
raised instead of a more generic one, like Invalid_message or something
similar.

Is it a bug or a feature?

If it is a feature, how am I supposed to handle such badly formed
messages as the exception is raised within your code, before my callback
can be called? Or maybe using a call to
Rpc_server.set_session_filter[1]? In that case, which exceptions am I
supposed to catch?


Thanks in advance for any help,
Yours,
david

[1] I'm already using it, with:
  Rpc_server.set_session_filter 
    server 
    (fun _ -> 
      (`Accept_limit_length(Config.maximum_message_size, `Deny)));
-- 
pub  1024D/A3AD7A2A 2004-10-03 David MENTRE <address@hidden>
 5996 CC46 4612 9CA4 3562  D7AC 6C67 9E96 A3AD 7A2A





reply via email to

[Prev in Thread] Current Thread [Next in Thread]