emacs-devel
[Top][All Lists]
Advanced

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

Re: Possible memory corruption problem


From: Richard M. Stallman
Subject: Re: Possible memory corruption problem
Date: Sun, 12 Feb 2006 23:40:51 -0500

    I'd rather suspect something else: that some library function on your
    platform is passed a pointer to buffer text, and that library function
    calls malloc internally, which (especially when Emacs needs to
    allocate a large amount of memory) causes Emacs to relocate buffer
    text, which could easily invalidate the pointer(s) used by that
    library function.

It is very rare in Emacs to pass a library function a pointer to
buffer text.  And in most cases these library functions are low-level,
such as memcpy, read, or write.  They should not call malloc.

Is there any place where Emacs calls other C library functions
on buffer text?

    > I have tried to find the common circumstances when this happens and it
    > aeems to me that it happens when the machine is low on virtual memory
    > (including swap space).

    Emacs should display a warning when the system is low on memory.  Does
    it?

Emacs tries to estimate how much memory is available, but that estimate
may not really work.  For instance, it never works for me.
The code to estimate available space worked in the 80s on Unix,
but it may need adaptation to the systems of today.




reply via email to

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