From mboxrd@z Thu Jan 1 00:00:00 1970 To: 9fans@cse.psu.edu From: Martin Wyser Message-ID: <408f770d$1@pfaff2.ethz.ch> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit References: <408e8452$1@pfaff2.ethz.ch>, <99c511594f4894ba7d456adfac2c3862@vitanuova.com> Subject: Re: [9fans] ramfs, lib9p Date: Wed, 28 Apr 2004 09:33:49 +0000 Topicbox-Message-UUID: 702d3bd8-eacd-11e9-9e20-41e7f4b1d025 rog@vitanuova.com wrote: >>/sys/src/lib9p/ramfs.c seems newer, because does use lib9p > > > newer, but not much used. > > i'd not be surprised if the newer version was written just to test > lib9p and wasn't as fully featured as /sys/src/cmd/ramfs.c (for > instance, the lib9p version doesn't deal with exclusive-use files, as > far as i can see). > > what are the "bad bugs" in the older one? > I do ramfs -s -D aux/nfsserver -f /srv/ramfs -c /lib/ndb/nfs.martin aux/portmapper Then I mount on my linux box at /mnt, then ls /mnt, which hangs, but triggers the suicide message below (ramfs protocol trace at end). It comes out that ropen in ramfs.c (the one in cmd/) dereferences a null pointer at ramfs.c:368: 367 r=f->ram; //f->ram is nil 368 if(r->busy) //r is nil too The null pointer is set up by newfid() at ramfs:c:738, the calls to newfid() and ropen() are made at ramfs.c:787. It seems to me that the deadly Topen sent by nfsserver could be a bug (or at least protocol nonsense) too, but even if so, ramfs is supposed to give an Rerror, rather than just crash. There may be easier ways to crash ramfs than using nfsserver, but as mentioned, I did not invest much time, because I want to concentrate on the 'newer' ramfs. After all, using lib9p looks like the future, but it could use some excercising to grow strong, sort of. regards, Martin ramfs 106:<-Tversion tag 65535 msize 8216 version '9P2000' ramfs 106:->Rversion tag 65535 msize 8216 version '9P2000' ramfs 106:<-Tattach tag 1 fid 0 afid -1 uname none aname ramfs 106:->Rattach tag 1 qid (0000000000000000 0 d) ramfs 106:<-Tstat tag 2 fid 0 ramfs 106:->Rstat tag 2 stat '.' 'mwyser' 'mwyser' 'mwyser' q (0000000000000000 0 d) m 020000000775 at 1083164331 mt 1083164331 l 0 t 65535 d -256 ramfs 106:<-Tstat tag 3 fid 0 ramfs 106:->Rstat tag 3 stat '.' 'mwyser' 'mwyser' 'mwyser' q (0000000000000000 0 d) m 020000000775 at 1083164331 mt 1083164331 l 0 t 65535 d -256 ramfs 106:<-Twalk tag 4 fid 0 newfid 1 nwname 0 ramfs 106:->Rwalk tag 4 nwqid 0 ramfs 106:<-Topen tag 5 fid 1 mode 0 ramfs 106: suicide: sys: trap: fault read addr=0x0 pc=0x000018f4