天泣記

2005-12-01 (Thu)

#1

「喫緊」という単語を知る。

こういう、一部においてのみ良く使われる単語というのはたまにある。でも、辞書にも載っていて隠語というほどではない。また、専門的な意味はなくて専門用語でもない。方言が近いかも知れないが、地域とは関係ないのでぴったりとしない。

こういう単語を指すぴったりな名前はあるか?

#2
% google-count 深追{い,わない,います,う,えば,え}
116000  深追い
0       深追わない
0       深追います
3       深追う
0       深追えば
0       深追え

2005-12-02 (Fri)

#1 PWB のソース [CODE blog]
#2 って、どこにあるんでしょうね? [CODE blog]

2005-12-03 (Sat)

#1

12-08 まで出張

2005-12-05 (Mon)

#1

夏である

南半球は

2005-12-09 (Fri)

#1

オーストラリアには夏時間を採用している州と採用していない州がある。だから、冬は全国で時差が一致するが、夏は時差が 2つある

同様に、北海道だけで採用、とかいうのも考えられるだろうか

#2

Haskell の STM を調べる。

ふむ。transaction なのか。

2005-12-12 (Mon)

#1

graphviz に dot, neato 以外に twopi, circo, fdp があることに気が付く

試してみると、(neato もそうだが) エッジがノードを避けてくれない

2005-12-13 (Tue)

#1

そういえば、always GC という考えは [ruby-talk:123759] に書いた事を思い出した。

2005-12-14 (Wed)

#1
% google-count 健康診断は体に悪い 
51      健康診断は体に悪い

2005-12-16 (Fri)

#1

世の中には USB連動電源タップなるものがある事を知る。

#2 daemon をよびだしているもの [CODE blog]

gonzui で、funcall:daemon を探すと、scim, xfs, xdm が見付かる。ふむ。

2005-12-17 (Sat)

#1

いろいろと試していて、test/xmlrpc が segv したので調べてみたら、yaml を使っているだけだった

2005-12-18 (Sun)

#1

chkbuild の sample/build-gcc-ruby で ruby を -O2 だけでなく -O3 でも作るようにしてみる

これで gcc-{4.0,4.1,4.2} * ruby-{1.8,1.9} * {-O2,-O3} という 12種類を作る事になる

とりあえず、いくつかのアーキテクチャで試してみたが、test-all で試す範囲では -O2 から -O3 で問題が増えるという事はないようだ

#2

gcc で -O2 から -O3 にすると警告が増えることがあることを知る

inline して初めて警告に値するかどうか分かるということか

% cat t.c
int v, w;

int f(int *p)
{
  if (v)
    *p = 0;
  return w;
}

int g()
{
  int x;
  if (f(&x))
    return x;
  return 0;
}
% gcc -O2 -Wall -c t.c
% gcc -O3 -Wall -c t.c
t.c: In function 'g':
t.c:12: warning: 'x' may be used uninitialized in this function
% gcc -v
Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v --enable-languages=c,c++,java,f95,objc,ada,treelang --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --program-suffix=-4.0 --enable-__cxa_atexit --enable-libstdcxx-allocator=mt --enable-clocale=gnu --enable-libstdcxx-debug --enable-java-gc=boehm --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-4.0-1.4.2.0/jre --enable-mpfr --disable-werror --enable-checking=release i486-linux-gnu
Thread model: posix
gcc version 4.0.2 (Debian 4.0.2-2)

他の関数に渡したポインタが書き込まれない可能性は警告する程ではないというわけだ。

2005-12-20 (Tue)

#1

--enable-pthread の有無も加えて (掛けて?) 24種類

#2

しかし、遅いせいで timeout してしまうと本来動くはずのテストをテストできていないか。

#3

#344146 - grep dumps core on LANG=ja_JP.EUC-JP - Debian Bug report logs

#4 popen [CODE blog]

popen の定義を gonzui で探してみると、glibc が出てこない。

2005-12-21 (Wed)

#1

<URL:http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=344246>

"#! /usr/bin/env ruby" というのは開発段階ではいいのだが、インストール時には対象の環境に応じて固定して欲しいものだ

#2 popen の定義 [CODE blog]

https://www.codeblog.org/gonzui/markup/glibc-2.3.6/libio/iopopen.c?q=package:glibc-2.3.6%20popen&fm=c#l312

