[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Write access to pure space in dumped executable

From: Stefan Monnier
Subject: Re: Write access to pure space in dumped executable
Date: Tue, 01 Feb 2011 17:42:16 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

>>>>> "YAMAMOTO" == YAMAMOTO Mitsuharu <address@hidden> writes:

> I found a few types of write access to the pure space in the normal
> execution of the dumped one:

> 1. pure_cons calls from init_process (process.c).

> 2. XSETCAR/XSETCDR in the CHECK_CHARACTER_CAR/CDR macros (character.h).

>    What are these XSETCAR/XSETCDR for?

Can someone take a look at the ones above?

> 3. write access to empty_unibyte/multibyte_string (lisp.h, alloc.c)

>    If the length of the string to be allocated is 0,
>    make_uninit_string (or make_uninit_multibyte_string) returns
>    empty_unibyte_string (or empty_multibyte_string, respectively),
>    which is allocated in the pure space.  So,

>    3.1. STRING_SET_UNIBYTE tries to write the `size_byte member' of
>         struct Lisp_String when the arg STR is actually
>         empty_unibyte_string.

>    3.2. `*p = 0;' around the end of Fmake_string tries to write the
>         string data of these empty strings if the arg LENGTH is 0.

While writing to pure space is a problem, at least these last two cases
end up writing the value that's already there, so the writes are
"no-ops" (which may still trigger access violations, or copy-on-write,


reply via email to

[Prev in Thread] Current Thread [Next in Thread]