Gauche:Bugs:log13
- http-getでプロキシを使った場合のリクエスト
- #\u00800000 を評価するとSegmentation fault(trunk)
- gdbm のテストで失敗する (trunk(r6831))
- dbm.gdbm,ndbm,odbmのテストが行われない(trunk)
- gauche-package generate foo で生成される test-foo が間違っている(trunk)
- thread-join!のドキュメントのtypo(0.8.14)
- src/repl.cのtypo(0.8.14, trunk)
- 浮動小数点数の変換に関しておかしな結果が現れる(0.8.14)
- FFX演算でスタックが破壊される? (0.8.14, trunk / rev.6441以降)
- SolarisでSun Cでのビルドに失敗する (0.8.14, trunk)
- <buffered-input-port>のseek操作 (0.8.14, trunk)
- text.gettext のドキュメントの typo (trunk)
- doc/modsrfi.texi の 552 行目
- sxml/tree-trans で let*-values がマクロ展開されない (0.8.14,trunk)
- openSUSE 11 (gcc 4.3.[12]) へのインストール(0.8.14)
- parameterとマルチスレッド (trunk)
- gauche/threads.hがコピーされない (0.8.14, trunk)
- ScmSyntacticClosureの定義にSCM_HEADERがない (0.8.14, trunk)
- Cygwin での format (0.8.14)
- gauche-package compileの-oオプション (trunk)
http-getでプロキシを使った場合のリクエスト
teppey (2009/11/21 09:01:57 PST): バグと言ってよいものか迷いましたが、0.9直前ということで書いてみます。何か勘違いしていたらすみません。 http-getを以下のように呼ぶと
- (http-get "www.google.com" "/index.html" :proxy "proxy.com")
- (http-get "www.google.com" "/index.html" :proxy "proxy.com" :host "www.example.com")
このようなリクエストになります。
1 | GET http://www.google.com/index.html HTTP/1.1 Host: proxy.com |
2 | GET http://www.example.com/index.html HTTP/1.1 Host: proxy.com |
1のケースでは、Hostヘッダにオリジンサーバ(www.google.com)が入ってほしいです。これは、バーチャルホストでHostヘッダを見ているときに、問題になることがあるからです。
2のケースでは、Hostヘッダが:hostで指定したホスト名で上書きされず、request-uriに含まれています。
これを、このようなリクエストにしたいと思うのですが、どうでしょうか。
1 | GET http://www.google.com/index.html HTTP/1.1 Host: www.google.com |
2 | GET http://www.google.com/index.html HTTP/1.1 Host: www.example.com |
パッチです。
Index: lib/rfc/http.scm =================================================================== --- lib/rfc/http.scm (revision 6845) +++ lib/rfc/http.scm (working copy) @@ -375,7 +375,7 @@ ;; canonicalize host and uri w.r.t. proxy (define (consider-proxy conn host uri) (if (ref conn'proxy) - (values (ref conn'proxy) (uri-compose :scheme "http" :host host :path* uri)) + (values host (uri-compose :scheme "http" :host (ref conn'server) :path* uri)) (values host uri))) ;; send
- Shiro(2009/11/21 16:38:13 PST): 滑り込みセーフ。提案の仕様がもっともなのでそのように fixしました。
#\u00800000 を評価するとSegmentation fault(trunk)
teppey (2009/11/19 10:36:52 PST): gdbで見てみると、文字が負数になっているみたいです。
$ gdb -q src/gosh (gdb) run -ftest Starting program: /home/teppey/src/Gauche-trunk/src/gosh -ftest [Thread debugging using libthread_db enabled] gosh> #\u00800000 Program received signal SIGSEGV, Segmentation fault. write_ss_rec (obj=0x80000003, port=0x810eee0, ctx=0xbfffeefc) at write.c:454 454 if (ch <= 0x20) Scm_PutzUnsafe(char_names[ch], -1, port); (gdb) print ch $1 = -8388608
- Shiro(2009/11/19 13:43:59 PST): うーん、機種依存のようです。プラットフォームと、Gaucheの encodingを何にしているか教えてください (gosh -Vの出力)。 あと、 (char->integer #\u00800000) とすると何になりますか? これが負数ならread時の問題だと思うんですが、utf-8でビルドしてるなら 負数はフィルタされてるはずなんですよね…
- teppey(2009/11/19 21:09:42 PST): あ、すみません。Debian Linux(testing)を32ビット環境で使用しています。char->integerは負数になりました。
$ src/gosh -V Gauche scheme shell, version 0.9_rc1 [utf-8,pthreads], i686-pc-linux-gnu $ src/gosh gosh> (char->integer #\u00800000) -8388608
gauche.hに#define SCM_CHAR_VALUE(obj) SCM_CHAR(SCM_WORD(obj) >> 8) #define SCM_MAKE_CHAR(ch) SCM_OBJ((long)((ch) << 8) + 3)
とあるので、longが32ビットの場合、- read_char()のSCM_MAKE_CHAR (0x00800000 -> 0x80000003)
- write_ss_rec()のSCM_CHAR_VALUE (0x80000003 -> 0xff800000) となるようです。
- Shiro(2009/11/19 22:00:55 PST): あれ、ScmWordはunsignedだったはず、と思って 確認したら、intptr_tに変えてたんだった。CHAR_VALUEの方はunsignedだった 頃に書かれたやつがそのまま残ってたんじゃないかな。fixしました。確認お願いします。
- teppey(2009/11/20 04:37:41 PST): ありがとうございます。r6842をビルドして、落ちないことを確認しました。
gdbm のテストで失敗する (trunk(r6831))
齊藤 (2009/11/05 06:20:30 PST): msys+Mingw でビルドしたもので gdbm-copy, gdbm-remove がエラーになっているようです。
Testing dbm =================================================================== testing bindings in #<module dbm> ... ok testing bindings in #<module dbm.fsdbm> ... ok <<fsdbm> dataset 1>------------------------------------------------------------ test #<class <fsdbm>> db-exists? (pre), expects #f ==> ok test #<class <fsdbm>> make, expects #t ==> ok test #<class <fsdbm>> db-exists? (post), expects #t ==> ok test #<class <fsdbm>> put!, expects #t ==> ok test #<class <fsdbm>> get, expects #t ==> ok test #<class <fsdbm>> get-exceptional, expects #t ==> ok test #<class <fsdbm>> for-each, expects #t ==> ok test #<class <fsdbm>> dict-for-each, expects #t ==> ok test #<class <fsdbm>> dict-map, expects #t ==> ok test #<class <fsdbm>> dict-keys, expects #t ==> ok test #<class <fsdbm>> dict-values, expects #t ==> ok test #<class <fsdbm>> close, expects #t ==> ok test #<class <fsdbm>> read-only open, expects #t ==> ok test #<class <fsdbm>> get again, expects #t ==> ok test #<class <fsdbm>> read-only, expects #t ==> ok test #<class <fsdbm>> close again, expects #t ==> ok test #<class <fsdbm>> delete, expects #t ==> ok test #<class <fsdbm>> close again, expects #t ==> ok test #<class <fsdbm>> db-copy, expects #t ==> ok test #<class <fsdbm>> db-remove, expects #t ==> ok <<fsdbm> dataset 2>------------------------------------------------------------ test #<class <fsdbm>> db-exists? (pre), expects #f ==> ok test #<class <fsdbm>> make, expects #t ==> ok test #<class <fsdbm>> db-exists? (post), expects #t ==> ok test #<class <fsdbm>> put!, expects #t ==> ok test #<class <fsdbm>> get, expects #t ==> ok test #<class <fsdbm>> get-exceptional, expects #t ==> ok test #<class <fsdbm>> for-each, expects #t ==> ok test #<class <fsdbm>> dict-for-each, expects #t ==> ok test #<class <fsdbm>> dict-map, expects #t ==> ok test #<class <fsdbm>> dict-keys, expects #t ==> ok test #<class <fsdbm>> dict-values, expects #t ==> ok test #<class <fsdbm>> close, expects #t ==> ok test #<class <fsdbm>> read-only open, expects #t ==> ok test #<class <fsdbm>> get again, expects #t ==> ok test #<class <fsdbm>> read-only, expects #t ==> ok test #<class <fsdbm>> close again, expects #t ==> ok test #<class <fsdbm>> delete, expects #t ==> ok test #<class <fsdbm>> close again, expects #t ==> ok test #<class <fsdbm>> db-copy, expects #t ==> ok test #<class <fsdbm>> db-remove, expects #t ==> ok testing bindings in #<module dbm.gdbm> ... ok <<gdbm> dataset 1>------------------------------------------------------------- test #<class <gdbm>> db-exists? (pre), expects #f ==> ok test #<class <gdbm>> make, expects #t ==> ok test #<class <gdbm>> db-exists? (post), expects #t ==> ok test #<class <gdbm>> put!, expects #t ==> ok test #<class <gdbm>> get, expects #t ==> ok test #<class <gdbm>> get-exceptional, expects #t ==> ok test #<class <gdbm>> for-each, expects #t ==> ok test #<class <gdbm>> dict-for-each, expects #t ==> ok test #<class <gdbm>> dict-map, expects #t ==> ok test #<class <gdbm>> dict-keys, expects #t ==> ok test #<class <gdbm>> dict-values, expects #t ==> ok test #<class <gdbm>> close, expects #t ==> ok test #<class <gdbm>> read-only open, expects #t ==> ok test #<class <gdbm>> get again, expects #t ==> ok test #<class <gdbm>> read-only, expects #t ==> ok test #<class <gdbm>> close again, expects #t ==> ok test #<class <gdbm>> delete, expects #t ==> ok test #<class <gdbm>> close again, expects #t ==> ok test #<class <gdbm>> db-copy, expects #t ==> ERROR: GOT #<<system-error> "read failed on #<iport test.dbm 0x10432a0>: Permission denied"> test #<class <gdbm>> db-remove, expects #t ==> ERROR: GOT #f <<gdbm> dataset 2>------------------------------------------------------------- test #<class <gdbm>> db-exists? (pre), expects #f ==> ok test #<class <gdbm>> make, expects #t ==> ok test #<class <gdbm>> db-exists? (post), expects #t ==> ok test #<class <gdbm>> put!, expects #t ==> ok test #<class <gdbm>> get, expects #t ==> ok test #<class <gdbm>> get-exceptional, expects #t ==> ok test #<class <gdbm>> for-each, expects #t ==> ok test #<class <gdbm>> dict-for-each, expects #t ==> ok test #<class <gdbm>> dict-map, expects #t ==> ok test #<class <gdbm>> dict-keys, expects #t ==> ok test #<class <gdbm>> dict-values, expects #t ==> ok test #<class <gdbm>> close, expects #t ==> ok test #<class <gdbm>> read-only open, expects #t ==> ok test #<class <gdbm>> get again, expects #t ==> ok test #<class <gdbm>> read-only, expects #t ==> ok test #<class <gdbm>> close again, expects #t ==> ok test #<class <gdbm>> delete, expects #t ==> ok test #<class <gdbm>> close again, expects #t ==> ok test #<class <gdbm>> db-copy, expects #t ==> ERROR: GOT #<<system-error> "read failed on #<iport test.dbm 0x10981c0>: Permission denied"> test #<class <gdbm>> db-remove, expects #t ==> ERROR: GOT #f failed. discrepancies found. Errors are: test #<class <gdbm>> db-copy: expects #t => got #<<system-error> "read failed on #<iport test.dbm 0x10432a0>: Permission denied"> test #<class <gdbm>> db-remove: expects #t => got #f test #<class <gdbm>> db-copy: expects #t => got #<<system-error> "read failed on #<iport test.dbm 0x10981c0>: Permission denied"> test #<class <gdbm>> db-remove: expects #t => got #f
- Shiro(2009/11/22 23:36:31 PST): gdbmは標準的にはmingw環境に入らないので、 とりあえず0.9での対応は見送ります。
dbm.gdbm,ndbm,odbmのテストが行われない(trunk)
kikuchi(2009/11/04 20:06:14 PST): soファイル名が間違っています。
Index: ext/dbm/test.scm =================================================================== --- ext/dbm/test.scm (リビジョン 6830) +++ ext/dbm/test.scm (作業コピー) @@ -260,18 +260,18 @@ ;; GDBM test ;; -(test-if-exists "dbm-gdbm" dbm.gdbm <gdbm>) +(test-if-exists "dbm--gdbm" dbm.gdbm <gdbm>) ;; ;; NDBM test ;; -(test-if-exists "dbm-ndbm" dbm.ndbm <ndbm>) +(test-if-exists "dbm--ndbm" dbm.ndbm <ndbm>) ;; ;; DBM test ;; -(test-if-exists "dbm-odbm" dbm.odbm <odbm>) +(test-if-exists "dbm--odbm" dbm.odbm <odbm>) (test-end)
- Shiro(2009/11/05 03:28:13 PST): 命名規則を変えた時にこっちのことをすっかり忘れてました。 fixed.
gauche-package generate foo で生成される test-foo が間違っている(trunk)
koguro(2009/10/12 07:06:40 PDT): gauche-package generate foo とすると foolib.stub が作られ、
(define-cproc test-foo () (return "test_foo"))
がデフォルト実装で入っていますが、define-cprocのreturnが廃止されたので、これを実行すると segmentation falut で落ちます。あと、結果が単体テストの内容とも異なるみたいなので、デフォルトでは以下のようになるべきでしょうか。
(define-cproc test-foo () (result (SCM_MAKE_STR_IMMUTABLE "foo is working")))
- Shiro(2009/10/12 13:24:55 PDT): おお、そこ忘れてました。fixed.
thread-join!のドキュメントのtypo(0.8.14)
teppey(2009/09/17 06:09:01 PDT): 2箇所です。
--- gauche-refj.texi.orig 2009-09-17 21:52:20.000000000 +0900 +++ gauche-refj.texi 2009-09-17 21:54:01.000000000 +0900 @@ -19692,11 +19692,11 @@ タイムアウトが指定されていない(デフォルト)は@code{#f}です。 @var{thread}が正常に終了したら、@code{thread-join!}は@var{thread}の -結果フィールとに格納されている値を返します。 +結果フィールドに格納されている値を返します。 @var{thread}が異常終了したら、@code{thread-join!}は@var{thread}の結果例外 フィールドに格納されている例外を投げます。 -タイムアウトに達すると、@var{timeout-val}が与えられていれば@var{thread-join!}を返し、 +タイムアウトに達すると、@var{timeout-val}が与えられていれば@var{timeout-val}を返し、 与えられていなければ@code{<join-timeout-exception>}を投げます。 @end defun
- Shiro(2009/09/17 06:37:43 PDT): Fixed. Mahalo.
src/repl.cのtypo(0.8.14, trunk)
teppey(2009/09/12 10:34:53 PDT): 冒頭のコメント内のコードです。
--- repl.c.orig 2009-09-13 02:14:11.000000000 +0900 +++ repl.c 2009-09-13 02:14:38.000000000 +0900 @@ -48,7 +48,7 @@ * (lambda () * (prompter) * (let loop2 ((exp (reader))) - * (if (eof-object? loop2) + * (if (eof-object? exp) * #f * (begin * (call-with-values
- Shiro(2009/09/17 06:37:43 PDT): Fixed. Mahalo.
浮動小数点数の変換に関しておかしな結果が現れる(0.8.14)
(2009/08/20 20:32:08 PDT)有理数から浮動小数点数への変換が正確でない場合があります。
gosh> (expt 2.0 -1024) 5.562684646268003e-309 gosh> (exact->inexact (expt 2 -1024)) 0.0
絶対値最小の非正規化数 2^(-1074)と-2^(-1074)で、 read/write invarianceが成り立ちません。
gosh> (expt 2.0 -1074) 5.0e-324 gosh> 5.0e-324 0.0 gosh> (let1 x (expt 2.0 -1074) (= x (string->number (number->string x)))) #f
数の読み込みで落ちる場合があります。
gosh> 4.94065645841246544e-323 5.0e-323 gosh> 4.940656458412465440e-323 "number.c", line 2760 (iexpt10): Assertion failed: e < IEXPT10_TABLESIZ
- Shiro(2009/08/21 14:25:10 PDT): fixしました(r6716)。いやぁつくづく浮動小数点数の 読み込みは難しい。今でも50e-325だと0.0になっちゃうんですが、 これはどこまでサポートすべきかって話になります。 50....(ずっと0が続く)....e-10000...(巨大な指数)... とかいくらでも極端な 例があり得るので。 ひとまずread/write invarianceの範囲は確実にサポートすべきですが。
FFX演算でスタックが破壊される? (0.8.14, trunk / rev.6441以降)
naoya_t(2009/08/05 20:28:41 PDT): 自作関数inverse-erf(浮動小数点演算を含む)を呼び出す前にスタックに積んだ値(下の例では√2)が破壊される
- この問題はtrunkでは起こるが0.8.14リリース版では起こらないので、とりあえずバイナリサーチ的に各リビジョンで試して行ったところ6440→6441の間で問題が発生することを突き止めた
- FFX (fast flonum extension) が怪しい
- #define GAUCHE_FFX 0でビルドすると問題は起きなくなる
再現コード。inverse-erf自体は正しく値を返していることを示すために#?=を入れてあります
(use math.const) ;; pi (define *epsilon* 1e-12) ;; ;; normal quantile function (probit function) ;; (define (probit p) (define (probit>0 p) #?=(* #?=(inverse-erf (- (* p 2) 1)) (sqrt 2))) ;; OK (if (< p 0) (- 1 (probit>0 (- p))) (probit>0 p) )) (define (probit p) (define (probit>0 p) #?=(* (sqrt 2) #?=(inverse-erf (- (* p 2) 1)))) ;; NG (if (< p 0) (- 1 (probit>0 (- p))) (probit>0 p) )) ;; ;; inverse error function (erf-1) ;; (define (inverse-erf z) (define (calc-next-ck k c) (let loop ((m 0) (sum 0) (ca c) (cz (reverse c))) (if (= m k) sum (loop (+ m 1) (+ sum (/. (* (car ca) (car cz)) (+ m 1) (+ m m 1))) (cdr ca) (cdr cz))))) (define (calc-cks k) (let loop ((i 0) (cks '(1))) (if (= i k) cks (loop (+ i 1) (cons (calc-next-ck (+ i 1) cks) cks))))) (define (calc-ck k) (car (calc-cks k))) (define (inverse-erf>0 z) (let1 r (* pi z z 1/4) ; (πz^2)/4 (let loop ((k 0) (cks '(1)) (sum 0) (a 1)) (let1 delta (* a (/ (car cks) (+ k k 1))) (if (< delta (* sum *epsilon*)) (* 1/2 z (sqrt pi) sum) (loop (+ k 1) (cons (calc-next-ck (+ k 1) cks) cks) (+ sum delta) (* a r))))))) (cond [(< z 0) (- (inverse-erf>0 (- z)))] [(= z 0) 0] [else (inverse-erf>0 z)]) ) ;; ;; TEST ;; (use gauche.test) (test-start "erf") (test-section "probit function") (define ~= (lambda (x y) (< (abs (- x y)) 1e-7))) (test* "probit(0.025)" -1.959964 (probit 0.025) ~=) (test* "probit(0.975)" 1.959964 (probit 0.975) ~=) (test-end)
- Shiro(2009/08/21 13:14:43 PDT): Fixしました(r6715)。Mahalo nui loa!
SolarisでSun Cでのビルドに失敗する (0.8.14, trunk)
2009/04/23 13:58:20 PDT: -hは-oのtypoではないでしょうか? ldに-oが渡らず、a.outとして出力されるため、src/makeverslinkが失敗しているようです。これでSPARCではビルドが通るようになるのではないかと思います。(私の使っているx86でも、gc/configureを修正してAO_USE_PTHREAD_DEFSを指定すればビルドは通りましたが、Boehm GCが正規に対応していないので、結局gccを使いました)
Index: configure.ac =================================================================== --- configure.ac (revision 6668) +++ configure.ac (working copy) @@ -509,7 +509,7 @@ SHLIB_SO_LDFLAGS="-shared -o" else SHLIB_SO_CFLAGS="-Kpic" - SHLIB_SO_LDFLAGS="-G -h" + SHLIB_SO_LDFLAGS="-G -o" fi SHLIB_SO_SUFFIX="so" SHLIB_MAIN_LDFLAGS=""
- Shiro(2009/08/21 02:13:12 PDT): Solaris/SunCCの環境にアクセスできなくなってから 久しいのですが、以前コンパイル通ってた時から変えてないはずなので SunCCの方で何か変わったのかも。いずれにせよ私は検証できないので、 パッチのとおりに変更しておきました。
<buffered-input-port>のseek操作 (0.8.14, trunk)
shinya(2009/03/21 02:23:53 PDT): seekスロットを設定していない<buffered-input-port>でport-seekを呼ぶと、 #fが返るにも関わらずポインタが移動してしまいます。
gosh> (use gauche.vport) #<undef> gosh> (use gauche.uvector) #<undef> gosh> (use gauche.sequence) #<undef> gosh> (define in (let ((index 0)) (make <buffered-input-port> :fill (lambda (buf) #?=index (for-each-with-index (lambda (i _) (u8vector-set! buf i (logand (+ index i) #xFF))) buf) (let ((size (u8vector-length buf))) (inc! index size) size)) ))) in gosh> (read-byte in) #?=index #?- 0 0 gosh> (read-byte in) 1 gosh> (port-seek in 5 SEEK_SET) #f gosh> (read-byte in) ; 2が返ることを期待 #?=index #?- 8192 0
- Shiro(2009/08/21 02:10:54 PDT): fixed (r6173)
text.gettext のドキュメントの typo (trunk)
tabe(2009/02/07 07:39:17 PST): コメントに含まれている例と同様です。
Index: ext/text/text-gettext-lib.scm =================================================================== --- ext/text/text-gettext-lib.scm (revision 6544) +++ ext/text/text-gettext-lib.scm (working copy) @@ -66,8 +66,8 @@ ;; build these closures manually for convenience in using multiple ;; separate domains or locales at once (useful for server environments): ;; -;; (define my-gettext (make-gettex "myapp")) -;; (define (_ (my-gettext 'getter))) +;; (define my-gettext (make-gettext "myapp")) +;; (define _ (my-gettext 'getter)) ;; (_ "Hello, World!") (define-module text.gettext Index: doc/modutil.texi =================================================================== --- doc/modutil.texi (revision 6544) +++ doc/modutil.texi (working copy) @@ -12621,8 +12621,8 @@ @c COMMON @example -(define my-gettext (make-gettex "myapp")) -(define (_ (my-gettext 'getter))) +(define my-gettext (make-gettext "myapp")) +(define _ (my-gettext 'getter)) (_ "Hello, World!") @end example @end defun
- Shiro(2009/08/20 23:57:32 PDT): fixed.
doc/modsrfi.texi の 552 行目
peanutsjamjam(2009/01/21 10:55:20 PST): doc/modsrfi.texi の 552 行目 に 'c' の一文字が足りないようです。"@ EN" -> "@c EN".
- Shiro(2009/08/20 23:57:32 PDT): fixed.
sxml/tree-trans で let*-values がマクロ展開されない (0.8.14,trunk)
2009/01/19 16:41:35 PST: 関数呼び出しになってます。
Index: ext/sxml/sxml/tree-trans.scm.in =================================================================== --- ext/sxml/sxml/tree-trans.scm.in (revision 6518) +++ ext/sxml/sxml/tree-trans.scm.in (working copy) @@ -9,6 +9,7 @@ ;;; (define-module sxml.tree-trans + (use srfi-11) (use text.parse) (use sxml.adaptor) (export SRV:send-reply
- Shiro(2009/01/20 00:10:02 PST): fixしました。mahalo
openSUSE 11 (gcc 4.3.[12]) へのインストール(0.8.14)
osn(2009/01/15 06:10:02 PST): openSUSE 11.0 と 1 (x86_64)にインストールしようとしたところ、vm.c のコンパイルが終了しないようです。最適化オプションをデフォルトの -O2 から -O に変更したところ、コンパイルできて、テストも pass しました。openSUSE 10.3 (gcc 4.1)にはインストールできてましたので、gcc 4.3.[12] で -O2 を使用した場合の問題かと想像しています。
- Shiro(2009/01/19 20:24:28 PST) vm.cは自動生成されたCコードが含まれる巨大な関数があるので、 gccの最適化ルーチンが爆発しちゃってるのかもしれません。しかしそこはGaucheの実行速度に ものすごく大きな影響を与える箇所なんで、-Oでコンパイルすると(できたGaucheが)かなり遅くなると思います。 どのくらい走らせて諦めましたか? 以前Power PCのgccでcompile.cが5~6分かかってたことも あったんで、まあ10分くらいなら許容範囲かなとは思うんですが。
- osn(2009/01/20 16:34:05 PST) 言われているように辛抱が足りてませんでした。失礼しました。
- Shiro(2009/01/20 17:37:21 PST): あ、通ったということですか? ちなみにどのくらいかかりました?
- osm(2009/01/21 15:41:13 PST) 最初の書き込みの際は、仮想マシンやノートPCで10分位は待っていたと思います。手もとのマシンで確認しなおしましたら、Core i7 965 3.20GHz / gcc (SUSE Linux) 4.3.2 で vm.c のコンパイル時間が 5分22秒 でした。
- Shiro(2009/01/21 21:07:44 PST): ふーむ。そんなにかかるとなると途中で諦めるのも 無理ないですね。環境が手に入ったら見てみますが、いずれにせよリリースノートには 注意を含めておいた方が良さそうです。ありがとうございました。
- y.takenaka (2009/01/30) 僕もOpenSUSEを利用してましたので確認しましたが、 OpenSUSEのgccに関するリポジストリ(devel:gcc)を加えて4.3.3にしても同じでした。こちらも-Oにしてコンパイルしました。make test もエラーはでなかったですよ。-O2の時のvm.cですが、時間が経つごとにメモリ使用量も増えるみたいです。
parameterとマルチスレッド (trunk)
Shiro(2008/12/30 04:29:28 PST): lingrのgauche部屋でRuiさんより指摘されたのでこっちにメモ。
現在、スレッドは親スレッドのパラメータのセットを継承するようになってて、 自スレッドが作られた以降にmake-parameterされたものについてはアクセスできない。 スレッドを作る時は必要なライブラリなどは全部useしてるから、 ライブラリ内で使うパラメータについては問題が出ないだろうと思っていたんだが、 autoloadされるライブラリについてはスレッドが作成された後でmake-parameterが 実行される場合がある。そうすると他のスレッドではそのライブラリが正常に 動作しない。
スレッド内で(eval '(use foo) module)されるようなケースも考えると、 autoloadだけの問題というより、パラメータの設計そのものを見直すべきかも。 現在でも各パラメータはプロセス内ユニークなIDを持っていて、 各スレッドはパラメータIDから スレッドローカルはパラメータのストレージ (密なベクタ) へのマップを持っている。 自スレッドでまだアロケートされていないパラメータが使われたら オンデマンドでパラメータストレージを確保するようにすればいけるんじゃないかな。
gauche/threads.hがコピーされない (0.8.14, trunk)
koguro(2008/12/29 20:32:16 PST): Gaucheをmake installしたときにgauche/threads.hがコピーされません。Cからアクセスしたいので、特に問題なければコピーしてもらえるとうれしいです。あと他にもcharconv.hなどext配下のヘッダファイルでコピーされないものがあるようです。
ScmSyntacticClosureの定義にSCM_HEADERがない (0.8.14, trunk)
koguro(2008/12/22 17:39:33 PST): src/gauche/vm.hにあるScmSyntacticClosureの定義ですが、SCM_HEADERが抜けているみたいです(もしかして、ここではなくてもOKとか)。
- Shiro(2008/12/22 18:07:32 PST): 今はsyntactic closure使ってないんですが、使うとなれば 要ると思います。低レベルマクロの仕組みとして、syntactic closureにするかexplicit renamingにするか迷ってるところです。
Cygwin での format (0.8.14)
Pla(2008/12/02 19:38:10 PST): 手元の環境(Cygwin)で、以下がメモリをひたすら消費します。なお、Linuxでは再現しませんでした。
% uname -r 1.5.25(0.156/4/2) % gosh gosh> (gauche-version) "0.8.14" gosh> (while #t (format ""))
- Pla(2008/12/02 19:57:18 PST): 以下でも(やはりCygwinでのみ)再現しました:
gosh> (while #t (close-input-port (open-input-string "")))
- Pla(2008/12/03 16:51:53 PST): Gauche:Bugs:log5 には ssax:xml->sxml でメモリリークしているかもしれないとの報告がありますが、with-input-from-file だけをループしてもメモリ使用量が増えていきます:
gosh> (while #t (with-input-from-file "hoge.txt" +))
with-output-to-file でも同様でした:gosh> (while #t (with-output-to-file "hoge.txt" +))
with-input-from-string, with-output-to-string でも同様です:gosh> (while #t (with-input-from-string "hogehoge" +))
gosh> (while #t (with-output-to-string +))
以上4つすべて、メモリの使用量が増えていくのは手元のCygwin環境のみで、Linuxではこの現象は起きませんでした。CygwinでGaucheを使用されている方がいらっしゃいましたら、追試を希望します。
gauche-package compileの-oオプション (trunk)
kikuchi(2008/11/13 04:08:04 PST): sofileだけでなくobjのファイル名も変更されてしまいます。
Index: lib/gauche/package/compile.scm =================================================================== --- lib/gauche/package/compile.scm (revision 6439) +++ lib/gauche/package/compile.scm (working copy) @@ -125,7 +125,7 @@ (let1 objs (map (lambda (src) (cond ((equal? (path-extension src) OBJEXT) src) - (else (apply gauche-package-compile src args) + (else (apply gauche-package-compile src (delete-keyword :output args)) (sys-basename (path-swap-extension src OBJEXT))))) `(,head.c ,@files ,tail.c)) (apply gauche-package-link sofile objs args)
- Shiro(2008/11/13 17:21:59 PST): 修正しました。(rev6440)