[9fans] pjpeg in /sys/lib/memetype

2014-11-14 Thread Kenji Arisawa
Hello 9fans,

It is curious for me that ".jpg" has two lines in /sys/lib/mimetype.
term% grep jpeg /sys/lib/mimetype
.jfif   image   jpeg-   y
.jfif-tbnl  image   jpeg-   y
.jpeimage   jpeg-   y
.jpeg   image   jpeg-   y
.jpgimage   jpeg-   y
.jpgimage   pjpeg   -   y
term%

The file is currently consulted by only two applications: mail and httpd.
I have thought that the file provides conventional way to determine mime type 
from file suffix. If so, what is the mime time for "foo.jpg"?

Kenji Arisawa




Re: [9fans] dns

2012-08-25 Thread Kenji Arisawa
Hello cinap,

broken dns triggers Fauth problem, so I have rebooted.
I will get snapshot at next crash.

Kenji Arisawa


On 2012/08/25, at 19:54, cinap_len...@gmx.de wrote:

> always make a process snapshot as the kernel might discard
> your broken process once it runs low on memory so you have
> time to debug:
> 
> snap 41356 >/tmp/dns.snap
> 
> char *domain strings alloc header seems to have been corrupted
> (or just freed by accident?).
> 
> the string just gets allocated and freed in mydnsquery() so its
> unlikely a bug there. someone else has corrupted its alloc header?
> 
> it looks more like corruption as we dont hand this pointer out to
> someone else but netmkaddr().
> 
> look at the raw data, often one can get a clue by what it got
> overridden with and try to figure out what the previous block
> before our block that got corrupted was. the pool allocator keeps
> the callerpc's of who allocated the block so you can use that
> to figure out what it is, or look at the contents.
> 
> // dump the memory arround our corrupted block
> dump(0x497f8 - 0x10, 0x100, "X")
> 
> maybe our block didnt got overridden but really freed with
> a call to free but with the wrong pointer? check the alloc
> magic!
> 
> // check the contents, should be an ip address string
> dump(0x49800, 1, "s")
> 
> run acid with -lpool -lleak and run blockdump() if its
> corrupted block, it might just stop at the block before
> our one and will print the allocpc's and give some
> diagnostics.
> 
> i can try this if you provide process snapshot file.
> 
> --
> cinap
> 




Re: [9fans] dns

2012-08-24 Thread Kenji Arisawa
Hello cinap,

I got a one. I hope this a helpful.


ar% cat broken/1345779846.41356
name=dns
/proc/41356/text:386 plan 9 executable
/sys/lib/acid/port
/sys/lib/acid/386
acid: abort()+0x0 /sys/src/libc/9sys/abort.c:6
ppanic(p=0x3975c,fmt=0x394ec)+0x146 /sys/src/libc/port/malloc.c:166
pv=0x3e820
msg=0x3f804
v=0xdfffc800
n=0x2c
D2B(p=0x3975c,v=0x497f8)+0x5a /sys/src/libc/port/pool.c:968
a=0x497f0
poolfreel(v=0x497f8,p=0x3975c)+0x20 /sys/src/libc/port/pool.c:1192
ab=0x3e820
poolfree(p=0x3975c,v=0x497f8)+0x41 /sys/src/libc/port/pool.c:1327
free(v=0x49800)+0x23 /sys/src/libc/port/malloc.c:250
mydnsquery(qp=0x88cf0,udppkt=0xc76f0,len=0x2a,medium=0x1)+0x185 
/sys/src/cmd/ndb/dnresolve.c:1032
rv=0xc
domain=0x49800
net=0x74656e2f
conndir=0x74656e2f
nci=0x52b59
belen=0x6e2f000f
xmitquery(qp=0x88cf0,depth=0x1,medium=0x1,inns=0x1,obuf=0xc76f0,len=0x2a)+0x227 
/sys/src/cmd/ndb/dnresolve.c:1114
p=0xc7950
j=0x1
n=0x0
buf=0x1b59c4c3
tcpquery(qp=0x88cf0,waitms=0x63f,obuf=0xc76f0,ibuf=0xa7530,depth=0x1,inns=0x1,len=0x2a,req=0x1d85,mp=0xdfffc9b4)+0xea
 /sys/src/cmd/ndb/dnresolve.c:1353
rv=0x0
endms=0x56ba1ef1
queryns(qp=0x88cf0,obuf=0xc76f0,depth=0x1,inns=0x1,waitms=0x63f,ibuf=0xa7530)+0x4d3
 /sys/src/cmd/ndb/dnresolve.c:1428
req=0xa9961d85
len=0x2a
dest=0xc7950
p=0xc7c30
ndest=0x1
endms=0x56ba1dcc
replywaits=0x0
buf=0x9dfa996
m=0x1d85
srcip=0xdfffca18
rv=0x9dfa996
udpquery(mntpt=0x3f0e0,qp=0x88cf0,patient=0x0,depth=0x1,inns=0x1)+0x1b7 
/sys/src/cmd/ndb/dnresolve.c:1578
ibuf=0xa7530
obuf=0xc76f0
fd=0xb
msg=0x6faa
pcntprob=0x3c
reqtm=0x1f40
wait=0x63f
rv=0x87710
netquery(depth=0x1,qp=0x88cf0)+0x2b5 /sys/src/cmd/ndb/dnresolve.c:1660
rv=0x0
dp=0x6d460
qlp=0x6d4fc
lock=0x1
buf=0x3975c
triedin=0x0
inname=0x1
netqueryns(qp=0x88cf0,nsrp=0x876b0,depth=0x1)+0x1e 
/sys/src/cmd/ndb/dnresolve.c:338
rv=0x88ce8
issuequery(class=0x1,qp=0x88cf0,depth=0x0,name=0xdfffce13,recurse=0x0)+0x50 
/sys/src/cmd/ndb/dnresolve.c:359
nsrp=0x876b0
cp=0x88cf0
dbnsrp=0x8558
rp=0x0
dnresolve1(name=0xdfffce13,type=0xf,class=0x1,req=0xdfffcdd8,depth=0x0,recurse=0x0)+0x25c
 /sys/src/cmd/ndb/dnresolve.c:505
dp=0x6d460
rp=0x0
qp=0x88cf0
dnresolve(status=0xdfffcce0,depth=0x0,rooted=0x0,name=0xdfffce13,class=0x1,type=0xf,req=0xdfffcdd8,cn=0x0,recurse=0x0)+0xa8
 /sys/src/cmd/ndb/dnresolve.c:198
procname=0x9cb50
rp=0x0
drp=0x71a98
nrp=0x9cb40
nname=0x48
dp=0xdfffcca8
loops=0x9cb90
lookupqueryold(p=0xdfffce13,mf=0xbac50,req=0xdfffcdd8,rooted=0x0,job=0xba810,errbuf=0xdfffcd0c,wantsav=0x0)+0x70
 /sys/src/cmd/ndb/dns.c:864
