From: "Gerd Möllmann" <gerd.moellmann@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Ihor Radchenko <yantar92@posteo.net>,
eller.helmut@gmail.com, emacs-devel@gnu.org
Subject: Re: MPS make-thread
Date: Sun, 23 Jun 2024 05:18:06 +0200 [thread overview]
Message-ID: <m2le2wcpox.fsf@pro2.fritz.box> (raw)
In-Reply-To: <86sex4g53k.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 22 Jun 2024 22:17:03 +0300")
Eli Zaretskii <eliz@gnu.org> writes:
>> From: Ihor Radchenko <yantar92@posteo.net>
>> Cc: Helmut Eller <eller.helmut@gmail.com>, Eli Zaretskii <eliz@gnu.org>,
>> emacs-devel@gnu.org
>> Date: Sat, 22 Jun 2024 18:52:25 +0000
>>
>> Gerd Möllmann <gerd.moellmann@gmail.com> writes:
>>
>> >> thix.c:67: Emacs fatal error: assertion failed: SigCheck Thread: thread
>> >> Fatal error 6: Aborted
>> >
>> > Any chance to make this reproducible? Maybe by adding calls to
>> > (igc--collect) in various places? I don't know what you are doing...
>>
>> (progn
>> (defvar *baz* nil)
>> (defun bar (len)
>> (let ((data (make-list len nil)))
>> (setq *baz* (lambda () (bar len) data))))
>> (defun foo ()
>> (bar 1000)
>> (dotimes (_ 10000)
>> (funcall *baz*)))
>> (thread-join (make-thread (lambda () (igc--collect))))
>> (foo))
>
> I get a crash only after running this several times. It looks like
> this:
>
> ss.c:66: Emacs fatal error: assertion failed: warmest < stackCold
AFAIR, MPS calls the bottom of a control stack "cold". Warmest could
then be the other end of the stack. And that's x86, so the stack grows
down to lower addresses, so that could make sense. Just guessing of course.
> lockw3.c:98: Emacs fatal error: assertion failed: lock->claims == 0
And the typical followup crash from using MPS when it already has
crashed.
> #27 StackScan (ss=0x1fc5fb70, stackCold=0x1edeff28, scan_area=0x2c11f9 <scan_ambig>, closure=0x0) at ss.c:66
> #28 0x003c7494 in RootScan (ss=ss@entry=0x1fc5fb70, root=root@entry=0xa60e83c) at root.c:577
> #29 0x003c7d1d in traceScanRootRes (ts=ts@entry=1, rank=rank@entry=0, arena=arena@entry=0x7100000, root=root@entry=0xa60e83c) at trace.c:528
> #30 0x003c8118 in traceScanRoot (root=0xa60e83c, arena=0x7100000, rank=0, ts=1) at trace.c:545
No further clue from the backtrace.
> We must do something about these assertions: when there's an assertion
> violation caused by a thread which was started by MPS, we cannot call
> shut_down_emacs in that thread's context, for obvious reasons. We
> must instead set some flag which will cause the main thread or one of
> the other Lisp threads call shut_down_emacs. The MPS documentation
> says:
>
> Warning: The installed assertion handler must not call any
> function in MPS, and it must not access memory managed by the
> MPS.
>
> But our handler, igc_assert_fail, does exactly what they say not to
> do.
I know. See the comment above that function.
One idea might be to set aside a block of memory for use when we know
that MPS is unusable. Then, make alloc_impl allocate from that block,
and probably we must put MPS in postmortem state. Or maybe we can just
use malloc in alloc_impl.
I think one should try something like that so that Emacs can do its
thing as usual in such cases. Can of course fail, and will certainly be
fiddly. I currently don't have the energy to do that.
> And what does "warmest < stackCold" mean, in human-understandable
> terms, anyway?
At night it's colder than outside :-). Who knows?
next prev parent reply other threads:[~2024-06-23 3:18 UTC|newest]
Thread overview: 106+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-20 19:25 MPS: profiler Ihor Radchenko
2024-06-20 19:40 ` Eli Zaretskii
2024-06-20 19:48 ` Ihor Radchenko
2024-06-20 19:58 ` Gerd Möllmann
2024-06-20 20:29 ` Ihor Radchenko
2024-06-21 5:57 ` Gerd Möllmann
2024-06-21 6:17 ` Eli Zaretskii
2024-06-21 6:54 ` Gerd Möllmann
2024-06-21 7:16 ` Eli Zaretskii
2024-06-21 7:32 ` Gerd Möllmann
2024-06-21 7:19 ` Helmut Eller
2024-06-21 7:36 ` Ihor Radchenko
2024-06-21 7:44 ` Helmut Eller
2024-06-21 7:51 ` Gerd Möllmann
2024-06-21 8:21 ` Helmut Eller
2024-06-21 8:31 ` Gerd Möllmann
2024-06-21 10:45 ` Eli Zaretskii
2024-06-21 11:47 ` Gerd Möllmann
2024-06-21 12:01 ` Helmut Eller
2024-06-21 12:09 ` Ihor Radchenko
2024-06-21 12:42 ` Helmut Eller
2024-06-21 12:51 ` Ihor Radchenko
2024-06-21 14:49 ` MPS make-thread (was: MPS: profiler) Helmut Eller
2024-06-21 15:20 ` MPS make-thread Gerd Möllmann
2024-06-21 15:33 ` Gerd Möllmann
2024-06-21 15:42 ` Helmut Eller
2024-06-21 16:46 ` Gerd Möllmann
2024-06-21 18:31 ` Gerd Möllmann
2024-06-21 19:58 ` Ihor Radchenko
2024-06-21 20:10 ` Gerd Möllmann
2024-06-22 18:52 ` Ihor Radchenko
2024-06-22 19:17 ` Eli Zaretskii
2024-06-23 3:18 ` Gerd Möllmann [this message]
2024-06-23 4:54 ` Gerd Möllmann
2024-06-23 6:19 ` Eli Zaretskii
2024-06-23 5:53 ` Eli Zaretskii
2024-06-23 6:45 ` Gerd Möllmann
2024-06-23 8:53 ` Eli Zaretskii
2024-06-23 9:36 ` Gerd Möllmann
2024-06-23 10:21 ` Gerd Möllmann
2024-06-23 10:27 ` Gerd Möllmann
2024-06-23 13:19 ` Eli Zaretskii
2024-06-23 14:16 ` Gerd Möllmann
2024-06-26 11:20 ` Ihor Radchenko
2024-06-26 11:25 ` Gerd Möllmann
2024-06-22 19:26 ` Gerd Möllmann
2024-06-22 6:29 ` Eli Zaretskii
2024-06-22 18:53 ` Ihor Radchenko
2024-06-22 19:04 ` Eli Zaretskii
2024-06-22 19:17 ` Ihor Radchenko
2024-06-22 18:13 ` Helmut Eller
2024-06-22 18:31 ` Gerd Möllmann
2024-06-25 18:42 ` MPS native subrs (was: MPS make-thread) Helmut Eller via Emacs development discussions.
2024-06-25 20:10 ` MPS native subrs Gerd Möllmann
2024-06-25 20:48 ` Gerd Möllmann
2024-06-26 6:31 ` Helmut Eller
2024-06-26 7:00 ` Gerd Möllmann
2024-06-26 13:45 ` Eli Zaretskii
2024-06-26 14:18 ` Gerd Möllmann
2024-06-26 15:15 ` Helmut Eller
2024-06-26 17:12 ` Gerd Möllmann
2024-06-26 13:30 ` Eli Zaretskii
2024-06-26 13:34 ` Eli Zaretskii
2024-06-26 4:55 ` Gerd Möllmann
2024-06-26 13:36 ` Eli Zaretskii
2024-06-26 13:26 ` MPS native subrs (was: MPS make-thread) Eli Zaretskii
2024-06-26 14:41 ` MPS native subrs Andrea Corallo
2024-06-21 12:43 ` MPS: profiler Gerd Möllmann
2024-06-21 16:11 ` Ihor Radchenko
2024-06-21 12:41 ` Gerd Möllmann
2024-06-21 14:10 ` Eli Zaretskii
2024-06-21 16:09 ` Ihor Radchenko
2024-06-21 16:22 ` Gerd Möllmann
2024-06-21 18:51 ` Ihor Radchenko
2024-06-21 18:58 ` Gerd Möllmann
2024-06-21 19:23 ` Ihor Radchenko
2024-06-21 19:50 ` Gerd Möllmann
2024-06-21 20:02 ` Ihor Radchenko
2024-06-22 6:37 ` Eli Zaretskii
2024-06-21 7:43 ` Gerd Möllmann
2024-06-21 7:50 ` Ihor Radchenko
2024-06-21 7:53 ` Gerd Möllmann
2024-06-21 10:39 ` Eli Zaretskii
2024-06-21 10:57 ` Ihor Radchenko
2024-06-21 10:58 ` Eli Zaretskii
2024-06-21 11:20 ` Ihor Radchenko
2024-06-21 11:29 ` Eli Zaretskii
2024-06-21 11:33 ` Gerd Möllmann
2024-06-21 19:55 ` Dmitry Gutov
2024-06-21 16:12 ` Ihor Radchenko
2024-06-21 18:48 ` Eli Zaretskii
2024-06-21 10:49 ` Pip Cet
2024-06-21 10:56 ` Eli Zaretskii
2024-06-21 5:56 ` Eli Zaretskii
2024-06-21 6:14 ` Ihor Radchenko
2024-06-20 19:50 ` Gerd Möllmann
2024-06-20 20:02 ` Ihor Radchenko
2024-06-21 5:58 ` Eli Zaretskii
2024-06-21 6:16 ` Ihor Radchenko
2024-06-21 8:23 ` Pip Cet
2024-06-21 8:43 ` Ihor Radchenko
2024-06-21 8:50 ` Gerd Möllmann
2024-06-21 10:43 ` Eli Zaretskii
2024-06-21 11:00 ` Pip Cet
2024-06-21 11:09 ` Eli Zaretskii
2024-06-21 11:39 ` Gerd Möllmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m2le2wcpox.fsf@pro2.fritz.box \
--to=gerd.moellmann@gmail.com \
--cc=eliz@gnu.org \
--cc=eller.helmut@gmail.com \
--cc=emacs-devel@gnu.org \
--cc=yantar92@posteo.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.