From: Andrea Corallo <akrl@sdf.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 41357@debbugs.gnu.org, eggert@cs.ucla.edu
Subject: bug#41357: 28.0.50; GC may miss to mark calle safe register content
Date: Sun, 17 May 2020 18:16:24 +0000 [thread overview]
Message-ID: <xjfzha68m13.fsf@sdf.org> (raw)
In-Reply-To: <835zcubg1j.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 17 May 2020 20:57:28 +0300")
Eli Zaretskii <eliz@gnu.org> writes:
>> From: Andrea Corallo <akrl@sdf.org>
>> Cc: bug-gnu-emacs@gnu.org, eggert@cs.ucla.edu
>> Date: Sun, 17 May 2020 17:45:28 +0000
>>
>> Lisp_Object
>> foo (void)
>> {
>> /* 'res' goes in a callee saved reg */
>> Lisp_Object res = build_string ("bar");
>> [...]
>> /* LTO inline the following as "flush_stack_call_func (mark_threads_callback, NULL);" */
>> mark_threads ();
>> [...]
>> gc_sweep ();
>>
>> /* The string pointed by 'res' was garbage collected. */
>> return res;
>> }
>
> But mark_threads etc. (GC in general) isn't called from functions like
> your 'foo. It is more like this:
>
> Lisp_Object
> foo (void)
> {
> /* 'res' goes in a callee saved reg */
> Lisp_Object res = build_string ("bar");
> [...]
> call_something ();
> [...]
>
> }
>
> call_something (void)
> {
> [...]
> garbage_collect ();
> [...]
> }
Yes, my example was minimal your is certanly more realistic.
But also this can be critical. We have to hope that in 'call_something'
or 'garbage_collect' there is sufficient register pressure to have the
register that is holding 'res' to be pushed.
Andrea
--
akrl@sdf.org
next prev parent reply other threads:[~2020-05-17 18:16 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-17 12:42 bug#41357: 28.0.50; GC may miss to mark calle safe register content Andrea Corallo
2020-05-17 15:36 ` Eli Zaretskii
2020-05-17 16:40 ` Andrea Corallo
2020-05-17 16:46 ` Paul Eggert
2020-05-17 17:00 ` Pip Cet
2020-05-17 19:01 ` Paul Eggert
2020-05-17 19:19 ` Eli Zaretskii
2020-05-17 20:23 ` Andrea Corallo
2020-05-17 21:03 ` Paul Eggert
2020-05-17 17:04 ` Eli Zaretskii
2020-05-17 17:21 ` Andrea Corallo
2020-05-17 17:28 ` Eli Zaretskii
2020-05-17 21:27 ` Paul Eggert
2020-05-17 21:47 ` Andrea Corallo
2020-05-17 17:04 ` Eli Zaretskii
2020-05-17 17:08 ` Paul Eggert
2020-05-17 17:24 ` Eli Zaretskii
2020-05-17 19:05 ` Paul Eggert
2020-05-17 19:26 ` Eli Zaretskii
2020-05-17 19:46 ` Andrea Corallo
2020-05-17 21:21 ` Paul Eggert
2020-05-17 17:13 ` Andrea Corallo
2020-05-17 17:22 ` Eli Zaretskii
2020-05-17 17:45 ` Andrea Corallo
2020-05-17 17:57 ` Eli Zaretskii
2020-05-17 18:16 ` Andrea Corallo [this message]
2020-05-25 2:09 ` Tom Tromey
2020-05-25 8:37 ` Andrea Corallo
2020-05-28 22:08 ` Paul Eggert
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=xjfzha68m13.fsf@sdf.org \
--to=akrl@sdf.org \
--cc=41357@debbugs.gnu.org \
--cc=eggert@cs.ucla.edu \
--cc=eliz@gnu.org \
/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.