bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#30364: 26.0.91; thread crash on macos


From: Aaron Jensen
Subject: bug#30364: 26.0.91; thread crash on macos
Date: Sun, 18 Feb 2018 11:49:45 -0800

On Sun, Feb 18, 2018 at 11:32 AM, Eli Zaretskii <address@hidden> wrote:
> A thread that runs Lisp can continue running Lisp for a long time, and
> will generate a lot of garbage.  If GC is prevented, we will risk
> running out of memory.
>
> IOW, leaving GC for the main thread only makes sense if we can be sure
> the main thread will run shortly.  But that cannot be guaranteed with
> the current thread model, where a thread must exit or yield before
> another thread can run.

I was actually imagining that when a thread needed a GC it would
request that the GC be done on the main thread (blocking while it
waits). I have no idea how difficult that would be to implement.

> If threads get only 512KB of stack, it's a small wonder that they
> crash in GC.  IME, you need at least 3MB to endure a full GC in Emacs.

I upped the required stack size to 5MB and it fixed the crash for me.
I don't know what the right size should bed, I could go w/ the 3MB you
call out here, but I went a little higher to be safe. See attached
patch. I'm assuming that pthread_attr_setstacksize is available
everywhere pthread is. I don't know if that's an ok assumption or not.

> What do you mean by "one thread at a time"?  How was your program
> changed for this run?

I just meant that I C-x C-e on (company-dabbrev-thread "e" (lambda
(words) (message "%S" words))), waited, did it again, etc, until
crash.

Aaron

Attachment: 0001-Require-at-least-5MB-stack-size-for-a-thread-bug-303.patch
Description: Binary data


reply via email to

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