unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: 59365@debbugs.gnu.org, Greg Hogan <code@greghogan.com>,
	Marius Bakke <marius@gnu.org>
Subject: bug#59365: make-dynamic-linker-cache OOMs for LLVM 15 on i686-linux
Date: Tue, 22 Nov 2022 05:22:48 -0500	[thread overview]
Message-ID: <874jurp9tz.fsf@gmail.com> (raw)
In-Reply-To: <877cznidn8.fsf@gnu.org> ("Ludovic Courtès"'s message of "Tue, 22 Nov 2022 09:42:19 +0100")

Hi Ludovic,

Ludovic Courtès <ludo@gnu.org> writes:

> Hi,
>
> (Cc: Maxim and Greg for LLVM packaging questions below.)
>
> Marius Bakke <marius@gnu.org> skribis:
>
>> LLVM 15.0.4 fails on i686-linux:
>>
>>   https://ci.guix.gnu.org/build/1702995/details
>>
>> Because the 'make-dynamic-linker-cache' phase runs out of memory:
>>
>>   starting phase `make-dynamic-linker-cache'
>>   GC Warning: Repeated allocation of very large block (appr. size 268439552):
>> 	May lead to memory leak and poor performance
>>   GC Warning: Repeated allocation of very large block (appr. size 134221824):
>> 	May lead to memory leak and poor performance
>>   GC Warning: Repeated allocation of very large block (appr. size 268439552):
>>   	May lead to memory leak and poor performance
>>   GC Warning: Failed to expand heap by 285216768 bytes
>>   GC Warning: Failed to expand heap by 268439552 bytes
>>   GC Warning: Out of Memory! Heap size: 3620 MiB. Returning NULL!
>>   Warning: Unwind-only out of memory exception; skipping pre-unwind handler.
>>   Warning: Unwind-only out of memory exception; skipping pre-unwind handler.
>>   Warning: Unwind-only out of memory exception; skipping pre-unwind handler.
>>
>> (excerpt from https://ci.guix.gnu.org/build/1702995/log/raw)
>>
>> Not sure why this phase uses so much memory.  Ideas?
>
> Yes: the gremlin.scm code uses ‘file-dynamic-info’, which loads the
> whole file in memory.  Ridiculous.

If it loaded just that file, it should be fine, no?  It weighs 133 MiB,
as you've shown below:

> But the crux of the problem is that llvm@15 has a single huge shared
> library, unlike previous versions:
>
> $ du -hL  /gnu/store/bgqdvvi7k6l255332rfawgjmn2hpn13r-llvm-15.0.4/lib/*.so
> 133M    /gnu/store/bgqdvvi7k6l255332rfawgjmn2hpn13r-llvm-15.0.4/lib/libLLVM-15.0.4.so
> 96K     /gnu/store/bgqdvvi7k6l255332rfawgjmn2hpn13r-llvm-15.0.4/lib/libLTO.so
> 16K     /gnu/store/bgqdvvi7k6l255332rfawgjmn2hpn13r-llvm-15.0.4/lib/libRemarks.so
> (It also has tons of .a files, which shouldn’t be there.)

The static files are needed at least to build the clang runtime.  I had
tried to get rid of them without success.  Perhaps they could be moved
to a "static" output if they're needed only at that time.

> Is that big LLVM.so due to different build options on our side?  Or is
> it a radical upstream change (sounds unlikely, but who knows)?

It's caused by -DLLVM_LINK_LLVM_DYLIB=ON and -DLLVM_BUILD_LLVM_DYLIB=ON,
which is the supported configuration to build a shared library of LLVM
(-DBUILD_SHARED_LIBS=ON is obsolete/deprecated) [0].

It also makes things conveniently easy to link to LLVM; you just need to
link to '-lLLVM', and everything it needs is available.

[0]  https://llvm.org/docs/BuildingADistribution.html#special-notes-for-library-only-distributions

-- 
Thanks,
Maxim




  reply	other threads:[~2022-11-22 10:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-18 18:41 bug#59365: make-dynamic-linker-cache OOMs for LLVM 15 on i686-linux Marius Bakke
2022-11-22  8:42 ` Ludovic Courtès
2022-11-22 10:22   ` Maxim Cournoyer [this message]
2023-11-20 19:33     ` Maxim Cournoyer
2024-04-12  9:35   ` Ludovic Courtès

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

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874jurp9tz.fsf@gmail.com \
    --to=maxim.cournoyer@gmail.com \
    --cc=59365@debbugs.gnu.org \
    --cc=code@greghogan.com \
    --cc=ludo@gnu.org \
    --cc=marius@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 public inbox

	https://git.savannah.gnu.org/cgit/guix.git

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).