Coda File System

Re: ulocoda on OS X

From: Piotr Isajew <pki_at_ex.com.pl>
Date: Tue, 2 Apr 2013 10:48:01 +0200
On Tue, Mar 26, 2013 at 12:57:58PM +0000, u-codalist-9wcu_at_aetey.se wrote:

> At least the fact that you could compile it for 32-bit gives a
> hope that Apple will not radically change the 64-bit interfaces
> with every version later on.
> 
> Keep us informed!


well, for now I commented out getdirentries() stuff. After some
changes to both python and C code I managed to compile it
64-bit. There was an issue with packet header length 32bit
vs. 64bit in tenaron<->terra RPC code, and a deadlock during
library initialization (possibly) caused by changes in libc.

I did some quick fixes for those just to see if I get something
working at the end, and tried to test how it works on ctokens
command. The results are... so, so...

Here are the results after enabling tracing:

$ ctokens
--> my_open$NOCANCEL$UNIX2003(/dev/urandom, 0, 4c00)
--> canon_path: A: returning original /dev/urandom
--> 3 = my_open$NOCANCEL$UNIX2003(/dev/urandom, 0, 4c00)


--> my_open$NOCANCEL$UNIX2003(/dev/urandom, 0, 0)
--> canon_path: A: returning original /dev/urandom
--> 4 = my_open$NOCANCEL$UNIX2003(/dev/urandom, 0, 0)


--> my_close(4)
--> my_close(4)
pickup_survival_kit: No survival kit keyed _CODA_EXECVE_SURVIVAL_KIT_2q45wjcCSQsW_5573, pid=5573
pickup_survival_kit: No survival kit FD LIST for pid 5573
--> my_close(3)
--> my_close(3)
--> my_close(3)
--> my_close(3)
--> my_open$NOCANCEL$UNIX2003(/etc/sysinfo.conf, 0, 1b6)
--> canon_path: A: returning original /etc/sysinfo.conf
Init_volfs_coda: volfs_coda=/.vol/234881026/2/coda, len=22
--> -1 = my_open$NOCANCEL$UNIX2003(/etc/sysinfo.conf, 0, 1b6)


--> my_fstat(1, 5fbfec80)
--> 0 = fstat(1, 5fbfec80)

Tokens held by the Cache Manager for pki:
--> my_access(/Users/pki/.ulocoda/etc/coda/venus.conf, 4) - request sent
--> canon_path: A: returning original /Users/pki/.ulocoda/etc/coda/venus.conf
--> 0 = access(/Users/pki/.ulocoda/etc/coda/venus.conf, 4)


--> my_open$NOCANCEL$UNIX2003(/Users/pki/.ulocoda/etc/coda/venus.conf, 0, 1b6)
--> canon_path: A: returning original /Users/pki/.ulocoda/etc/coda/venus.conf
--> 3 = my_open$NOCANCEL$UNIX2003(/Users/pki/.ulocoda/etc/coda/venus.conf, 0, 1b6)

--> my_fstat(3, 5fbff610)
--> 0 = fstat(3, 5fbff610)

--> my_close(3)
--> my_close(3)
--> my_open$NOCANCEL$UNIX2003(/coda, 100004, 0)
--> canon_path: A: returning original /coda
Init_client, pid=5573
Initializing tx socket, pid=5573

Initializing key for rx socket, pid=5573

path constructed: /coda
Created header for open_by_path (13)
--> Establish rx socket Pid 5573, value=0
Receive socket opened, fd=4
--> ID:0 = my_open$NOCANCEL$UNIX2003(100004, 0, /coda) - request sent

Failed to get list of realms: Operation timed out


On terra side it looks as follows:


<Thread(Thread-3, started 4302479360)> SyscallHandler: Received request:  (<socket._socketobject object at 0x1004f86e0>,) thread= <Thread(Thread-3, started 4302479360)>
<Thread(Thread-3, started 4302479360)> Connection to  /Users/pki/.ulocoda/spool/mariner opened thread=
Packet read, length= 44
packet read= ('\x00\x00\x00\x00\x00\x00\x00\x00\xc0|Sp\xff\x7f\x00\x00\xc5\x15\x00\x00\xc5\x15\x00\x00\xe8\x03\x00\x00open_by_path\x00\x00\r\x00',)
unpack_size= 44
unique= 0
tid= 140735077907648
pgid= 5573
uid= 1000
op= ('open_by_path\x00\x00',)
reslen= 13
op:  open_by_path
reslen:  13
rest:  ('\x04\x00\x10\x00\x00\x00\x00\x00/coda',)
fn:  <class 'syscall_functions.Fn_Open_by_path'>
('Calling rpc with indata:', ('\x00\x00\x00\x00\x00\x00\x00\x00\xc0|Sp\xff\x7f\x00\x00\xc5\x15\x00\x00\xc5\x15\x00\x00\xe8\x03\x00\x00open_by_path\x00\x00\r\x00\x04\x00\x10\x00\x00\x00\x00\x00/coda',))
Max typenum is c_int(21) 21 size= c_uint(4L) 4
Params of function  open_by_path  is: [('unique', <class 'c_types.CLong'>, 'Unique call id'), ('tid', <class 'c_types.CUnsignedLong'>, 'Thread id of calling process'), ('pid', <class 'c_types.CInt'>, 'Process ID'), ('pgid', <class 'c_types.CInt'>, 'Process Group'), ('uid', <class 'c_types.CInt'>, 'User id'), ('op', <class 'c_types.COpcode'>, 'OpCode'), ('reslen', <class 'c_types.CUnsignedShort'>, 'Residue length of call'), ('flags', <class 'c_types.COpenFlags'>, 'Open flags'), ('mode', <class 'c_types.CUnsignedInt'>, 'Open mode'), ('path', <class 'c_types.CString'>, 'Path of file to open')]
Parsing parameter  ('unique', <class 'c_types.CLong'>, 'Unique call id')
Parsing parameter  ('tid', <class 'c_types.CUnsignedLong'>, 'Thread id of calling process')
Parsing parameter  ('pid', <class 'c_types.CInt'>, 'Process ID')
Parsing parameter  ('pgid', <class 'c_types.CInt'>, 'Process Group')
Parsing parameter  ('uid', <class 'c_types.CInt'>, 'User id')
Parsing parameter  ('op', <class 'c_types.COpcode'>, 'OpCode')
Parsing parameter  ('reslen', <class 'c_types.CUnsignedShort'>, 'Residue length of call')
Parsing parameter  ('flags', <class 'c_types.COpenFlags'>, 'Open flags')
Parsing parameter  ('mode', <class 'c_types.CUnsignedInt'>, 'Open mode')
Parsing parameter  ('path', <class 'c_types.CString'>, 'Path of file to open')

5573 Fn_Open_by_path: path= ('/coda',) flags=0x100004  codaflags=0x100005 mode=00
Namei: Looking for  /coda follow= True
<Thread(Thread-3, started 4302479360)> sent message up 20


<Thread(Thread-3, started 4302479360)> received message down:(28)

<Thread(Thread-3, started 4302479360)> read result from down:(28)

<Thread(Thread-3, started 4302479360)> sf socket closed

<Thread(Thread-3, started 4302479360)> sent message up 36


<Thread(Thread-3, started 4302479360)> received message down:(152)

<Thread(Thread-3, started 4302479360)> read result from down:(152)

<Thread(Thread-3, started 4302479360)> sf socket closed

<Thread(Thread-3, started 4302479360)> sent message up 36


<Thread(Thread-3, started 4302479360)> received message down:(152)

<Thread(Thread-3, started 4302479360)> read result from down:(152)

<Thread(Thread-3, started 4302479360)> sf socket closed

<Thread(Thread-3, started 4302479360)> Unexpected error: <type 'exceptions.NameError'>
<Thread(Thread-3, started 4302479360)> 2013-03-31T14:50:19.421893
<Thread(Thread-3, started 4302479360)> Exception ---------------------------------------------
<Thread(Thread-3, started 4302479360)>  File "/Users/pki/.ulocoda/lib/rpcserver.py", line 222, in _call_rpc
    result = fun.do(*params)
   File "/Users/pki/.ulocoda/lib/syscall_functions.py", line 142, in do
    return self.rpc_do()
   File "/Users/pki/.ulocoda/lib/syscall_functions.py", line 850, in rpc_do
    r.mode = rv.va_mode | self.attr_to_stat_mode(rv.va_type)
   File "/Users/pki/.ulocoda/lib/syscall_functions.py", line 480, in attr_to_stat_mode
    raise RPCValueError("Invalid file type", value=errno.EINVAL)

----------------------------------------
Exception happened during processing of request from 
Traceback (most recent call last):
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/SocketServer.py", line 558, in process_request_thread
    self.finish_request(request, client_address)
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/SocketServer.py", line 320, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/SocketServer.py", line 615, in __init__
    self.handle()
  File "/Users/pki/.ulocoda/lib/terra.py", line 157, in handle
    self._do_handle()
  File "/Users/pki/.ulocoda/lib/terra.py", line 245, in _do_handle
    rp=self.server.call_rpc(self, op, (packet+rest,))
  File "/Users/pki/.ulocoda/lib/rpcserver.py", line 260, in call_rpc
    (fun, ret) = self._call_rpc(handler, function, params)
  File "/Users/pki/.ulocoda/lib/rpcserver.py", line 222, in _call_rpc
    result = fun.do(*params)
  File "/Users/pki/.ulocoda/lib/syscall_functions.py", line 142, in do
    return self.rpc_do()
  File "/Users/pki/.ulocoda/lib/syscall_functions.py", line 850, in rpc_do
    r.mode = rv.va_mode | self.attr_to_stat_mode(rv.va_type)
  File "/Users/pki/.ulocoda/lib/syscall_functions.py", line 480, in attr_to_stat_mode
    raise RPCValueError("Invalid file type", value=errno.EINVAL)
NameError: global name 'errno' is not defined
----------------------------------------
Received on 2013-04-02 04:48:19