Skip to content

Instantly share code, notes, and snippets.

@Hamayama
Last active September 17, 2017 02:06
Show Gist options
  • Save Hamayama/f248c6a8b8e853a49caf58bf1a02399c to your computer and use it in GitHub Desktop.
Save Hamayama/f248c6a8b8e853a49caf58bf1a02399c to your computer and use it in GitHub Desktop.
Gauche 調査中
<調査中>
MSYS2/MinGW-w64 32bit 開発環境での Gauche v0.9.6_pre2 のビルド/テストでエラーが出る。
MSYS2/MinGW-w64 64bit や MinGW.org (32bitのみ) の開発環境では発生しない。
OS : Windows 8.1 (64bit)
印象としては、ほとんど動作していて、ごくまれに文字列が化ける感じ。
(1)MSYS2/MinGW-w64 32bit 開発環境での Gauche v0.9.6_pre2 のビルドで以下のエラー
precomp で ext/text/gettext.scm をコンパイルしようとして、
「ファイル "tr" が見つかりません」というようなエラーだった。
→ 再度ビルドしたら成功。その後再現せず
(2017-5-6)
(2)MSYS2/MinGW-w64 32bit 開発環境での Gauche v0.9.6_pre2 のビルドで以下のエラー
make[2]: ディレクトリ '/c/Gauche/Gauche/ext/uvector' に入ります
../../src/gosh -ftest ../../src/gauche-install.in -C -m 444 -S . -T /c/Gauche/Gauche/../Gauche-mingw-dist/Gauche-i686/lib/gauche-0.9/0.9.6_pre2/include gauche/uvector.h
*** ERROR: cannot find "../../src/../i686-w64-mingw32" to load
Stack Trace:
_______________________________________
make[2]: *** [../Makefile.ext:115: install-std] エラー 70
→ 再度ビルドしたら成功。その後再現せず
(2017-5-6)
(3)MSYS2/MinGW-w64 32bit 開発環境での Gauche v0.9.6_pre2 のテストで以下のエラー
make[2]: ディレクトリ '/c/Gauche/Gauche/ext/net' に入ります
GAUCHE_TEST_RECORD_FILE=../../test.record ../../src/gosh -ftest -I. -I. ./test.scm > test.log
Testing net ... *** ERROR: cannot find "`\n|" in ("../../lib" "../../libsrc" "../../src" "C:\\Gauche\\Gauche\\share\\gauche-0.9\\site\\lib" "C:\\Gauche\\Gauche\\share\\gauche-0.9\\0.9.6_pre2\\lib" "C:\\Gauche\\Gauche\\share\\gauche/site/lib" "C:\\Gauche\\Gauche\\share\\gauche/0.9/lib")
Stack Trace:
_______________________________________
failed.
discrepancies found. Errors are:
test udp client socket: expects "ABC" => got #<<system-error> "recv(2) failed: An existing connection was forcibly closed by the remote host.\r\n(error code = 10054)">
make[2]: ディレクトリ '/c/Gauche/Gauche/ext/net' から出ます
→ 再度テストしたら成功。その後再現せず
(2017-5-6)
(4)また、gosh.exe と同じフォルダに gosh.gc.log という以下の内容のファイルが出来ていました。
GC Warning: Repeated allocation of very large block (appr. size 81920):
May lead to memory leak and poor performance
GC Warning: Repeated allocation of very large block (appr. size 81920):
May lead to memory leak and poor performance
(2017-5-6)(2017-5-7)
(5)MSYS2/MinGW-w64 32bit 開発環境での Gauche v0.9.6_pre2 のビルドで以下のエラー
make[2]: ディレクトリ '/c/Gauche/Gauche/ext/util' に入ります
../../src/gosh -ftest ../../src/precomp -e -P -o util--match ../../libsrc/util/match.scm
*** SYSTEM-ERROR: couldn't open input file: "nu": No such file or directory
Stack Trace:
_______________________________________
0 (first-form src)
at "../../lib/gauche/cgen/precomp.scm":383
1 (filter-map get-module-dependency srcs)
at "../../lib/gauche/cgen/precomp.scm":392
2 (order-files-by-dependency srcs)
at "../../lib/gauche/cgen/precomp.scm":198
3 (cgen-precompile-multi srcs :ext-initializer extini :strip-pr ...
at "./../../src/precomp":85
make[2]: *** [Makefile:25: util--match.c] エラー 70
→ 再度ビルドしたら成功。その後再現せず
(2017-5-7)
(6)切り分けのため Gauche v0.9.5 32bit のインストーラから入れ直した。
(2017-5-8)
(7)MSYS2/MinGW-w64 32bit 開発環境での Gauche v0.9.6_pre2 のビルドで以下のエラー
make[2]: ディレクトリ '/c/Gauche/Gauche/ext/util' に入ります
../../src/gosh -ftest ../../src/gauche-install.in -C -m 444 -S . -T /c/Gauche/Gauche/../Gauche-mingw-dist/Gauche-i686/lib/gauche-0.9/0.9.6_pre2/include
../../src/gosh -ftest ../../src/gauche-install.in -C -m 444 -S . -T /c/Gauche/Gauche/../Gauche-mingw-dist/Gauche-i686/share/gauche-0.9/0.9.6_pre2/lib/util match.sci
*** ERROR: cannot find "../../src/../i686-w64-mingw32" to load
Stack Trace:
_______________________________________
make[2]: *** [../Makefile.ext:116: install-std] エラー 70
→ これは PATH の設定をまちがえていたかも。。。
(2017-5-8)
(8)MSYS2/MinGW-w64 32bit 開発環境での Gauche v0.9.5 のビルド
→ 再現せず (とりあえず5回ビルド&テスト実行)
(2017-5-8)
(9)MinGW.org (32bitのみ) 開発環境での Gauche v0.9.6_pre2 のビルド
→ 再現せず (とりあえず5回ビルド&テスト実行)
(2017-5-9)
(10)MSYS2/MinGW-w64 32bit の旧開発環境(gcc v6.2.0)での Gauche v0.9.6_pre2 のビルド
→ 再現せず (とりあえず5回ビルド&テスト実行)
(2017-5-9)
(11)MSYS2/MinGW-w64 32bit 開発環境での Gauche v0.9.6_pre2 のビルド
→ 再現せず (とりあえず5回ビルド&テスト実行)
(2017-5-9)
(12)MSYS2/MinGW-w64 32bit 開発環境での Gauche v0.9.6_pre2 による Gauche v0.9.6_pre2 のビルドで以下のエラー
../../src/gosh -ftest ../../src/gauche-install.in -C -m 555 -T /c/Gauche/Gauche/../Gauche-mingw-dist/Gauche-i686/lib/gauche-0.9/0.9.6_pre2/i686-w64-mingw32 gauche--charconv.dll
*** ERROR: cannot find "../../src/../i686-w64-mingw32" to load
Stack Trace:
_______________________________________
make[2]: *** [../Makefile.ext:117: install-std] エラー 70
(2017-5-9)
(13)MSYS2/MinGW-w64 32bit の旧開発環境(gcc v6.2.0)での Gauche v0.9.6_pre2 による Gauche v0.9.6_pre2 のビルドで以下のエラー
make[2]: ディレクトリ '/c/Gauche/Gauche/ext/bcrypt' に入ります
GAUCHE_TEST_RECORD_FILE=../../test.record ../../src/gosh -ftest -I. -I. ./test.scm > test.log
*** ERROR: cannot find "\x80;\n|" in ("." "." "../../lib" "../../libsrc" "../../src" "C:\\Gauche\\Gauche\\share\\gauche-0.9\\site\\lib" "C:\\Gauche\\Gauche\\share\\gauche-0.9\\0.9.6_pre2\\lib" "C:\\Gauche\\Gauche\\share\\gauche/site/lib" "C:\\Gauche\\Gauche\\share\\gauche/0.9/lib")
Stack Trace:
_______________________________________
make[2]: *** [../Makefile.ext:89: check] エラー 70
(2017-5-9)
(14)MinGW.org (32bitのみ) の開発環境での Gauche v0.9.6_pre2 による Gauche v0.9.6_pre2 のテストで以下のエラー
タイトルが「Fatal error in gc」で「SuspendThread failed」というメッセージボックスが出た。
Testing control ... Testing debug f
eatures ... passed.
Testing utility scripts ... passed.
Testing interactive ... passed.
Testing r7rs-tests ... passed.
make[1]: Leaving directory `/c/Gauche/Gauche/src'
Total: 17465 tests, 17465 passed, 0 failed, 1 aborted.
(2017-5-9)
(20)2分探索で切り分ける (HEAD と 0.9.5の間)
git bisect start HEAD 449946b
39a016e 再現せず(x2)
6fb3771 再現せず(x2)
01667ce 再現せず(x1) エラー(x1)
make[1]: ディレクトリ '/c/Gauche/Gauche/src' に入ります
../mkinstalldirs /c/Gauche/Gauche/../Gauche-mingw-dist/Gauche-i686/lib/gauche-0.9/0.9.6_pre2/include /c/Gauche/Gauche/../Gauche-mingw-dist/Gauche-i686/lib/gauche-0.9/0.9.6_pre2/include/gauche /c/Gauche/Gauche/../Gauche-mingw-dist/Gauche-i686/share/gauche-0.9/0.9.6_pre2/lib /c/Gauche/Gauche/../Gauche-mingw-dist/Gauche-i686/lib/gauche-0.9/0.9.6_pre2/i686-pc-mingw32 /c/Gauche/Gauche/../Gauche-mingw-dist/Gauche-i686/bin /c/Gauche/Gauche/../Gauche-mingw-dist/Gauche-i686/share/gauche-0.9/site/lib /c/Gauche/Gauche/../Gauche-mingw-dist/Gauche-i686/lib/gauche-0.9/site/i686-pc-mingw32
mkdir -p -- /c/Gauche/Gauche/../Gauche-mingw-dist/Gauche-i686/bin /c/Gauche/Gauche/../Gauche-mingw-dist/Gauche-i686/share/gauche-0.9/site/lib /c/Gauche/Gauche/../Gauche-mingw-dist/Gauche-i686/lib/gauche-0.9/site/i686-pc-mingw32
./gosh -ftest ./gauche-install.in -m 444 -S . gauche.h ../gc/include/gc.h ../gc/include/gc_allocator.h ../gc/include/gc_config_macros.h ../gc/include/gc_cpp.h ../gc/include/gc_inline.h ../gc/include/gc_mark.h ../gc/include/gc_pthread_redirects.h ../gc/include/gc_tiny_fl.h ../gc/include/gc_typed.h ../gc/include/gc_version.h /c/Gauche/Gauche/../Gauche-mingw-dist/Gauche-i686/lib/gauche-0.9/0.9.6_pre2/include
*** ERROR: cannot find "X\x1b;|" in ("../lib" "../libsrc" "../src" "C:\\Gauche\\Gauche\\share\\gauche-0.9\\site\\lib" "C:\\Gauche\\Gauche\\share\\gauche-0.9\\0.9.6_pre2\\lib" "C:\\Gauche\\Gauche\\share\\gauche/site/lib" "C:\\Gauche\\Gauche\\share\\gauche/0.9/lib")
Stack Trace:
_______________________________________
make[1]: *** [Makefile:510: install-aux] エラー 70
b9c484b 再現せず(x2)
6209ffe 再現せず(x2)
f13b47d 再現せず(x2)
102687c 再現せず(x2)
13a0109 再現せず(x5)
git bisect log
# bad: [0d8e7fb33ee7932ba9f8ae488c92ad3c49f26608] Document hash-table-find anoma
lity
# good: [449946b55840c9f9fd273b4c649c56dc2bac1c67] Release 0.9.5
git bisect start 'HEAD' '449946b'
# good: [39a016efdb3a4eaf96611c8ed1d3a20d00782415] rfc.http - Add back stunnel s
upport for https connection
git bisect good 39a016efdb3a4eaf96611c8ed1d3a20d00782415
# good: [6fb377126e1cd4763e39d5b9572b7f2e883619e4] Add docs for floor-quotient e
tc.
git bisect good 6fb377126e1cd4763e39d5b9572b7f2e883619e4
# bad: [01667cec54630cad5eda050ed44bc699db72dcf7] Keep subr's binding info in th
e subr's info
git bisect bad 01667cec54630cad5eda050ed44bc699db72dcf7
# good: [b9c484bdfde244a3fe98a8a72256a5c5758bed1d] Toplevel ,info command can no
w take regexp to search
git bisect good b9c484bdfde244a3fe98a8a72256a5c5758bed1d
# good: [6209ffe4a793854e9ccbb4c76749b4015393312a] Start adding precomp test
git bisect good 6209ffe4a793854e9ccbb4c76749b4015393312a
# good: [f13b47ddd051b5c1eca84b1a393ee3ccdd975bd3] Fix export list of gauche.pro
cedure
git bisect good f13b47ddd051b5c1eca84b1a393ee3ccdd975bd3
# good: [102687c866ffce593db8be51f971eb53c72f3d34] Enable inlining setter in (se
t! (op arg ...) val)
git bisect good 102687c866ffce593db8be51f971eb53c72f3d34
# good: [13a0109574f319739be93c3d243560227c8ada9c] Update gauche.h comment on Sc
mProcedure
git bisect good 13a0109574f319739be93c3d243560227c8ada9c
# first bad commit: [01667cec54630cad5eda050ed44bc699db72dcf7] Keep subr's bindi
ng info in the subr's info
(2017-5-10)
(21)01667ce の再現チェック
01667ce 再現せず(x3)
→ 再現しない
→ 多分するはずだが。。。
(2017-5-10)
(22)0d8e7fb の再現チェック
0d8e7fb 再現せず(x2) エラー(x2)
make[2]: ディレクトリ '/c/Gauche/Gauche/ext/fcntl' に入ります
../../src/gosh -ftest ../../src/gauche-install.in -C -m 444 -S . -T /c/Gauche/Gauche/../Gauche-mingw-dist/Gauche-i686/lib/gauche-0.9/0.9.6_pre2/include
../../src/gosh -ftest ../../src/gauche-install.in -C -m 444 -S . -T /c/Gauche/Gauche/../Gauche-mingw-dist/Gauche-i686/share/gauche-0.9/0.9.6_pre2/lib/gauche fcntl.sci
*** ERROR: cannot find "../../src/../i686-w64-mingw32" to load
Stack Trace:
_______________________________________
make[2]: *** [../Makefile.ext:116: install-std] エラー 70
→ make clean でも再現できた
(2017-5-10)
(23)b9c484b の再現チェック
b9c484b 再現せず(x2) エラー(x1)
./gosh -ftest ./gauche-install.in -m 444 -S . gauche/bignum.h gauche/bits.h gauche/bits_inline.h gauche/bytes_inline.h gauche/char_euc_jp.h gauche/char_none.h gauche/char_sjis.h gauche/char_utf_8.h gauche/charset.h gauche/class.h gauche/code.h gauche/collection.h gauche/config.h gauche/config_threads.h gauche/compare.h gauche/exception.h gauche/extend.h gauche/extern.h gauche/float.h gauche/gloc.h gauche/hash.h gauche/int64.h gauche/load.h gauche/module.h gauche/number.h gauche/parameter.h gauche/paths.h gauche/port.h gauche/prof.h gauche/pthread.h gauche/reader.h gauche/regexp.h gauche/scmconst.h gauche/static.h gauche/string.h gauche/symbol.h gauche/system.h gauche/treemap.h gauche/uthread.h gauche/vector.h gauche/vm.h gauche/vminsn.h gauche/weak.h gauche/win-compat.h gauche/writer.h gauche/wthread.h /c/Gauche/Gauche/../Gauche-mingw-dist/Gauche-i686/lib/gauche-0.9/0.9.6_pre2/include/gauche
*** ERROR: cannot find "../src/i686-pc-mingw32" to load
Stack Trace:
_______________________________________
make[1]: *** [Makefile:509: install-aux] エラー 70
(2017-5-10)
(24)ここで、Windows Update を実施して、PCを再起動。以後、再現しなくなる。。。
(2017-5-11)
(25)01667ce の再現チェック
01667ce 再現せず(x13)
(2017-5-11)
(26)b9c484b の再現チェック
b9c484b 再現せず(x10)
(2017-5-11)
(30)MSYS2/MinGW-w64 64bit 開発環境での Gauche v0.9.6_pre2 のビルド
e55d69a 再現せず(x2)
(2017-5-12)
(31)MSYS2/MinGW-w64 32bit 開発環境での Gauche v0.9.6_pre2 のビルド
e55d69a 再現せず(x10) エラー(x1)
make[2]: ディレクトリ '/c/Gauche/Gauche/ext/gauche' に入ります
GAUCHE_TEST_RECORD_FILE=../../test.record ../../src/gosh -ftest -I. -I. ./test.scm > test.log
*** ERROR: cannot find "\x80;\n|" in ("." "." "../../lib" "../../libsrc" "../../src" "C:\\Gauche\\Gauche\\share\\gauche-0.9\\site\\lib" "C:\\Gauche\\Gauche\\share\\gauche-0.9\\0.9.6_pre2\\lib" "C:\\Gauche\\Gauche\\share\\gauche/site/lib" "C:\\Gauche\\Gauche\\share\\gauche/0.9/lib")
Stack Trace:
_______________________________________
make[2]: *** [../Makefile.ext:89: check] エラー 70
(2017-5-12)
(32)MSYS2/MinGW-w64 64bit 開発環境での Gauche v0.9.6_pre2 のビルド
e55d69a 再現せず(x1)
(2017-5-13)
(33)MSYS2/MinGW-w64 32bit 開発環境での Gauche v0.9.6_pre2 のビルド
e55d69a 再現せず(x11) エラー(x1)
PASS: cordtest.exe
PASS: gctest.exe
make[4]: *** ファイル 'leaktest.log' を削除します
make[4]: *** [Makefile:1969: leaktest.log] エラー 130
make[3]: *** [Makefile:1937: check-TESTS] Interrupt
make[2]: *** [Makefile:2270: check-am] Interrupt
make[1]: *** [Makefile:1714: check-recursive] Interrupt
make: *** [Makefile:47: check] Interrupt
→ GCのテストで固まった。このとき Gauche v0.9.5 32bit を別途起動していたが。。。
(2017-5-13)
(40)エラー時に起動時の引数を表示するように Gauche を改造してみた。
(2017-5-13)
(41)MSYS2/MinGW-w64 32bit 開発環境での Gauche v0.9.6_pre2 のビルド
e55d69a 再現せず(x9) エラー(x1)
make[2]: ディレクトリ '/c/Gauche/Gauche/ext/vport' に入ります
../../src/gosh -ftest ../../src/gauche-install.in -C -m 444 -S . -T /c/Gauche/Gauche/../Gauche-mingw-dist/Gauche-i686/lib/gauche-0.9/0.9.6_pre2/include
../../src/gosh -ftest ../../src/gauche-install.in -C -m 444 -S . -T /c/Gauche/Gauche/../Gauche-mingw-dist/Gauche-i686/share/gauche-0.9/0.9.6_pre2/lib/gauche vport.scm
../../src/gosh -ftest ../../src/gauche-install.in -C -m 555 -T /c/Gauche/Gauche/../Gauche-mingw-dist/Gauche-i686/lib/gauche-0.9/0.9.6_pre2/i686-w64-mingw32 gauche--vport.dll
*** ERROR: cannot find "../../lib/../i686-w64-mingw32" to load
Stack Trace:
_______________________________________
err_id=3:
argv1000:
C:\Gauche\Gauche\src\gosh.exe
-ftest
../../src/gauche-install.in
-C
-m
555
-T
C:/Gauche/Gauche/../Gauche-mingw-dist/Gauche-i686/lib/gauche-0.9/0.9.6_pre2/i686-w64-mingw32
gauche--vport.dll
argv1001:
C:\Gauche\Gauche\src\gosh.exe
-ftest
../../src/gauche-install.in
-C
-m
555
-T
C:/Gauche/Gauche/../Gauche-mingw-dist/Gauche-i686/lib/gauche-0.9/0.9.6_pre2/i686-w64-mingw32
gauche--vport.dll
make[2]: *** [../Makefile.ext:117: install-std] エラー 70
→ main.c の argc と **argv までは正常に入ってきているもよう。
そこから ScmObj に変換するところで化けているかも。
(2017-5-13)
(50)再現スクリプトを作成
・args_test.sh
COUNT=0
while :; do
gosh -ftest args_test.scm -C -m 555 -T /c/Gauche/Gauche/../Gauche-mingw-dist/Gauche-i686/lib/gauche-0.9/0.9.6_pre2/i686-w64-mingw32 gauche--vport.dll
if [ $? -ne 0 ]; then
exit 1
fi
(( COUNT++ ))
echo -n $COUNT" "
done
・args_test.scm
(define (main args)
(define args0 (map x->string '(-C -m 555 -T C:/Gauche/Gauche/../Gauche-mingw-dist/Gauche-i686/lib/gauche-0.9/0.9.6_pre2/i686-w64-mingw32 gauche--vport.dll)))
(define args1 (cdr args))
(unless (equal? args0 args1)
(print args1)
(exit 1))
(exit 0))
(2017-5-14)
(51)2分探索で切り分ける (HEAD と 0.9.5の間)
git bisect start HEAD 449946b
39a016e 再現せず(x3000)
6fb3771 再現せず(x3000)
01667ce 再現せず(x10744) エラー(x1)
Stack Trace:
_______________________________________
0 (error "Error")
at "./args_test.scm":7
(?
?
?
q ?
C:/Gauche/Gauche/../Gauche-mingw-dist/Gauche-i686/lib/gauche-0.9/0.9.6_pre2/i686-w64-mingw32 gauche--vport.dll)
81cf7d2 再現せず(x4642) エラー(x1)
Stack Trace:
_______________________________________
0 (error "Error")
at "./args_test.scm":7
(?? ?? ??n ?? C:/Gauche/Gauche/../Gauche-mingw-dist/Gauche-i686/lib/gauche-0.9/0.9.6_pre2/i686-w64-mingw32 gauche--vport.dll)
(2017-5-14)
(60)Gauche が修正された !!
e3c684d 再現せず(x50000)
→ 問題なし。完了 !!
(2017-5-14)
(2017-5-6)(2017-5-7)(2017-5-8)(2017-5-9)(2017-5-10)
(2017-5-11)(2017-5-12)(2017-5-13)(2017-5-14)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment