Ron, you are right...  I wrote a simple test program that makes a
socket and selects on it and then calls recv() if it is readable.
Here is my stacktrace:

acid: lstk()
read(nbytes=0xa,buf=0xdfffeb7e,d=0x4)+0x0 /sys/src/ape/lib/ap/plan9/read.c:10
        noblock=0x0
        n=0x9
recv(flags=0x0,fd=0x4,a=0xdfffeb7e,n=0xa)+0x3e /sys/src/ape/lib/bsd/send.c:30
main()+0x153 /tmp/socktest/a.c:39
        fd=0x4
        a=0x50000002
        s=0x10
        x=0x0
_main+0x26 /sys/src/ape/lib/ap/386/main9.s:12

It calls the right read() from /sys/src/ape/lib/ap/plan9/read.c.  But
i still dont understand why the stacktrace you posted shows recv() calling
read from /sys/src/libc/9sys/read.c :-( How can that happen?

>> pread()+0x7 /sys/src/libc/9syscall/pread.s:5
>> read(fd=0x5,buf=0x110414,n=0x1000)+0x2f /sys/src/libc/9sys/read.c:7
>> recv(flags=0x0,fd=0x5,a=0x110414,n=0x1000)+0x3e
>> /sys/src/ape/lib/bsd/send.c:30
>> libssh2_packet_read(session=0x1102f8)+0x176
>> /usr/bootes/libssh2/libssh2-0.18/src/transport.c:326
>> libssh2_channel_read_ex(channel=0x114460,buflen=0x1000,stream_id=0x0,buf=0xdfffdee8)+0x2a7
>>
>> /usr/bootes/libssh2/libssh2-0.18/src/channel.c:1442
>> fromnet(c=0x114460,s=0x1102f8)+0x2e
>> /usr/bootes/libssh2/libssh2-0.18/clients/ssh2.c:75
>> main(argc=0x2,argv=0xdfffef94)+0x47c
>> /usr/bootes/libssh2/libssh2-0.18/clients/ssh2.c:253
>> _main+0x31 /sys/src/libc/386/main9.s:16

--
cinap

Reply via email to