From: <don...@is...> - 2005-10-07 19:19:59
|
> > recvfrom 1000001 0x6 0x20fc8604 0x5ee 0x0 0x20fc859c 0xbf8d6bc4 (=22) > > recvfrom 1000003 0x6 0x20fc8604 0x5ee 0x0 0x20fc859c 0xbf8d6004 (=22) > > *** - UNIX error 14 (EFAULT): Bad address > > Notice that buffer and sockaddr addresses are the same as before, > > it's the sa-len address that has changed! This is related to the > > location of your module recvfrom code, right? > no, this is a location on the C stack of the current execution point. Ok, I understand - the length is stack allocated, and all the earlier calls had the same calling path. > > I thought I might be able to see whether the address passed for > > sockaddr at least contained the data that default-device claims > > to hold like this > > (ffi:memory-as #x20fc859c 'ffi:long) > > but evidently not. > > *** - FFI:MEMORY-AS: argument is not a foreign object: 553420188 > > http://clisp.cons.org/impnotes/dffi.html#faddr-u This doesn't help me to verify that the address passed to recvfrom is correct. I'd like to just read the memory at a given address. Is there a way to do that? I was starting to play with def-call-out in hope of doing so. My plan was to define something like htonl as accepting a pointer to long, then pass the address to it (and call htonl on the result if I want to restore the original byte order). > this might be due to the data being tenured to the older generation. > please see spvw_genera1.d: generation and in_old_generation() Sounds plausible. Still, the problem at hand is to find out what's wrong (if anything) with the arguments being passed to recvfrom. First I'd like to try to verify that the addresses are wrong, then find out what they ought to be, then perhaps we can see why they are not what they ought to be. The first task is why I want to read the memory at location L. For the next task it would be useful to have some function that tells me the address of a lisp object. I was going to try something similar to the ffi trick above, declaring the argument to htonl to be a pointer to an array. Any suggestions are more than welcome. Is there a function that returns the address of a lisp object? |