From: "Marc Nieper-Wißkirchen" <marc.nieper+gnu@gmail.com>
To: Andrea Corallo <andrea.corallo@arm.com>
Cc: "Marc Nieper-Wißkirchen" <marc.nieper+gnu@gmail.com>,
"Marc Nieper-Wißkirchen via Jit" <jit@gcc.gnu.org>,
"Alex Coplan" <Alex.Coplan@arm.com>,
"Mark Wielaard" <mark@klomp.org>
Subject: Re: Memory leaks (detected by Valgrind)
Date: Fri, 17 Dec 2021 18:53:45 +0100 [thread overview]
Message-ID: <CAEYrNrTPxHQ=ri0t2m1PPQx-Dzk-wZD70s8sVoKz+2BZb5kkxw@mail.gmail.com> (raw)
In-Reply-To: <gkrr1abw6z5.fsf@arm.com>
Am Fr., 17. Dez. 2021 um 17:07 Uhr schrieb Andrea Corallo <
andrea.corallo@arm.com>:
> Marc Nieper-Wißkirchen <marc.nieper+gnu@gmail.com> writes:
>
> > Am Fr., 17. Dez. 2021 um 15:54 Uhr schrieb Andrea Corallo <mailto:
> andrea.corallo@arm.com>:Marc Nieper-Wißkirchen via Jit <mailto:
> jit@gcc.gnu.org> writes:
> >
> >> Am Fr., 17. Dez. 2021 um 11:52 Uhr schrieb Alex Coplan <mailto:
> Alex.Coplan@arm.com
> >>>:
> >>
> >>> Hi,
> >>>
> >>> > -----Original Message-----
> >>> > From: Jit <jit-bounces+alex.coplan=mailto:arm.com@gcc.gnu.org> On
> Behalf Of
> >>> Marc
> >>> > Nieper-Wißkirchen via Jit
> >>> > Sent: 17 December 2021 10:29
> >>> > To: Mark Wielaard <mailto:mark@klomp.org>
> >>> > Cc: Marc Nieper-Wißkirchen <mailto:marc.nieper%2Bgnu@gmail.com>;
> mailto:jit@gcc.gnu.org
> >>> > Subject: Re: Memory leaks (detected by Valgrind)
> >>> >
> >>> > Thanks!
> >>> >
> >>> > With `--enable-valgrind-annotations`, the "uses of uninitialized
> values"
> >>> > have gone away, but a lot of small leaks are still present:
> >>>
> >>> Memory leaks with libgccjit are a known issue, see
> >>> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63854
> >>
> >>
> >> Oh, that the bug has been open so long and is still open is unfortunate
> as
> >> a process using libgccjit usually lasts a lot longer than a single
> compiler
> >> run by gcc.
> >
> > This weakens the usefulness of libgccjit considerably, doesn't it?
>
> Agree, IMO it does.
>
> > If I have to start a new process to invoke it, only a bit is won
> > compared to writing out C and using the C frontend of GCC through
> > exec, no?
>
> Correct. We leave with that also because we use subprocesses to obtain
> parallelism (we have no posix thread exposure in Elisp) *and* in any
> case we would not be able to backport the hypothetical fix to old
> distros.
>
Speaking of parallelism: When I tried to find where the memory losses come
from, I saw a lot of global variables like `link_command_spec' in `gcc.c'.
Does it mean that compiling the context is not thread-safe? (I may have
missed that in libgccjit's documentation.)
> > How to you pass back the result of the compilation from the
> > subprocess to the original process in Emacs?
>
> For us it's easy as the output of the compilation is a file (we'll reuse
> it in different sessions).
>
> > PS How difficult is it to fix the memory leaks?
>
> Good question.
>
> Andrea
> IMPORTANT NOTICE: The contents of this email and any attachments are
> confidential and may also be privileged. If you are not the intended
> recipient, please notify the sender immediately and do not disclose the
> contents to any other person, use it for any purpose, or store or copy the
> information in any medium. Thank you.
>
next prev parent reply other threads:[~2021-12-17 17:53 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-16 17:17 Marc Nieper-Wißkirchen
2021-12-16 22:00 ` Marc Nieper-Wißkirchen
2021-12-16 22:26 ` Mark Wielaard
2021-12-17 10:29 ` Marc Nieper-Wißkirchen
2021-12-17 10:52 ` Alex Coplan
2021-12-17 14:03 ` Marc Nieper-Wißkirchen
2021-12-17 14:54 ` Andrea Corallo
2021-12-17 15:11 ` Marc Nieper-Wißkirchen
2021-12-17 16:07 ` Andrea Corallo
2021-12-17 17:53 ` Marc Nieper-Wißkirchen [this message]
2021-12-17 18:48 ` Andrea Corallo
2021-12-17 23:22 ` David Malcolm
2021-12-18 13:57 ` Marc Nieper-Wißkirchen
2021-12-18 16:45 ` David Malcolm
2021-12-18 17:50 ` Marc Nieper-Wißkirchen
2021-12-18 19:36 ` Marc Nieper-Wißkirchen
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='CAEYrNrTPxHQ=ri0t2m1PPQx-Dzk-wZD70s8sVoKz+2BZb5kkxw@mail.gmail.com' \
--to=marc.nieper+gnu@gmail.com \
--cc=Alex.Coplan@arm.com \
--cc=andrea.corallo@arm.com \
--cc=jit@gcc.gnu.org \
--cc=mark@klomp.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).