guile-rpc-bugs
[Top][All Lists]
Advanced

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

[Guile-rpc-bugs] "dir.x" example, bug in xdr/types.scm ?


From: Tomas By
Subject: [Guile-rpc-bugs] "dir.x" example, bug in xdr/types.scm ?
Date: Sun, 9 Nov 2014 20:05:43 +0100
User-agent: SquirrelMail/1.4.18

Hi all,

I'm experimenting with a RPC server in C and a pure Scheme client.

---------- begin client.scm ----------
#! /bin/sh
# -*- scheme -*-
exec guile-gnome-2 --no-auto-compile -s $0 "$@"
!#
(use-modules (rpc rpc))
(use-modules (rpc xdr) (rpc xdr types))

(include "types.scm")
(include "c.scm")

(define socket (socket PF_INET SOCK_STREAM 0))
(connect socket AF_INET INADDR_LOOPBACK 57696) ; rpcinfo -p

(define result (DIRPROG-READDIR "." #x7777 socket))
---------- end client.scm ----------

The files types.scm and c.scm are generated as follows (straight out of
the manual):

types.scm: dir.x
        grpc-compile --xdr --constants < dir.x > types.scm

c.scm: dir.x
        grpc-compile --client < dir.x > c.scm

The "dir.x" is the standard RPC example used in many places (attached).

I'm getting the errors below. Have tried on both 32bit and 64bit machines,
with no difference (as expected, I suppose).

It seems to me this might be a bug in the guile-rpc data conversion.

Let me know if I should post the rest of the code.

Grateful for any help.

/Tomas



$ ./client.scm
Backtrace:
In ice-9/boot-9.scm:
 157: 15 [catch #t #<catch-closure 2440380> ...]
In unknown file:
   ?: 14 [apply-smob/1 #<catch-closure 2440380>]
In ice-9/boot-9.scm:
  63: 13 [call-with-prompt prompt0 ...]
In ice-9/eval.scm:
 432: 12 [eval # #]
In ice-9/boot-9.scm:
2320: 11 [save-module-excursion #<procedure 2471cc0 at
ice-9/boot-9.scm:3961:3 ()>]
3968: 10 [#<procedure 2471cc0 at ice-9/boot-9.scm:3961:3 ()>]
1645: 9 [%start-stack load-stack ...]
1650: 8 [#<procedure 2470060 ()>]
In unknown file:
   ?: 7 [primitive-load "/media/tomas/disk/tech/rpc/./client.scm"]
In ice-9/eval.scm:
 453: 6 [eval # ()]
In rpc/rpc.scm:
 288: 5 [DIRPROG-READDIR "." 30583 ...]
 265: 4 [#<procedure 273b3c0 at rpc/rpc.scm:256:2 (args xid endpoint
#:optional send-message)> "." ...]
In rpc/xdr.scm:
 354: 3 [encode #<<xdr-vector-type> base-type: # max-element-count: 255>
"." 40]
In unknown file:
   ?: 2 [array-for-each #<procedure 2749e40 at rpc/xdr/types.scm:72:20
(value)> "."]
In rpc/xdr/types.scm:
  73: 1 [#<procedure 2749e40 at rpc/xdr/types.scm:72:20 (value)> #\.]
 283: 0 [#<procedure 275f7c0 at rpc/xdr/types.scm:282:26 (value index)>
#\. 44]

rpc/xdr/types.scm:283:28: In procedure #<procedure 275f7c0 at
rpc/xdr/types.scm:282:26 (value index)>:
rpc/xdr/types.scm:283:28: In procedure bytevector-u8-set!: Wrong type
argument in position 3: #\.

Attachment: dir.x
Description: Binary data


reply via email to

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