versioned_symbol (libc, __new_popen, popen, GLIBC_2_1);

というのが定義だろうか

2005-12-22 (Thu)

#1 __new_popen [CODE blog]

で、__new_popen はそのすぐまえで _IO_new_popen となっているのか。

strong_alias (_IO_new_popen, __new_popen)

https://www.codeblog.org/gonzui/markup/glibc-2.3.6/libio/iopopen.c#l310

#2 _IO_new_proc_open [CODE blog]

たどると _IO_new_proc_open にいく。 mode は r と w しか許さないらしい。双方向通信はないようだ。

https://www.codeblog.org/gonzui/markup/glibc-2.3.6/libio/iopopen.c?q=fundef:_IO_new_proc_open#l123

#3 QuickML で誰でも投稿できるメーリングリスト [CODE blog]

http://namazu.org/~satoru/quickml/index.html.ja によれば誰でも投稿できるメーリングリストは ,forward というのが重要らしい

でも、これって外から設定できるのかな?

#4 case sensitive と case insensitive のミスマッチ [CODE blog]

mail address の local-part の解釈は RFC2822では domain 依存である。そして、典型的な MTA では case insensitive である。

さて、UNIX のユーザ名は case sensitive である。

では、abc というユーザと ABC というユーザの両方がいたら、メールはどう届くか?

(Debian の exim4 で) 試してみると、abc@domain 宛も ABC@domain 宛も両方 /var/mail/abc に届いた。

次に、ABCD というユーザだけがいたらどうなるか試すと、RCPT TO: の段階で 550 unknown user になった。

#5 tDiary の (Wikiスタイルの) ソースの例 [CODE blog]

は、2005-11-22 に移した。

2005-12-23 (Fri)

#1

HP-UX には #pragma ASYNCH_RETURN というのがあるらしい

td176> find . -type f -print|xargs grep ASYNCH_RETURN /dev/null
./sys/ucontext.h:#  pragma ASYNCH_RETURN getcontext
./ia64/sys/setjmp.h:#pragma ASYNCH_RETURN setjmp
./setjmp.h:#  pragma ASYNCH_RETURN setjmp
./setjmp.h:#    pragma ASYNCH_RETURN _setjmp
./setjmp.h:#    pragma ASYNCH_RETURN sigsetjmp
td176> uname -a
HP-UX td176 B.11.23 U ia64 0391833941 unlimited-user license

使われている関数からして、きっと SunOS の #pragma unknown_control_flow や gcc の returns_twice attribute のようなものであろう。

#2

うぅむ。grep じゃなくて libc6 であったか。

外から見て区別できる可能性はあっただろうか?

2005-12-25 (Sun)

#1

ASYNCH_RETURN は効いていない?

2005-12-27 (Tue)

#1 test [CODE blog]

jpg-alt

20051227_0.jpg

png-alt

20051227_1.png

#2 tDiary のセキュアモードな image.rb で png [CODE blog]

codeblog で png を扱いたいという要望が出たので調べてみると、 image.rb はセキュアモードでは jpeg only で、いろいろとハードコードされていることがわかる。

png を扱いたいという要望自体は、スクリーンショットに適切という非常に妥当な目的で納得できるものがあることもあり、手を入れてみるとなんとか動いている感じである。

misc/plugin/image.rb 2005-07-20 17:25:02.000000000 +0900
+++ /usr/share/tdiary/misc/plugin/image.rb    2005-12-27 18:50:00.000000000 +0900
@@ -78,13 +78,8 @@
 end

 def image( id, alt = 'image', thumbnail = nil, size = nil, place = 'photo' )
-     if @conf.secure then
-             image = "#{@image_date}_#{id}.jpg"
-             image_t = "#{@image_date}_#{thumbnail}.jpg" if thumbnail
-     else
        image = image_list( @image_date )[id.to_i]
        image_t = image_list( @image_date )[thumbnail.to_i] if thumbnail
-     end
        if size then
                if size.kind_of?(Array)
                        size = " width=\"#{size[0]}\" height=\"#{size[1]}\""
@@ -111,11 +106,7 @@
 end

 def image_link( id, desc )
-     if @conf.secure then
-             image = "#{@image_date}_#{id}.jpg"
-     else
        image = image_list( @image_date )[id.to_i]
-     end
    %Q[<a href="#{@image_url}/#{image}">#{desc}</a>]
 end

@@ -178,15 +169,10 @@
 end

 def image_ext
-     if @conf.secure then
-             'jpg'
-     else
-             'jpg|jpeg|gif|png'
-     end
+     return 'jpg|jpeg|gif|png'
 end

-def image_list( date )
-     return @image_list if @conf.secure and @image_list
+def image_list_file( date )
        list = []
        reg = /#{date}_(\d+)\.(#{image_ext})$/
        Dir::foreach( @image_dir ) do |file|
@@ -195,8 +181,15 @@
        list
 end

-if @conf.secure and /^(form|edit|formplugin|showcomment)$/ =~ @mode then
-     @image_list = image_list( @date.strftime( '%Y%m%d' ) )
+def image_list( date )
+     return @image_list if @conf.secure and @image_list
+     return @image_list_proc.call if @conf.secure and @image_list_proc
+        image_list_file(date)
+end
+
+if @conf.secure
+     datetime = @date.strftime( '%Y%m%d' )
+     @image_list_proc = lambda { @image_list = image_list_file(datetime) }
 end

 if /^formplugin$/ =~ @mode then
@@ -292,7 +285,7 @@
           images.each_with_index do |img,id|
                        next unless img
                        if @conf.secure then
-                             img_type, img_w, img_h = 'jpg', nil, nil
+                             img_type, img_w, img_h = nil, nil, nil
                        else
                                img_type, img_w, img_h = open(File.join(@image_dir,img).untaint, 'r') {|f| image_info(f)}
                        end
@@ -331,7 +324,6 @@
                r << %Q[<p class="message">#{@image_message}</p>]
        end
    r << %Q[<form class="update" method="post" enctype="multipart/form-data" action="#{@conf.update}"><div>
-     #{@conf.secure ? image_label_only_jpeg : ''}
        #{csrf_protection}
    <input type="hidden" name="plugin_image_addimage" value="true">
    <input type="hidden" name="date" value="#{date.strftime( '%Y%m%d' )}">

2005-12-28 (Wed)

#1

<URL:http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=344930>

gdb が吐いた core を gdb で調べて backtrace をとることにどの程度意味があるか?

#2

<URL:http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=344988>

"#!/usr/bin/env" が問題になったときには報告する事にした。

#3 ntp [CODE blog]

サーバの時刻がずれているので ntp を入れた。

このサーバは、インストール当初は激しく時刻が進むという Athlon64 での Linux kernel の問題があって、kernel の upgrade で(g新部さんが)対処したのだが、その対処の調査としてサーバの時刻を外部から継続的に計測している。 (ntp で時計をあわせてあるマシンから HTTP で HEAD リクエストを発行し、その結果の Date フィールドとローカルな時刻を記録している)

修正前

20051228_0.png

修正後

20051228_1.png

最初の画像が修正前で、後のが修正後である。横軸が日数、縦軸がサーバにおける時刻のずれ (サーバの時刻と観測するマシンの時刻の差) である。修正前は加速度的に時刻が進んだり、急に進みかたが変化するなどの怪しげな挙動がみてとれる。それに対し、修正後は一定の速度で時刻が進んでいる。(ずれが0になるところがいくつかあるが、最後のは ntp のインストールのためで、それ以前のはリブートのためである) また、縦軸のスケールは修正後のほうがとても小さく済んでいる。

おそらく修正後における進みは時計の不正確さであって、ntp の領分であるが、修正前の進みは ntp では対処不能だったのではないかと思う。

#4 tDiary のセキュアモードな image.rb で png (2) [CODE blog]

昨日の修正では甘かったのでさらに修正する。

その過程でわかったこと:

・ もともと jpg だけをサポートしていたのは外部にアクセスせずにURLを生成できるようにするためだったのかもしれない (日記の記述内には拡張子の情報がない)
・ plugin が定義されるときは $SAFE=0

--- misc/plugin/image.rb      2005-07-20 17:25:02.000000000 +0900
+++ /usr/share/tdiary/misc/plugin/image.rb    2005-12-28 11:19:51.000000000 +0900
@@ -78,13 +78,8 @@
 end

 def image( id, alt = 'image', thumbnail = nil, size = nil, place = 'photo' )
-     if @conf.secure then
-             image = "#{@image_date}_#{id}.jpg"
-             image_t = "#{@image_date}_#{thumbnail}.jpg" if thumbnail
-     else
        image = image_list( @image_date )[id.to_i]
        image_t = image_list( @image_date )[thumbnail.to_i] if thumbnail
-     end
        if size then
                if size.kind_of?(Array)
                        size = " width=\"#{size[0]}\" height=\"#{size[1]}\""
@@ -111,11 +106,7 @@
 end

 def image_link( id, desc )
-     if @conf.secure then
-             image = "#{@image_date}_#{id}.jpg"
-     else
        image = image_list( @image_date )[id.to_i]
-     end
    %Q[<a href="#{@image_url}/#{image}">#{desc}</a>]
 end

@@ -178,15 +169,10 @@
 end

 def image_ext
-     if @conf.secure then
-             'jpg'
-     else
-             'jpg|jpeg|gif|png'
-     end
+     return 'jpg|jpeg|gif|png'
 end

-def image_list( date )
-     return @image_list if @conf.secure and @image_list
+def image_list_file( date )
        list = []
        reg = /#{date}_(\d+)\.(#{image_ext})$/
        Dir::foreach( @image_dir ) do |file|
@@ -195,8 +181,16 @@
        list
 end

-if @conf.secure and /^(form|edit|formplugin|showcomment)$/ =~ @mode then
-     @image_list = image_list( @date.strftime( '%Y%m%d' ) )
+def image_list( date )
+     return @image_list_proc.call(date) if @conf.secure and @image_list_proc
+        image_list_file(date)
+end
+
+if @conf.secure
+     @image_list_proc = lambda {|d|
+           date = String.new($&).untaint if /\A\d{8,}\z/ =~ d
+           image_list_file(date)
+        }
 end

 if /^formplugin$/ =~ @mode then
@@ -292,7 +286,7 @@
           images.each_with_index do |img,id|
                        next unless img
                        if @conf.secure then
-                             img_type, img_w, img_h = 'jpg', nil, nil
+                             img_type, img_w, img_h = nil, nil, nil
                        else
                                img_type, img_w, img_h = open(File.join(@image_dir,img).untaint, 'r') {|f| image_info(f)}
                        end
@@ -331,7 +325,6 @@
                r << %Q[<p class="message">#{@image_message}</p>]
        end
    r << %Q[<form class="update" method="post" enctype="multipart/form-data" action="#{@conf.update}"><div>
-     #{@conf.secure ? image_label_only_jpeg : ''}
        #{csrf_protection}
    <input type="hidden" name="plugin_image_addimage" value="true">
    <input type="hidden" name="date" value="#{date.strftime( '%Y%m%d' )}">
#5 tDiary の graphviz plugin [CODE blog]

試してみるが、難しい

・ セキュアでは動かない
・ Wikiスタイルではプラグインの呼び出しが1行に制限される

セキュアに関してはなんとかなると思うけれど、Wikiスタイルの制約は問題である

HikiDocに変わったという最新ではどうだろうか?

2005-12-29 (Thu)

#1

Intel Itanium Processor-specific Application Binary Interface (ABI) というのを見付ける。

うぅむ。__ia64 というのは正式っぽいのか

2005-12-30 (Fri)

#1

ふと TestDrive のページでチェックしてみると、FreeBSD/IA64 があるではないか。以前は無かったのに。

さっそくつないでみる... みようとするが、telnet がつながらない。

それはそれとして、誰だか知らないが home の disk を使い尽くしてくれちゃって作業不能なのは困ったものだ。

2005-12-31 (Sat)

#1

Intel C++ Compiler で問題の再現プログラムを作ってみる。

td177.testdrive.hp.com> icc --version
icc (ICC) 9.0  20051020
Copyright (C) 1985-2005 Intel Corporation.  All rights reserved.
td177.testdrive.hp.com> cat tst.c 
#include <stdio.h>
#include <ucontext.h>

int flag;
ucontext_t cont;

int v1=1, v2=2;
int
  x00= 0, x01= 1, x02= 2, x03= 3, x04= 4, x05= 5, x06= 6, x07= 7, x08= 8, x09= 9,
  x10=10, x11=11, x12=12, x13=13, x14=14, x15=15, x16=16, x17=17, x18=18, x19=19,
  x20=20, x21=21, x22=22, x23=23, x24=24, x25=25, x26=26, x27=27, x28=28, x29=29;

int main(int argc, char **argv)
{
  int ret;

  flag = 0;

  printf("%d %d\n", v1, v2);
  getcontext(&cont);
  printf("%d %d\n", v1, v2);
  printf(
    "%d %d %d %d %d %d %d %d %d %d "
    "%d %d %d %d %d %d %d %d %d %d "
    "%d %d %d %d %d %d %d %d %d %d\n",
    x00, x01, x02, x03, x04, x05, x06, x07, x08, x09,
    x10, x11, x12, x13, x14, x15, x16, x17, x18, x19,
    x20, x21, x22, x23, x24, x25, x26, x27, x28, x29);

  ret = flag;
  if (ret == 0) {
    flag = 1;
    setcontext(&cont);
  }
  return ret;
}
td177.testdrive.hp.com> icc -g -O0 tst.c
td177.testdrive.hp.com> ./a.out
1 2
1 2
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
1 2
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
td177.testdrive.hp.com> icc -g -O2 tst.c
td177.testdrive.hp.com> ./a.out
1 2
1 2
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
Segmentation fault (core dumped)

td177.testdrive.hp.com> gdb a.out core.6476 
GNU gdb Red Hat Linux (6.3.0.0-1.63rh)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "ia64-redhat-linux-gnu"...Using host libthread_db library "/lib/tls/libthread_db.so.1".

Reading symbols from shared object read from target memory...done.
Loaded system supplied DSO at 0xa000000000000000
Core was generated by `./a.out'.
Program terminated with signal 11, Segmentation fault.

warning: svr4_current_sos: Can't read pathname for load map: Input/output error

Reading symbols from /opt/intel/cc/9.0/lib/libimf.so.6...done.
Loaded symbols for /opt/intel/cc/9.0/lib/libimf.so.6
Reading symbols from /lib/tls/libm.so.6.1...done.
Loaded symbols for /lib/tls/libm.so.6.1
Reading symbols from /opt/intel/cc/9.0/lib/libipr.so.6...done.
Loaded symbols for /opt/intel/cc/9.0/lib/libipr.so.6
Reading symbols from /lib/libgcc_s.so.1...done.
Loaded symbols for /lib/libgcc_s.so.1
Reading symbols from /lib/tls/libc.so.6.1...done.
Loaded symbols for /lib/tls/libc.so.6.1
Reading symbols from /lib/libdl.so.2...done.
Loaded symbols for /lib/libdl.so.2
Reading symbols from /lib/ld-linux-ia64.so.2...done.
Loaded symbols for /lib/ld-linux-ia64.so.2
#0  main (argc=23, argv=0x18) at tst.c:21
21        printf("%d %d\n", v1, v2);
(gdb) bt
#0  main (argc=23, argv=0x18) at tst.c:21
(gdb) 
#2

IBM も Linux Test Drive ってのをやってんのか?

<URL:http://www-03.ibm.com/servers/enable/site/testdrive/index.html>

しかし、どれがなんだかわからない。iSeries, pSeries, xSeries, zSeries っていわれてもそれぞれどれがなんなのか。

なので調べてみる。

iSeries と pSeries の違いが良くわからんが、それはそれとして s/390 がちょっと気になる。

ふむ。

<URL:http://www.ciojp.com/contents/?id=00000382;t=29> というのを読むと、iSeries と pSeries は以前は異なっていたものが (中身は) 共通化していっているということだろうか。

wikipedia

という分類はなんともわかりやすいな。

というのも。

#3

Intel の Early Access Program Test Drives というのはどうなんだろう

<URL:http://www.intel.com/cd/ids/developer/asmo-na/eng/collaboration/99138.htm>

#4

それはそれとして、これからは TestDrive とだけ書くのはやめて、必ず HP TestDrive などと書くことにしよう

#5

Sun も Solaris 10 Operating System - Solaris-Opteron Testdrive というのをやっていた?

<URL:http://www.sun.com/software/solaris/contest/solaris-opteron-test-drive.xml>


[latest]


田中哲