summaryrefslogtreecommitdiff
path: root/etc/DEBUG
diff options
context:
space:
mode:
Diffstat (limited to 'etc/DEBUG')
-rw-r--r--etc/DEBUG41
1 files changed, 35 insertions, 6 deletions
diff --git a/etc/DEBUG b/etc/DEBUG
index 181e24e0057..4eae090621f 100644
--- a/etc/DEBUG
+++ b/etc/DEBUG
@@ -864,11 +864,6 @@ in your ~/.emacs file. When the problem happens, exit the Emacs that
you were running, kill it, and rename the two files. Then you can start
another Emacs without clobbering those files, and use it to examine them.
-An easy way to see if too much text is being redrawn on a terminal is to
-evaluate '(setq inverse-video t)' before you try the operation you think
-will cause too much redrawing. This doesn't refresh the screen, so only
-newly drawn text is in inverse video.
-
** Debugging LessTif
If you encounter bugs whereby Emacs built with LessTif grabs all mouse
@@ -933,7 +928,10 @@ data that is modified only very rarely.)
It is also useful to look at the corrupted object or data structure in
a fresh Emacs session and compare its contents with a session that you
-are debugging.
+are debugging. This might be somewhat harder on modern systems which
+randomize addresses of running executables (the so-called Address
+Space Layout Randomization, or ASLR, feature). If you have this
+problem, see below under "How to disable ASLR".
** Debugging the TTY (non-windowed) version
@@ -1085,6 +1083,37 @@ suppresses some Valgrind false alarms during Emacs garbage collection:
Unfortunately Valgrind suppression files tend to be system-dependent,
so you will need to keep one around that matches your system.
+** How to disable ASLR
+
+Modern systems use the so-called Address Space Layout Randomization,
+(ASLR) feature, which randomizes the base address of running programs,
+making it harder for malicious software or hackers to find the address
+of some function or variable in a running program by looking at its
+executable file. This causes the address of the same symbol to be
+different across rerunning of the same program. Sometimes, it can be
+useful to disable ASLR, for example, if you want to compare objects in
+two different Emacs sessions.
+
+On GNU/Linux, you can disable ASLR temporarily with the following
+shell command:
+
+ echo 0 > /proc/sys/kernel/randomize_va_space
+
+or by running Emacs in an environment where ASLR is temporarily
+disabled:
+
+ setarch -R emacs [args...]
+
+To disable ASLR in Emacs on MS-Windows, you will have to rebuild Emacs
+while adding '-Wl,-disable-dynamicbase' to LD_SWITCH_SYSTEM_TEMACS
+variable defined in src/Makefile. Alternatively, use some tool to
+edit the PE header of the Emacs executable file and reset the
+DYNAMIC_BASE (0x40) flag in the DllCharacteristics flags recorded by
+the PE header.
+
+On macOS, there's no official way for disabling ASLR, but there are
+various hacks that can be found by searching the Internet.
+
** How to recover buffer contents from an Emacs core dump file
The file etc/emacs-buffer.gdb defines a set of GDB commands for