ハトネコエ Web がくしゅうちょう

プログラミングやサーバー・Web制作、チームマネジメントなど得た技術のまとめ

child_info_fork::abort の原因はセキュリティソフト(Kaspersky)だった

Kaspersky、お前だったのか・・・。
下の記事の続き↓
nekonenene.hatenablog.com

もう結論は書きましたが、いちおう発見の経緯書いておきます。
この解決に丸一日つぶしてしまったよ……なんてこったい……。

rebaseall をするときに各ファイルが unreadable(読み込めない) だったり、
I-SEARCH で検索文字列を入力するたびに fork エラーを書き出すこと、
Emacs を終了するときにも fork エラーを起こすことから考えて、
どうも、ファイルへの書き出しが上手く出来なくてエラーが発生するっぽいと気付き始める。
(うちのEmacsはウィンドウサイズを覚えるために、終了時に framesize.el を吐き出すのだ)

コマンドプロンプトから ash.exe を起動して
rebaseall をおこなって unreadable なんだから、原因はやはりCygWinではない。

エラーメッセージにある「Loaded to different address: parent child」をググったところ、
このサイト(CygWin FAQ 的なの)を見つけたので、
Cygwin/X Frequently Asked Questions
そちらの9.16に書かれている

This is commonly caused by one of three things:

  • You have run Cygwin's setup program to do an update while some cygwin processes were running, and then clicked on the continue option in the "In-use files detected" dialog, and then tried to carry on using Cygwin without rebooting as advised by setup. Reboot.
  • This is one of the symptoms of an application interfering with Cygwin's fork() emulation. See the main Cygwin FAQ question for a list of software which has been known to interfere with the correct operation of Cygwin.

  • This also caused by DLLs with conflicting base addresses preventing Cygwin's fork() emulation from functioning correctly. Install the rebase package, read the README file /usr/share/doc/Cygwin/rebase-n.n.n.README, and follow the instructions there to run rebaseall. In short: stop all Cygwin processes (including services) and run rebaseall from an ash shell (not bash, which would open some DLLs, making them unwriteable) in a cmd.exe window.

3番目の方法はすでに試しているし、1番目の方法はgnupack的に無理なので、(ふつうのCygWinも入れてるけど)
2番目の方法をよく読むことにした。リンク先に飛ぶとこう書いてある。

From time to time, people have reported strange failures and problems in Cygwin and Cygwin packages that seem to have no rational explanation. Among the most common symptoms they report are fork failures, memory leaks, and file access denied problems. These problems, when they have been traced, often appear to be caused by interference from other software installed on the same PC. Security software, in particular, such as anti-virus, anti-spyware, and firewall applications, often implements its functions by installing hooks into various parts of the system, including both the Explorer shell and the underlying kernel. Sometimes these hooks are not implemented in an entirely transparent fashion, and cause changes in the behaviour which affect the operation of other programs, such as Cygwin.

CygWin でいろいろエラー発生する報告あるけど、forkエラーとかメモリリークとかアクセス拒否された場合は、
セキュリティソフトが原因なことけっこう多いよ?」とのこと。

で、思い出したんです。
たしかに以前もKasperskyが邪魔して上手く動かないことあった!! って。

結局、Kasperskyのアプリケーションコントロールが悪さをしていました。
危険と思われるアプリケーションが、他のファイルへの読み込みや書き込みすることを制限するので、
CygWinEmacsやrebaseが制限を受けてしまっていたのですね。


カスペルスキー インターネット セキュリティ 2014 で信頼リストを作成する方法
カスペルスキー インターネット セキュリティ 2015 のアプリケーションコントロールでアプリケーションの権限と保護されたリソースのプロパティを設定する方法

公式ページを参照しながら、gnupackフォルダを信頼するオブジェクトに登録して、
それから「弱い制限付き」のアプリケーションはすべて「許可」に直す
ことで、
正常に動くようになりました。
Kaspersky 2014 だと、制限を変更するところがやたら重いし、複数を一度に変更することが出来なかったので、2015にアップデートしてからこの操作はやった方がいいです)

Kaspersky、以前は「ファイアウォール」が悪さして
ホームネットワークの共有が正常に作動しない、っていう困った現象を起こしてたんだよなぁ……。
セキュリティソフト、守るのはいいけどやりすぎも、といったところ。