status=0x0
rp=0x9cb48
rwrite(job=0xba810,mf=0xbac50,req=0xdfffcdd8)+0x2be /sys/src/cmd/ndb/dns.c:838
err=0x0
cnt=0x1b
send=0x0
errbuf=0x0
atype=0xdfffce2c
io()+0x39e /sys/src/cmd/ndb/dns.c:532
req=0x1
mdata=0x32
n=0x32
job=0xba810
mf=0xbac50
main(argv=0xdfffefb0,argc=0x0)+0x32c /sys/src/cmd/ndb/dns.c:267
ext=0x0
_argc=0x72
_args=0xdfffefc7
servefile=0x642f7323
dir=0x0
kid=0x0
_main+0x31 /sys/src/libc/386/main9.s:16
acid: 
echo kill > /proc/41356/ctl
ar% 

Kenji Arisawa

On 2012/08/21, at 20:27, cinap_len...@gmx.de wrote:

> nothing wrong with diffing the changes and see if theres a clue, but
> to solve this one really needs to find the underlying cause no matter
> what. changes can just hide bugs or make them more or less likely to
> appear. can anyone provide at least a stacktrace or process snapshot
> of the crashed dns processes? from that you try to build a theory of
> what might be going wrong by thinking really really hard... (the
> thinking should be directly proportional to the time it takes to
> reproduce the bug) and then you work on how to prove that theory.
> just changing stuff without knowing what exactly was the problem with
> the old code is sometimes tempting, but wrong and dangerous.
> 
> --
> cinap
> 




Re: [9fans] dns

2012-08-22 Thread Kenji Arisawa
Hello,


On 2012/08/22, at 19:32, cinap_len...@gmx.de wrote:

> the result check of that serveraddr() call should really be:
> 
>   if (j < 0 || j > Maxdest) {
>   dnslog("serveraddrs() result %d out of range", j);
>   abort();
>   }
>   qp->curdest = &qp->dest[j];

what happens if j == Maxdest ?  note that j is index.

I  rather notice the foolowing code.

/* use any addresses that we found */
for(trp = arp; trp && nd < Maxdest; trp = trp->next){
cur = &qp->dest[nd];
parseip(cur->a, trp->ip->name);
/*
 * straddling servers can reject all nameservers if they are all
 * inside, so be sure to list at least one outside ns at
 * the end of the ns list in /lib/ndb for `dom='.
 */
if (ipisbm(cur->a) ||
cfg.straddle && !insideaddr(qp->dp->name) && 
insidens(cur->a))
continue;
cur->nx = 0;
cur->s = trp->owner;
cur->code = Rtimeout;
nd++;
}
lock(&dnlock);
rrfreelist(arp);
unlock(&dnlock);
return nd;

returned value may be Maxdest. 
This code is in function serveraddrs(), and the function must return index. 
(must not be Maxdest)

Kenji Arisawa





Re: [9fans] dns

2012-08-21 Thread Kenji Arisawa
Hello,

I suspect the problem is in:
--rwxrwxr-x M 21231 glenda sys 311768 Jul 14 11:46 dns

I don't have 2012/0501 version. I am lazy sorry.

My current dns is
--rwxrwxr-x M 131526 sys sys 310819 Apr 13 12:46 /386/bin/ndb/dns
That works 12 days since last boot without any troubles.

ar% ps

none 990:00   0:00  184K Open listen
none1000:00   0:00  184K Open listen
bootes  5400:00   0:01  240K Awaitpatrol
none 2411970:00   0:00  240K Awaittcp110
arisawa  2412020:00   0:00  360K Preadpop3

where patrol is a program that reboot cpu server if it detects a process that 
stops
with Fauth status. the contents is 
ar% cat /usr/bootes/bin/rc/patrol
#!/bin/rc
rfork e
while(sleep 60){
  a=`{ps|grep Fauth|wc}
  if(! ~ $a(1) 0){
/usr/local/bin/386/logit -l reboot Fauth:$a(1) # for logging (my program). 
don't mind
reboot
  }
}
ar% 

Kenji Arisawa



On 2012/08/21, at 14:08, Jeff Sickel wrote:

> As in using:
> 
> Apr 12 22:46:05 CDT 2012 /n/sourcesdump/2012/0501/plan9/386/bin/ndb/dns 
> 310819 [jmk]
> Oct 14 13:32:38 CDT 2011 /n/sourcesdump/2012/0412/plan9/386/bin/ndb/dns 
> 310519 [sys]
> 
> There are a few differences if you compare with sourcesdump. Knowing one that
> works should help narrow down the changes to get the latest working cleanly 
> again.
> 
> -jas
> 
> On Aug 20, 2012, at 11:23 PM, arisawa  wrote:
> 
>> Hello
>> 
>> Recent version of dns crashes.
>> Old version (for example, Apr this year)  is OK.
>> It seems crashed dns make other side effect:
>> Many processes stop with Fauth status. # I don't know the reason.
>> 
>> Kenji Arisawa
> 
> 




Re: [9fans] acme

2010-11-28 Thread Kenji Arisawa
Thanks Ron,

Reboot dissolved the problem.
The acme problem was happened both on my file server and the terminal.
They had been running since the middle of this August.

Kenji Arisawa

On 2010/11/28, at 3:12, ron minnich wrote:

> On Sat, Nov 27, 2010 at 4:39 AM, Kenji Arisawa  
> wrote:
>> Hello 9fans,
>> 
>> After recent update, acme does not run normally.
>> When I execute acme command in a rio window then the window falls into blank 
>> with an error message something like
>> "qunlock ..."
>> Anyone experience similar phenomena?
> 
> I just did a pull and reboot in vmware and don't see this.
> 
> You could get two windows up, ratrace the rc in the other window, run
> acme in the other window, and see what ratrace tells you.
> 
> ron
> 




[9fans] acme

2010-11-27 Thread Kenji Arisawa
Hello 9fans,

After recent update, acme does not run normally.
When I execute acme command in a rio window then the window falls into blank 
with an error message something like
"qunlock ..."
Anyone experience similar phenomena?

Kenji Arisawa




Re: [9fans] checkarenas

2010-09-17 Thread Kenji Arisawa
Thank Russ,

> 
> I can't understand it either.
> It doesn't make any sense to me.
> It might be interesting to run
> 
> cpu -h io
> iostats venti/checkarenas -v /dev/sdC0/arenas arena.30
> 
> and see if the problem happens then.

I have found the origin of the difference.
checkarenas command on term was older then that of io.
sorry for the fuss.

Kenji Arisawa




[9fans] checkarenas

2010-09-16 Thread Kenji Arisawa
Hello,

I noticed strange output that I cann't understand.

term% cpu -h io
io% venti/checkarenas -v /dev/sdC0/arenas
arena='arena.0' [802816,537673728)
version=4 created=1042806254 modified=1046935027 sealed
score=d9da513c8906b67d118ffd862d3b6ffc098e2cd8
clumps=93,052 compressed clumps=33,339 data=642,249,221 compressed 
data=530,978,181 disk storage=536,840,457

[snip]

arena='arena.29' [15570059264,16106930176)
version=5 created=1202285650 modified=1238472397 sealed
score=747a7af59246c9fac4d446c5060ad25b9ae6a317
clumps=164,001 compressed clumps=113,952 data=873,264,264 compressed 
data=526,509,628 disk storage=536,841,691

arena='arena.30' [16106930176,16643801088)
version=5 created=1233280267 modified=1243743100 sealed
score=7a67bb47cd7cac4166b08b2f1931bc7dff23ef80
clumps=312,611 compressed clumps=259,182 data=1,615,971,406 compressed 
data=517,139,649 disk storage=536,834,142

arena='arena.31' [16643801088,17180672000)
version=5 created=1243743100 modified=1284116312
clumps=25,827 compressed clumps=22,564 data=152,702,493 compressed 
data=70,866,487 disk storage=72,493,588

io% 

# note that arena.30 is sealed. #

on the otherhand,

term% import -k'user=arisawa' io / /n/io.import
term% venti/checkarenas -v /n/io.import/dev/sdC0/arenas
arena='arena.0' [802816,537673728)
version=4 created=1042806254 modified=1046935027 sealed
score=d9da513c8906b67d118ffd862d3b6ffc098e2cd8
clumps=93,052 compressed clumps=33,339 data=642,249,221 compressed 
data=530,978,181 disk storage=536,840,457

[snip]

arena='arena.29' [15570059264,16106930176)
version=5 created=1202285650 modified=1238472397 sealed
score=747a7af59246c9fac4d446c5060ad25b9ae6a317
clumps=164,001 compressed clumps=113,952 data=873,264,264 compressed 
data=526,509,628 disk storage=536,841,691

arena='arena.30' [16106930176,16643801088)
version=5 created=1233280267 modified=1243743100
score=7a67bb47cd7cac4166b08b2f1931bc7dff23ef80
clumps=312,611 compressed clumps=259,182 data=1,615,971,406 compressed 
data=517,139,649 disk storage=536,834,142

arena='arena.31' [16643801088,17180672000)
version=5 created=1243743100 modified=1284116312
clumps=25,827 compressed clumps=22,564 data=152,702,493 compressed 
data=70,866,487 disk storage=72,493,588

term% 

# note that arena.30 is NOT sealed. #

the difference between two output is only in arena.30
I don't understand where the difference comes from.

I believe that /dev/sdC0/arenas on io and /n/io.import/dev/sdC0/arenas mounted 
on term must be same.
I also believe that
venti/checkarenas -v file
consults only the given file.

Kenji Arisawa




Re: [9fans] entire cache is busy, 999 dirty

2010-01-31 Thread Kenji Arisawa

Hello erik,

> are you running the latest version of fossil?


probably not.
I will refresh my file server.

Thanks

Kenji Arisawa


On 2010/02/01, at 2:22, erik quanstrom wrote:

>> My question is: 
>> (a) where these messages come from? venti?
> 
> fossil.  (cache.c)
> 
>> (b) what is the problem?
>> (c) how to fix?
> 
> good question.  are you running the latest
> version of fossil? if not, this could be caused by slow
> disk writes which could in turn be caused by the
> periodic bug that cinap_lenrek reported.
> 
> the 999 number is also curious.  one would
> expect that there are more than 999 blocks
> in the cache.
> 
> - erik
> 




[9fans] entire cache is busy, 999 dirty

2010-01-30 Thread Kenji Arisawa
Hello 9fans,

Latterly my file server speaks annoying  kernel message such as:
entire cache is busy, 999 dirty -- waking flush thread
cache is okay again
entire cache is busy, 999 dirty -- waking flush thread
cache is okay again
...

My question is: 
(a) where these messages come from? venti?
(b) what is the problem?
(c) how to fix?

My plan9 partitions are:
hera% disk/prep -p /dev/sdC0/plan9
part 9fat 63 41027
part fossil 41027 21021587
part arenas 21021587 104943827
part isect0 104943827 109139939
part isect1 109139939 113336051
part nvram 113336051 113336052
part cache 113336052 115434108
part swap 115434108 117532164
part bloom 117532164 117597700
part vac 152100272 152100273
part fs 152100273 160826715
hera% 
# don't mined "vac", that is my own use.

Kenji Arisawa




Re: [9fans] utf-8 text files from httpd

2009-10-19 Thread Kenji Arisawa
I think it is difficult to make web server to work correctly in case  
we have variety of charset text files on the server.
Although we can manually select charset in browser menu, the selection  
is useless in case the page is written in Javascript that fills some  
portion of a page reading a text file.
(note that the text file will be interpreted as ascii without  
"charset" in http header.)
I believe the only solution every thing work correctly is to write all  
text files in utf-8 and put "charset=utf-8" in http header as Erik is  
trying.


P.S.
file(1) speaks only mine type but not charset.
it is difficult or impossible to determine charset from a few japanese  
letters.


Kenji Arisawa


On 2009/10/19, at 19:00, Akshat Kumar wrote:


new/sendfd.c:243 c old/sendfd.c:243
<
---

/*

new/sendfd.c:246 c old/sendfd.c:246
<
---

*/


(context: text/plain -> text/plain; charset=utf-8)

Now my text files can be read in the proper encoding
by default, and are not interpreted by browsers (as
well as certain applications) to be whack ASCII.

Is the output of file(1) appropriate for this purpose?
Shouldn't your sample file also be sent as UTF-8?

Thank you for the input, Mr. Arisawa. I agree with
Erik in this case, as you wouldn't be doing much with
files of other encodings on Plan 9 (well, prior to a
tcs(1)), you really only need to worry about getting
across UTF-8.

The point about file handling being up to browsers is
appropriate. However, I'd like to push as much standard
behaviour from the server as I can. If there's an explicit
account of the encoding and type of a file, then there
ought to be no ambiguity.


Thanks,
ak






Re: [9fans] utf-8 text files from httpd

2009-10-18 Thread Kenji Arisawa

we should note also http://www.w3.org/TR/html4/charset.html#h-5.2.2.
the document says:

	To sum up, conforming user agents must observe the following  
priorities when determining

a  document's character encoding (from highest priority to lowest):
1. An HTTP "charset" parameter in a "Content-Type" field.
	2. A META declaration with "http-equiv" set to "Content-Type" and a  
value set for "charset".
	3. The charset attribute set on an element that designates an  
external resource.


Thus, hard coding "charset=utf-8" in http header will bring other  
problem

because that coding disables a line in html header such as:


Kenji Arisawa

On 2009/10/19, at 11:16, Kenji Arisawa wrote:


according to rfc2616, default charset in sending text file is ascii:

  The "charset" parameter is used with some media types to define the
  character set (section 3.4) of the data. When no explicit charset
  parameter is provided by the sender, media subtypes of the "text"
  type are defined to have a default charset value of "ISO-8859-1"  
when

  received via HTTP. Data in character sets other than "ISO-8859-1" or
  its subsets MUST be labeled with an appropriate charset value. See
  section 3.4.1 for compatibility problems.

httpd need explicitly charset=utf-8 in http header in sending utf-8  
text.


Kenji Arisawa

On 2009/10/19, at 9:34, Akshat Kumar wrote:


I'm trying to put up a plain text file containing UTF-8
characters from httpd, but when viewing it from any
browser, it comes off as an ASCII file that needs to
be downloaded (so, those characters are garbled).
Is this due to some behaviour of httpd?

ak









Re: [9fans] utf-8 text files from httpd

2009-10-18 Thread Kenji Arisawa

according to rfc2616, default charset in sending text file is ascii:

   The "charset" parameter is used with some media types to define the
   character set (section 3.4) of the data. When no explicit charset
   parameter is provided by the sender, media subtypes of the "text"
   type are defined to have a default charset value of "ISO-8859-1"  
when

   received via HTTP. Data in character sets other than "ISO-8859-1" or
   its subsets MUST be labeled with an appropriate charset value. See
   section 3.4.1 for compatibility problems.

httpd need explicitly charset=utf-8 in http header in sending utf-8  
text.


Kenji Arisawa

On 2009/10/19, at 9:34, Akshat Kumar wrote:


I'm trying to put up a plain text file containing UTF-8
characters from httpd, but when viewing it from any
browser, it comes off as an ASCII file that needs to
be downloaded (so, those characters are garbled).
Is this due to some behaviour of httpd?

ak






Re: [9fans] validateaddress

2009-08-12 Thread Kenji Arisawa

Hello Russ,

Your prediction is right as shown below.

ar% acid 1236297
/proc/1236297/text:386 plan 9 executable
/sys/lib/acid/port
/sys/lib/acid/386
acid: kw
0x00016120
acid: src(klook)
/sys/src/cmd/rc/var.c:47
 42 kenter(SWITCH, "switch");
 43 kenter(FN, "fn");
 44 }
 45 
 46 tree*
>47  klook(char *name)
 48 {
 49 struct kw *p;
 50 tree *t = token(name, WORD);
 51 for(p = kw[hash(name, NKW)];p;p = p->next)
 52 if(strcmp(p->name, name)==0){
acid: mem(kw, "30X")
0x 0x00019870 0x 0x000197f0 0x00019830 0x  
0x000197b0 0x 0x 0x00019730 0x 0x  
0x 0x 0x 0x 0x 0x  
0x 0x000196f0 0x00019770 0x 0x000198b0 0x  
0x 0x000196b0 0x 0x 0x 0x

acid: *(kw+25*4)
0x000196b0
acid: mem(*(kw+25*4), "16X")
0x00015274 0xe003 0x000196b0 0xfaf0f1fe 0x 0x  
0x 0x 0x 0x 0xef2c00be 0x0040  
0x0a110c09 0x0040 0xbe2c 0x

acid: *(**(kw+25*4)\s)
in
acid:

By the way, how you can find
mem(*(kw+25*4), "16X")  // dumps entry for 'in'
?

Kenji Arisawa


On 2009/08/12, at 23:59, Russ Cox wrote:


so strcmp is being called a lot but klook isn't.
that means that klook is looping inside, which
basically means the p->next pointer is pointing
at itself.

final script:

kw
mem(kw, "30X")  // dumps hash table
*(kw+25*4)
mem(*(kw+25*4), "16X")  // dumps entry for 'in'
*(**(kw+25*4)\s)  // should print 'in'

i expect that the value printed for *(kw+25*4)
in the third line will also be the third value printed
by the mem on the fourth line, meaning that
the hash table entry in question has a next
pointer pointing at itself.  assuming that is true,
i think we're close to the end of what can be done.
the hash table list isn't supposed to loop back
on itself but it is.  that means some kind of dangling
pointer or other memory corruption error, which
we're not likely to find retroactively.

russ






Re: [9fans] validateaddress

2009-08-11 Thread Kenji Arisawa


Thanks Russ,

ar% ps
...
none1236297 49979:50   0:00  172K Running  validateaddress
...
ar% acid 1236297
/proc/1236297/text:386 plan 9 executable
/sys/lib/acid/port
/sys/lib/acid/386
acid: bpset(strcmp)
Waiting...
1236297: exception 50   klook+0x7a  MOVL0x8(DX),DX
acid: loop 1,20 do { cont(); print("strcmp '", *(*strcmp:s1\s), "'  
'",*(*strcmp:s2\s), "'\n"); }

1236297: breakpoint strcmp  SUBL$0xc,SP
strcmp 'in' 'prompt'

1236297: breakpoint strcmp+0x3  MOVLs1+0x0(FP),BP
1236297: breakpoint strcmp  SUBL$0xc,SP
strcmp 'in' 'prompt'

1236297: breakpoint strcmp+0x3  MOVLs1+0x0(FP),BP
1236297: breakpoint strcmp  SUBL$0xc,SP
strcmp 'in' 'prompt'

1236297: breakpoint strcmp+0x3  MOVLs1+0x0(FP),BP
1236297: breakpoint strcmp  SUBL$0xc,SP
strcmp 'in' 'prompt'

1236297: breakpoint strcmp+0x3  MOVLs1+0x0(FP),BP
1236297: breakpoint strcmp  SUBL$0xc,SP
strcmp 'in' 'prompt'

1236297: breakpoint strcmp+0x3  MOVLs1+0x0(FP),BP
1236297: breakpoint strcmp  SUBL$0xc,SP
strcmp 'in' 'prompt'

1236297: breakpoint strcmp+0x3  MOVLs1+0x0(FP),BP
1236297: breakpoint strcmp  SUBL$0xc,SP
strcmp 'in' 'prompt'

1236297: breakpoint strcmp+0x3  MOVLs1+0x0(FP),BP
1236297: breakpoint strcmp  SUBL$0xc,SP
strcmp 'in' 'prompt'

1236297: breakpoint strcmp+0x3  MOVLs1+0x0(FP),BP
1236297: breakpoint strcmp  SUBL$0xc,SP
strcmp 'in' 'prompt'

1236297: breakpoint strcmp+0x3  MOVLs1+0x0(FP),BP
1236297: breakpoint strcmp  SUBL$0xc,SP
strcmp 'in' 'prompt'

1236297: breakpoint strcmp+0x3  MOVLs1+0x0(FP),BP
1236297: breakpoint strcmp  SUBL$0xc,SP
strcmp 'in' 'prompt'

1236297: breakpoint strcmp+0x3  MOVLs1+0x0(FP),BP
1236297: breakpoint strcmp  SUBL$0xc,SP
strcmp 'in' 'prompt'

1236297: breakpoint strcmp+0x3  MOVLs1+0x0(FP),BP
1236297: breakpoint strcmp  SUBL$0xc,SP
strcmp 'in' 'prompt'

1236297: breakpoint strcmp+0x3  MOVLs1+0x0(FP),BP
1236297: breakpoint strcmp  SUBL$0xc,SP
strcmp 'in' 'prompt'

1236297: breakpoint strcmp+0x3  MOVLs1+0x0(FP),BP
1236297: breakpoint strcmp  SUBL$0xc,SP
strcmp 'in' 'prompt'

1236297: breakpoint strcmp+0x3  MOVLs1+0x0(FP),BP
1236297: breakpoint strcmp  SUBL$0xc,SP
strcmp 'in' 'prompt'

1236297: breakpoint strcmp+0x3  MOVLs1+0x0(FP),BP
1236297: breakpoint strcmp  SUBL$0xc,SP
strcmp 'in' 'prompt'

1236297: breakpoint strcmp+0x3  MOVLs1+0x0(FP),BP
1236297: breakpoint strcmp  SUBL$0xc,SP
strcmp 'in' 'prompt'

1236297: breakpoint strcmp+0x3  MOVLs1+0x0(FP),BP
1236297: breakpoint strcmp  SUBL$0xc,SP
strcmp 'in' 'prompt'

1236297: breakpoint strcmp+0x3  MOVLs1+0x0(FP),BP
1236297: breakpoint strcmp  SUBL$0xc,SP
strcmp 'in' 'prompt'

acid: acid: bpdel(strcmp)
acid: bpset(klook)
acid: cont();
:5: (error) msg: pid=1236297 startstop: interrupted
acid: bpdel(klook)


Kenji Arisawa


On 2009/08/12, at 0:27, Russ Cox wrote:


acid pid

bpset(strcmp)
loop 1,20 do { cont(); print("strcmp '", *(*strcmp:s1\s), "' '",
*(*strcmp:s2\s), "'\n"); }
bpdel(strcmp)

also

bpset(klook)
cont();
# wait a while, see if you hit the breakpoint, probably not
DEL (to stop acid if it didn't hit the breakpoint)
bpdel(klook)

if you do hit the klook breakpoint then try
the same sequence but with yyparse instead
of klook.

the goal is to find some function that isn't being
repeatedly called.  that helps narrow down the
source of the infinite loop to code inside that
function or the ones it calls.

russ






Re: [9fans] validateaddress

2009-08-10 Thread Kenji Arisawa

Thanks Erik,

ar% ps -a
...
none1236297 48578:46   0:00  172K Running   
validateaddress /mail/lib/validateaddress ar.aichi-u.ac.jp!hatbox

...
ar% ACID -l /sys/lib/acid/truss 1236297
/proc/1236297/text:386 plan 9 executable
/sys/lib/acid/port
/sys/lib/acid/386
/sys/lib/acid/truss
acid: truss()

no output, so I examined the status using ps

ar% ps -a
...
none1236297 48578:46   0:00  172K Running   
validateaddress /mail/lib/validateaddress ar.aichi-u.ac.jp!hatbox

...
bootes  20563240:00   0:00  236K AwaitACID /bin/ACID - 
l /sys/lib/acid/truss 1236297
bootes  20563280:00   0:00 1472K Stopwait acid -l /sys/lib/ 
acid/truss 1236297

bootes  20563290:00   0:00  188K Preadps -a

where ACID does
chmod 660 /proc/1236297/mem
acid -l /sys/lib/acid/truss 1236297

Thanks
Kenji Arisawa

On 2009/08/11, at 13:07, erik quanstrom wrote:


On Mon Aug 10 23:59:56 EDT 2009, aris...@ar.aichi-u.ac.jp wrote:

Thanks Erik.

However I don't know how to truss running process.

Kenji Arisawa



for example:

; cat > truss.c
#include 
#include 

void
main(void)
{
for(;;)
sleep(10*1000);
}
; 8c -FVTw truss.c && 8l -o truss truss.8
; truss&
; acid -l/sys/lib/acid/truss $apid
/proc/116801/text:386 plan 9 executable
/sys/lib/acid/port
/sys/lib/acid/386
/sys/lib/acid/truss
acid: truss()
sleep(1)
return value: 0

- erik






Re: [9fans] validateaddress

2009-08-10 Thread Kenji Arisawa

Thanks Erik.

However I don't know how to truss running process.

Kenji Arisawa

On 2009/08/11, at 2:13, erik quanstrom wrote:


would be interesting to see *(0x16548\s).  have you tried truss(1)ing
that process?

- erik






[9fans] validateaddress

2009-08-09 Thread Kenji Arisawa

something wrong

web  8365680:01   1:55 1536K Open httpd
web  8365700:56   0:00  272K Preadfactotum
none1236297 47181:19   0:00  172K Running  validateaddress
web 13535600:00   0:00   40K Preadread


ar% ACID 1236297
/proc/1236297/text:386 plan 9 executable
/sys/lib/acid/port
/sys/lib/acid/386
acid: lstk()
klook(name=0x16548)+0x55 /sys/src/cmd/rc/var.c:52
t=0x1bed0
p=0x196b0
yylex()+0x1a0 /sys/src/cmd/rc/lex.c:372
w=0x1654e
d=0x1eb1
c=0x29
t=0x1c190
yylex1()+0x8 /sys/src/cmd/rc/syn.y:224
yyparse()+0xa7e /sys/src/cmd/rc/syn.y:316
save1=0x0
save2=0x1b910
save3=0x0
save4=0x0
yystate=0x18
yychar=0x
yys=0x0
yyp=0xdfffdf0c
yyn=0x11e
yypt=0x0
Xrdcmds()+0x75 /sys/src/cmd/rc/exec.c:899
p=0x1b9b0
main(argc=0x3,argv=0xdfffef74)+0x327 /sys/src/cmd/rc/exec.c:184
rcmain=0x144c4
num=0x36333231
bootstrap=0x2
i=0x1
_main+0x31 /sys/src/libc/386/main9.s:16
acid: lstk()
strcmp(s1=0x15274,s2=0x16548)+0x11 /sys/src/libc/port/strcmp.c:11
klook(name=0x16548)+0x55 /sys/src/cmd/rc/var.c:52
t=0x1bed0
p=0x196b0
yylex()+0x1a0 /sys/src/cmd/rc/lex.c:372
w=0x1654e
d=0x1eb1
c=0x29
t=0x1c190
yylex1()+0x8 /sys/src/cmd/rc/syn.y:224
yyparse()+0xa7e /sys/src/cmd/rc/syn.y:316
save1=0x0
save2=0x1b910
save3=0x0
save4=0x0
yystate=0x18
yychar=0x
yys=0x0
yyp=0xdfffdf0c
yyn=0x11e
yypt=0x0
Xrdcmds()+0x75 /sys/src/cmd/rc/exec.c:899
p=0x1b9b0
main(argc=0x3,argv=0xdfffef74)+0x327 /sys/src/cmd/rc/exec.c:184
rcmain=0x144c4
num=0x36333231
bootstrap=0x2
i=0x1
_main+0x31 /sys/src/libc/386/main9.s:16
acid:


Kenji Arisawa




Re: [9fans] faster vesa driver

2009-06-15 Thread Kenji Arisawa

Hello Geoff,

I am glad if mtrr makes effect only to single processor
until the mtrr can support multi-core processor.

Kenji Arisawa

On 2009/06/10, at 6:18, ge...@plan9.bell-labs.com wrote:


I've just pushed out kernel sources and binaries to incorporate
Aki's mtrr and vesa changes.  The combination makes monitor=vesa
run quite a bit faster; we saw a factor of three speed improvement
in one case.

It's still limited to a single processor, but we've got someone
investigating ways to fix that.






Re: [9fans] faster vesa driver

2009-06-09 Thread Kenji Arisawa

Thanks Geoff,

That made great effect to my VIA LN1EG!

Kenji Arisawa

On 2009/06/10, at 6:18, ge...@plan9.bell-labs.com wrote:


I've just pushed out kernel sources and binaries to incorporate
Aki's mtrr and vesa changes.  The combination makes monitor=vesa
run quite a bit faster; we saw a factor of three speed improvement
in one case.

It's still limited to a single processor, but we've got someone
investigating ways to fix that.






Re: [9fans] Realtek 8111C

2009-03-12 Thread Kenji Arisawa

Hello,

I tried 8111C on GIGABYTE GA-G31M-S2L,
but the controller did not work for me.
I don't know if recent driver works.
Additional information welcome.

Kenji Arisawa

On 2009/03/13, at 5:27, Tharaneedharan Vilwanathan wrote:


hi erik,

thanks for the quick response.

regards
dharani

On Thu, Mar 12, 2009 at 1:17 PM, erik quanstrom  
 wrote:

works fine for me, even with jumbo packets:

5.0.0:  net  02.00.00 10ec/8168  10 0:d801 256 2:feaff004 4096  
3: 16
   Realtek Semiconductor RTL8168/8111 Gigabit Ethernet NIC(NDIS  
6.0)


i'm too lazy to check if it's exactly a 8111c, but i've never
had trouble with realtek 8169-style controllers.

- erik









Re: [9fans] ping suicide: sys: trap: divide error pc=0x00003953c

2009-03-09 Thread Kenji Arisawa

Hello,

ip/ping -r -f www.google.com
io% ip/ping -r -f www.google.com
sending 32 64 byte messages 0 ms apart to icmp!www.google.com!1
ping 34691: suicide: sys: trap: divide error pc=0x3953
0: rtt 9797 µs, avg rtt 9797 µs, ttl = 245
io% ps
...
arisawa   346790:00   0:00  128K Preadtcp17010
arisawa   346910:00   0:00  140K Broken   ping
arisawa   346950:00   0:00  140K Preadping
arisawa   346960:00   0:00  192K Preadps
io% acid 34691
/proc/34691/text:386 plan 9 executable

/sys/lib/acid/port
/sys/lib/acid/386
acid: lstk()
nrand(n=0x0)+0x18 /sys/src/libc/port/nrand.c:13
slop=0xa39fb2cf
sender(msglen=0x40,n=0x20,interval=0x0,fd=0x6)+0x151 /sys/src/cmd/ip/ 
ping.c:268

seq=0xef0c4ef8
buf=0x0
icmp=0xdffeed0e
me=0x0
mev4=0x501a8c0
i=0x1
r=0x22b78
main(argv=0xdfffefa0,argc=0x1)+0x212 /sys/src/cmd/ip/ping.c:571
interval=0x0
msglen=0x40
nmsg=0x20
_argc=0x66
_args=0xdfffefb8
ds=0x11534
fd=0x6
_main+0x31 /sys/src/libc/386/main9.s:16
acid: 
echo kill > /proc/34691/ctl
io% cat /sys/src/libc/port/nrand.c
#include
#include

#define MASK0x7fffL

int
nrand(int n)
{
long slop, v;

if(n < 0)
return n;
slop = MASK % n;
do
v = lrand();
while(v <= slop);
return v % n;
}


Think that where and why nrand(0) is executed and fix the problem.

Kenji Arisawa


On 2009/03/09, at 18:38, ROuNIN wrote:


Hello all,
I would like to learn how to fix this in the ping C code, I am new to
plan9 and C

ip/ping -r -f www.google.com
sending 32 64 bytes messages 0 ms apart  to icmp!www.google.com!1
ping 238: suicide: sys: trap: divide error  pc=0x3953
term% 0: rrt 38841 us, avg rtt 38841 us, ttl = 128

ROuNIN






[9fans] proxy server

2009-02-20 Thread Kenji Arisawa

Hello,

I have written HTTP proxy server that runs on Plan 9 and is written in  
Lua.

Look http://plan9.aichi-u.ac.jp/netlib/lua/

I developed "proxy.lua" to inspect live HTTP communication
therefore the server does nothing but transfer.
However  I believe adding other functionalities is not so difficult.

Kenji Arisawa




[9fans] tlssrv and tlsclient

2009-02-20 Thread Kenji Arisawa

Hello,

I am hung up! Please any one help me.

io% aux/listen1 'tcp!*!8010' /bin/tlssrv -c/sys/tls/cert /bin/aux/ 
trampoline 'tcp!io!7'


term% tlsclient tcp!io!8010
tlsclient: tlsclient: devtls expected ver=301, saw (len=28207) type=2f  
ver=6269 '/bin/�H��!'

term%

tlssrv and tlsclient fails in negotiation at version confirmation.
what's wrong?
- certificate "/sys/tls/cert" is working for Pegasus.
- tcp!io!7 is working.
- tlsclient can communicate with Pegasus in https protocol.
- tlssrv and tlsclient are the most recent ones:
term% ls -l /bin/tlssrv /bin/tlsclient
--rwxrwxr-x M 9 sys sys 199254 May 10  2008 /bin/tlsclient
--rwxrwxr-x M 9 sys sys 199634 Jun 27  2008 /bin/tlssrv
term%

Kenji Arisawa




Re: [9fans] Pegasus 2.6 is released

2009-01-31 Thread Kenji Arisawa

Sorry,

http://plan9.aichi-u.ac.jp/pegasus/eman-2.6/

Kenji Arisawa

On 2009/02/01, at 13:41, lu...@proxima.alt.za wrote:


Pegasus 2.6 is released with new WebDAV script written in Lua.
Take a look at http://plan9/remoty/pegasus/eman-2.6/ for more  
details.


We need a little bit more than "plan9" in the host name :-)

++L





Re: [9fans] Pegasus 2.6 is released

2009-01-31 Thread Kenji Arisawa

Sorry,

http://plan9.aichi-u.ac.jp/pegasus/eman-2.6/

Kenji Arisawa

On 2009/02/01, at 13:41, lu...@proxima.alt.za wrote:


Pegasus 2.6 is released with new WebDAV script written in Lua.
Take a look at http://plan9/remoty/pegasus/eman-2.6/ for more  
details.


We need a little bit more than "plan9" in the host name :-)

++L







[9fans] Pegasus 2.6 is released

2009-01-31 Thread Kenji Arisawa

Hello,

Pegasus 2.6 is released with new WebDAV script written in Lua.
Take a look at http://plan9/remoty/pegasus/eman-2.6/ for more details.

Enjoy

Kenji Arisawa




Re: [9fans] Sources Gone?

2009-01-27 Thread Kenji Arisawa

Hello,

Several years ago I abandoned replica and switched to my own tool  
"upadate",
but I hesitated to make it public because replica is so fundamental  
tools

for Plan 9.
The major problem is(was?) replica doesn't properly arrange update  
data-base

before it begins to retrieve files. The laxness makes replica very slow.

If replica is to be improved I hope replica looks owner/group  
information of files
in updating. If these information is different from official one, then  
the file should be

regarded as having modified by users.

Kenji Arisawa

On 2009/01/28, at 8:32, Russ Cox wrote:


But people keep telling me that replica's unreliability, painful
slowness, and general clunkyness,  are all in my imagination, so what
do I know...


No, what we've told you, repeatedly, is that
whining about problems and fixing them are
two different things.  Fixes are appreciated.

Russ






Re: [9fans] dealing with spam

2009-01-08 Thread Kenji Arisawa

Hello,

I am using this one: http://plan9.aichi-u.ac.jp/spamfilter/
which is working quite comfortably for me.

Kenji Arisawa

On 2009/01/09, at 5:49, erik quanstrom wrote:


I am using the standard smtpd with -D and the greylisting,
and also a modified validateserder which probably qualifies as an
earlier incarnation of erik's (he sent me the code before nupas
was finished and I hacked it a bit).


/n/sources/contrib/quanstro/src/nupas/bits/validatesender

- erik






Re: [9fans] (no subject)

2008-11-21 Thread Kenji Arisawa

Hello,

If such an attack continues for some minutes and the server does not  
reject the connections
the server will create thousands of smtpd processes and might be hung  
up.


Kenji Arisawa

On 2008/11/22, at 3:28, erik quanstrom wrote:


Subjet: email attacks

since our friends in sweeden helped out our spammer friends
get back on line, i've seen a lot more attacks.  today i've been
getting ~10 connections/sec.  fortunately its from a small
number of machines, so this trick helps alot:

/n/dump/2008/1121/sys/src/cmd/upas/smtp/smtpd.c:348,353 - smtpd.c: 
348,355

if(!qflag)
syslog(0, "smtpd", "Hung up on %s; "
"claimed to be %s", nci->rsys, 
him);
+   if(Dflag)
+   sleep(delaysecs()*1000);
reply("554 5.7.0 Liar!\r\n");
exits("client pretended to be us");
return;

oddly, i've found that adding a few of the hosts as -k flags stops  
the attack

entirely.

- erik







Re: [9fans] broken smtpd

2008-11-18 Thread Kenji Arisawa

Hello,

I added some debugging codes to catchalarm() in smtpd.c

static int
catchalarm(void *a, char *msg)
{
int rv = 1;
static int count = 0; // DEBUG by Kenar
count++;
if(count > 3)
return 0;

USED(a);

/* log alarms but continue */
if(strstr(msg, "alarm")){
if(senders.first && rcvers.first)
syslog(0, "smtpd", "note: %s->%s: %s",
s_to_c(senders.first->p),
s_to_c(rcvers.first->p), msg);
else
syslog(0, "smtpd", "note: %s", msg);
rv = 0;
}

syslog(0, "smtpd", "note: %s", msg); // DEBUG by Kenar

/* kill the children if there are any */
if(pp)
syskillpg(pp->pid);

return rv;
}

after that I found broken smtpd:
none  503920:00   0:00  264K Broken   smtpd

note that wasted cpu time is now 0:00

/sys/log/smtpd shows:
ar Nov 19 02:23:05 ehlo from 124.8.67.36 as sotcndhz.com
ar Nov 19 02:23:08 note: sys: trap: fault read addr=0x4 pc=0x7463
ar Nov 19 02:23:08 note: sys: trap: fault read addr=0x4 pc=0x7463
ar Nov 19 02:23:08 note: sys: trap: fault read addr=0x4 pc=0x7463

Kenji Arisawa

On 2008/11/17, at 21:51, erik quanstrom wrote:

d'oh!  the return value from catchalarm looks reversed.  from  
notify(2)


 [...] A handler must
 return a non-zero number if the note was recognized (and
 resolved); otherwise it must return zero.  When the system

i think you're getting into some sort of note loop.  i think it would
be helpful to log all notes.  i would try something like this

static int
catchalarm(void *, char *msg)
{
static int chattycathy;

if(chattycathy++ > 5)
return 0;
if(senders.first && rcvers.first)
syslog(0, "smtpd", "note: %s->%s: %s",
s_to_c(senders.first->p),
s_to_c(rcvers.first->p), msg);
else
syslog(0, "smtpd", "note: %s", msg);
if(pp){
syskillpg(pp->pid);
pp = 0;
}
return strstr(msg, "alarm") != 0;
}

but at a minimum, i would reverse the return values.

- erik






Re: [9fans] broken smtpd

2008-11-17 Thread Kenji Arisawa

Hello,

Today, I observed smtpd that was in endless loop and then broken.



ar% ps
...
none  203920:01  28:27  264K Running  smtpd
...



ar% ACID 20392
/proc/20392/text:386 plan 9 executable
/sys/lib/acid/port
/sys/lib/acid/386
acid: lstk()
receiver(path=0x41f58)+0x1c5 /sys/src/cmd/upas/smtp/smtpd.c:625
sender=0x379bf
rcpt=0x41ad8
zzparse()+0x2c9 /sys/src/cmd/upas/smtp/smtpd.y:773
save1=0x0
save2=0x0
save3=0x0
save4=0x0
zzstate=0xf
zzchar=0x
zzs=0x3f36b
zzp=0xdfffe41c
zzn=0xfc18
main(argv=0xdfffefa4,argc=0x0)+0x261 /sys/src/cmd/upas/smtp/smtpd.c:194
netdir=0xdfffefbc
_argc=0x6e
_args=0x376c2
buf=0x0
_main+0x31 /sys/src/libc/386/main9.s:16
acid: src(receiver+0x1c5)
/sys/src/cmd/upas/smtp/smtpd.c:625
 620
 621logged = 0;
 622
 623/* forwarding() can modify 'path' on loopback request */
 624		if(filterstate == ACCEPT && fflag && !authenticated &&  
forwarding(path)) {

>625 syslog(0, "smtpd", "Bad Forward %s (%s/%s) (%s)",
 626s_to_c(senders.last->p), him, nci->rsys, 
s_to_c(path));
 627rejectcount++;
 628reply("550 5.7.1 we don't relay.  send to [EMAIL PROTECTED] 
for "
 629"loopback.\r\n");
 630return;


I don't observe "Bad Forward" of this mail in /sys/log/smtpd.

After some amount of time,

ar% ps
...
none  203920:02  44:57  264K Broken   smtpd
...

acid: lstk()
errstr()+0x7 /sys/src/libc/9syscall/errstr.s:5
syslog(logname=0x3760a,cons=0x0,fmt=0x37610)+0x20 /sys/src/libc/9sys/ 
syslog.c:46

err=0x616d2f27
d=0x0
ctim=0x0
buf=0x0
p=0x0
arg=0x0
n=0x0
catchalarm(msg=0xdfffe1ac)+0x5d /sys/src/cmd/upas/smtp/smtpd.c:68
rv=0x1
notifier+0x30 /sys/src/libc/port/atnotify.c:15
acid: src(syslog+0x29)
/sys/src/libc/9sys/syslog.c:46
 41 Dir *d;
 42 char err[ERRMAX];
 43 
 44 err[0] = '\0';
 45 errstr(err, sizeof err);
>46  lock(&sl);
 47 
 48 /*
 49  *  paranoia makes us stat to make sure a fork+close
 50  *  hasn't broken our fd's
 51  */
acid:


I hope the above information is helpful to fix the problem.

Kenji Arisawa


On 2008/11/06, at 21:59, erik quanstrom wrote:


Is this phenomenon specific to me?


No, it isn't:

term% ps|grep Broken
none9172:08  42:50  264K Broken   smtpd


impressive!

i don't see this problem, but i have implemented
some fairly agressive spam control.  perhaps this
shows up after i tend to hang up.

(it is possible to use nupas smtpd with regular old
upas.)

would anyone mind sending me a full backtrace?

- erik






[9fans] broken smtpd

2008-11-05 Thread Kenji Arisawa

Hello,

I sometimes observe broken smtpd.

ar% ps
...
none19485780:01  44:55  264K Broken   smtpd
none25211720:01  44:58  264K Broken   smtpd
none31900370:01  45:03  264K Broken   smtpd
...

ar% ACID 3190037
/proc/3190037/text:386 plan 9  executable
/sys/lib/acid/port
/sys/lib/acid/386
acid: lstk()
errstr()+0x7 /sys/src/libc/9syscall/errstr.s:5
syslog(logname=0x3760a,cons=0x0,fmt=0x37610)+0x20 /sys/src/libc/9sys/ 
syslog.c:46

err=0x616d2f27
d=0x0
ctim=0x0
buf=0x0
p=0x0
arg=0x0
n=0x0
catchalarm(msg=0xdfffe1ac)+0x5d /sys/src/cmd/upas/smtp/smtpd.c:68
rv=0x1
notifier+0x30 /sys/src/libc/port/atnotify.c:15
acid:


ar% pr -tn /sys/src/libc/9sys/syslog.c
...
   34   void
   35   syslog(int cons, char *logname, char *fmt, ...)
   36   {
   37   char buf[1024];
   38   char *ctim, *p;
   39   va_list arg;
   40   int n;
   41   Dir *d;
   42   char err[ERRMAX];
   43   
   44   err[0] = '\0';
   45   errstr(err, sizeof err);
   46   lock(&sl);
   47   
...


Is this phenomenon specific to me?

Kenji Arisawa





Re: [9fans] test command

2008-09-11 Thread Kenji Arisawa

Hello,

On 2008/09/11, at 11:38, Russ Cox wrote:


there are certainly better ways to do this, but this works:


as does /bin/mtime.


I didn't know this command.

thanks russ and erik.

Kenji Arisawa




Re: [9fans] test command

2008-09-10 Thread Kenji Arisawa

Hello,

On 2008/09/11, at 1:15, Gorka Guardiola wrote:

yes, but !older is the same as younger or equal.


yes.


But then there is = and != for strings (for example), so this argument
is thin :-).


if we can easily get modified time of a file in the format of UNIX time,
where "easily" means "in the set of plan 9 commands".

Kenji Arisawa




[9fans] test command

2008-09-10 Thread Kenji Arisawa

Hello,

"test" command of plan 9 has a operator "older", the usage is:
test f -older t
where f is a file and t is a time.
however the command does not have "newer" operator.
why?

Kenji Arisawa




[9fans] dns failure in smtp

2008-08-24 Thread Kenji Arisawa

Sorry for noise.

Someone in this list send me a mail but I cannot reply to the mail  
because of dns failure in smtp.

This is a private message to him.

ar% pwd
/sys/log
ar% tail smtp.fail
ar Aug 24 08:30:13 dns: dns failure (net!sounine.nanosouffle.net)
ar Aug 24 09:40:13 dns: dns failure (net!sounine.nanosouffle.net)
ar Aug 24 10:50:13 dns: dns failure (net!sounine.nanosouffle.net)
ar Aug 24 12:00:13 dns: dns failure (net!sounine.nanosouffle.net)
ar Aug 24 13:10:14 dns: dns failure (net!sounine.nanosouffle.net)
ar Aug 24 14:20:13 dns: dns failure (net!sounine.nanosouffle.net)
ar Aug 24 15:30:13 dns: dns failure (net!sounine.nanosouffle.net)
ar Aug 24 16:40:13 dns: dns failure (net!sounine.nanosouffle.net)
ar Aug 24 17:50:13 dns: dns failure (net!sounine.nanosouffle.net)
ar Aug 24 19:16:08 dns: dns failure (net!sounine.nanosouffle.net)
ar% ndb/dnsquery
> sounine.nanosouffle.net mx
!dns: resource does not exist
> sounine.nanosouffle.net
sounine.nanosouffle.net ip  75.58.233.41
>


I think mx record is required in official dns server, although I feel  
the condition is too strict.


/sys/src/cmd/upas/smtp/mxdial.c

nmx = 0;
snprint(buf, sizeof buf, "%s mx", ds->host);
if(debug)
fprint(2, "sending %s '%s'\n", dnsname, buf);
/*
 * don't hang indefinitely in the write to /net/dns.
 */
n = timedwrite(fd, buf, strlen(buf), 60*1000);
if(n < 0){
rerrstr(buf, sizeof buf);
if(debug)
fprint(2, "dns: %s\n", buf);
if(strstr(buf, "dns failure")){
/* if dns fails for the mx lookup, we have to stop */
close(fd);
        return -1;
}
} else {


Kenji Arisawa
Email: [EMAIL PROTECTED]





Re: [9fans] sshserve.c

2008-04-15 Thread Kenji Arisawa

Thanks Pietro,

I am glad if someone can help me.
Using MacFUSE + sshfs, I have:
-bash$ sshfs ar.aichi-u.ac.jp: /n/ar
remote host has disconnected
-bash$
Then /sys/log/ssh says:
ar Apr 16 07:53:15 [359853] connect from 124.241.154.73!53142
/bin/aux/sshserve: reading server version: unexpected EOF

The host ar is a Plan 9 cpu server servicing tcp22 as
exec /bin/aux/sshserve -A 'password' `{cat $3/remote} >>[2]/ 
sys/log/ssh


Of course I can connect to ar using
ssh ar.aichi-u.ac.jp

Kenji Arisawa

On 2008/04/16, at 7:29, Pietro Gagliardi wrote:
Yup. usage() is calling itself with no termination condition - and  
what's more, it is tail recursing. It should be


void
usage(void)
{
		fprint(2, "usage: sshserve [-A authlist] [-c cipherlist] client- 
ip-address\n");

exits("usage");
}

to keep with the Plan 9 program. Enjoy!

When this QEMU-on-Leopard-freezes-randomly bug gets fixed, I can  
fix it and any other dangers.






[9fans] sshserve.c

2008-04-15 Thread Kenji Arisawa

Hello,

In sshserve.c:

void
usage(void)
{
	fprint(2, "usage: sshserve [-A authlist] [-c cipherlist] client-ip- 
address\n");

usage();
}

This code can make endless loop. Right?

Kenji Arisawa