2

Windows Bash (WinBash? Win-Bash?) 内で emacs-24.4 をコンパイルしようとしていますが、Windows でメモリ保護が有効になっているようで、emacs ビルドが壊れるという問題が発生しています。

「make」の後に表示されるエラー (./configure は正常に動作します) は次のとおりです。

Dumping under the name emacs
**************************************************
Warning: Your system has a gap between BSS and the
heap (25164600 bytes).  This usually means that exec-shield
or something similar is in effect.  The dump may
fail because of this.  See the section about
exec-shield in etc/PROBLEMS for more information.
**************************************************
/bin/bash: line 7:  6853 Segmentation fault      (core dumped) ./temacs --batch --load loadup bootstrap
make[1]: *** [bootstrap-emacs] Error 1
make[1]: Leaving directory `/home/tdwyer/bin/emacs-24.5_linux_build/src'
make: *** [src] Error 2

etc/PROBLEMS ファイルでは、関連するセクションに次のように記載されています。

*** Segfault during `make bootstrap' under the Linux kernel.

In Red Hat Linux kernels, "Exec-shield" functionality is enabled by
default, which creates a different memory layout that can break the
emacs dumper.  Emacs tries to handle this at build time, but if this
fails, the following instructions may be useful.

Exec-shield is enabled on your system if

    cat /proc/sys/kernel/exec-shield

prints a value other than 0.  (Please read your system documentation
for more details on Exec-shield and associated commands.)

Additionally, Linux kernel versions since 2.6.12 randomize the virtual
address space of a process by default.  If this feature is enabled on
your system, then

   cat /proc/sys/kernel/randomize_va_space

prints a value other than 0.

When these features are enabled, building Emacs may segfault during
the execution of this command:

    ./temacs --batch --load loadup [dump|bootstrap]

To work around this problem, you can temporarily disable these
features while building Emacs.  You can do so using the following
commands (as root).  Remember to re-enable them when you are done,
by echoing the original values back to the files.

    echo 0 > /proc/sys/kernel/exec-shield
    echo 0 > /proc/sys/kernel/randomize_va_space

Or, on x86, you can try using the `setarch' command when running
temacs, like this:

    setarch i386 -R ./temacs --batch --load loadup [dump|bootstrap]

or

    setarch i386 -R make

(The -R option disables address space randomization.)

そして、当然のことながら、有効になっているかどうかを確認すると、次のようになります。

$ cat /proc/sys/kernel/randomize_va_space
2

残念ながら、無効にしようとしましたが (管理者として bash を実行していても)、失敗します:

$ sudo echo 0 > /proc/sys/kernel/randomize_va_space
bash: /proc/sys/kernel/randomize_va_space: Permission denied

さらに、 setarch は以下を使用しても機能しません:

setarch x86_84 -R make 

提案?

4

1 に答える 1

4

次の手順を確認してください: https://askubuntu.com/questions/318315/how-can-i-temporarily-disable-aslr-address-space-layout-randomization

重要な部分:

無効にするには、実行します

echo 0 | sudo tee /proc/sys/kernel/randomize_va_space

再度有効にするには、実行します

echo 2 | sudo tee /proc/sys/kernel/randomize_va_space
于 2016-08-18T19:36:54.010 に答える