Linuxbrew / legacy-linuxbrew

:skull: This repository is defunct, because it has been split into https://github.com/Linuxbrew/brew and https://github.com/Linuxbrew/homebrew-core
http://linuxbrew.sh
Other
2.23k stars 295 forks source link

Inconsistency detected by ld.so: dl-close.c: 759: _dl_close: Assertion `map->l_init_called' failed! #898

Closed albertz closed 8 years ago

albertz commented 8 years ago

After I installed Glibc, I get all the time this error/warning whenever I start any command which was installed by Linuxbrew:

Inconsistency detected by ld.so: dl-close.c: 759: _dl_close: Assertion `map->l_init_called' failed!

Full output of Glibc installation:

zeyer@sulfid ~> brew install glibc
==> Downloading http://ftpmirror.gnu.org/glibc/glibc-2.19.tar.bz2
Already downloaded: /u/zeyer/.cache/Homebrew/glibc-2.19.tar.bz2
==> ../configure --disable-debug --disable-dependency-tracking --disable-silent-rules --prefix=/work/asr2/zeyer/linuxbrew/Ce
==> make
==> make install
Warning: The post-install step did not complete successfully
You can try again using `brew postinstall glibc`
==> Summary
/work/asr2/zeyer/linuxbrew/Cellar/glibc/2.19: 1,364 files, 40.0M, built in 4 minutes 31 seconds
zeyer@sulfid ~> brew postinstall glibc
Inconsistency detected by ld.so: dl-close.c: 759: _dl_close: Assertion `map->l_init_called' failed!
Error: can't convert String into Integer
Please report this bug:
    https://github.com/Linuxbrew/linuxbrew/blob/master/share/doc/homebrew/Troubleshooting.md#troubleshooting
/usr/lib/ruby/1.8/fileutils.rb:1223:in `chmod'
/usr/lib/ruby/1.8/fileutils.rb:1223:in `chmod'
/usr/lib/ruby/1.8/fileutils.rb:876:in `chmod'
/usr/lib/ruby/1.8/fileutils.rb:875:in `each'
/usr/lib/ruby/1.8/fileutils.rb:875:in `chmod'
/work/asr2/zeyer/linuxbrew/Library/Formula/glibc.rb:39:in `post_install'
/work/asr2/zeyer/linuxbrew/Library/Homebrew/formula.rb:817:in `run_post_install'
/work/asr2/zeyer/linuxbrew/Library/Homebrew/postinstall.rb:16

Then I updated Linuxbrew and it fixed this:

zeyer@sulfid ~> brew update
Inconsistency detected by ld.so: dl-close.c: 759: _dl_close: Assertion `map->l_init_called' failed!
Checking out files: 100% (931/931), done.
Updated Homebrew from 1d35a34 to f886abd.
Checking out files: 100% (52/52), done.
Updated 2 taps (homebrew/science, homebrew/dupes).
==> New Formulae
...
==> Deleted Formulae
phash                          synfigstudio                   telepathy-glib                 telepathy-mission-control    
rubber                         telepathy-gabble               telepathy-idle                 why3                         
zeyer@sulfid ~> brew update
Inconsistency detected by ld.so: dl-close.c: 759: _dl_close: Assertion `map->l_init_called' failed!
Inconsistency detected by ld.so: Inconsistency detected by ld.so: dl-close.c: 759: _dl_close: Assertion `map->l_init_called' failed!
dl-close.c: 759: _dl_close: Assertion `map->l_init_called' failed!
Inconsistency detected by ld.so: dl-close.c: 759: _dl_close: Assertion `map->l_init_called' failed!
Already up-to-date.
zeyer@sulfid ~> brew postinstall glibc
Inconsistency detected by ld.so: dl-close.c: 759: _dl_close: Assertion `map->l_init_called' failed!
==> /work/asr2/zeyer/linuxbrew/Cellar/glibc/2.19/bin/localedef -i en_US -f UTF-8 en_US.UTF-8
zeyer@sulfid ~> brew doctor
Inconsistency detected by ld.so: dl-close.c: 759: _dl_close: Assertion `map->l_init_called' failed!
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry and just ignore them. Thanks!

Warning: Setting LD_* vars can break dynamic linking.
Set variables:
    LD_LIBRARY_PATH: /usr/lib32:/usr/local/lib:/usr/local/cuda-6.5/lib64

Warning: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and what additional flags to use when
compiling and linking.

When I unlink Glibc (brew unlink glibc), this error goes away.

sjackman commented 8 years ago
brew doctor
Inconsistency detected by ld.so: dl-close.c: 759: _dl_close: Assertion `map->l_init_called' failed!
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry and just ignore them. Thanks!

Warning: Setting LD_* vars can break dynamic linking.
Set variables:
    LD_LIBRARY_PATH: /usr/lib32:/usr/local/lib:/usr/local/cuda-6.5/lib64

Unset LD_LIBRARY_PATH as brew doctor recommends will likely fix your issue.

albertz commented 8 years ago

But I need this LD_LIBRARY_PATH so that my environment works properly.

sjackman commented 8 years ago

If you're on a 32-bit system, adding /usr/lib32 to your LD_LIBRARY_PATH is going to create much trouble. Can you try removing unnecessary directories from your LD_LIBRARY_PATH? Try

export LD_LIBRARY_PATH=/usr/local/cuda-6.5/lib64
sjackman commented 8 years ago

Which tools are you using that require that LD_LIBRARY_PATH be set like so?

albertz commented 8 years ago

There are some custom and proprietary tools installed in /usr/local, also CUDA, and I have some research software which e.g. links to CUDA, and I must work with them all the time, so I have them in my LD_LIBRARY_PATH.

sjackman commented 8 years ago

You can try setting export HOMEBREW_BUILD_FROM_SOURCE=1. It will prevent glibc from being installed.

albertz commented 8 years ago

Yes, that works.

But I wonder, this bug is not really fixed then? Maybe I want to use the newer Glibc via Linuxbrew.

sjackman commented 8 years ago

Instead of using LD_LIBRARY_PATH, consider instead editing /etc/ld.so.conf and run ldconfig after.

albertz commented 8 years ago

I don't have root access so I cannot edit /etc/ld.so.conf.

sjackman commented 8 years ago

Which of the three directories in the LD_LIBRARY_PATH is causing the trouble with installing glibc? I suspect /usr/lib32, but it could also be /usr/local/lib.

al-the-x commented 8 years ago

@albertz You might also consider using direnv to prepend to LD_LIBRARY_PATH when you enter your project directory. When you need to install packages, merely disable the environment and rename when done.

DoomHammer commented 8 years ago

I have been bitten by this before and haven't found a good workaround as yet.

I would like to have a self-contained installation of Linuxbrew. Steps are following (illustrated here: https://github.com/DoomHammer/brewstrap/pull/7/files#diff-a4a8b02a861c11cadeebb2a3a5f799fcR55 ):

  1. Install essentials like gcc, binutils and make
  2. Install glibc
  3. Hopefully compile a new working glibc as bottled one is not relocatable. Actually, all brewed software ceases to work.

I tried building glibc having other C runtime installed (like musl) but funny thing is glibc requires glibc to build.

This bug is essentially the last blocker to enabling a fully standalone, system-independent and prefix-independent Linuxbrew.

albertz commented 8 years ago

I now tried to reset LD_LIBRARY_PATH but I get the bug even then.

sjackman commented 8 years ago

Moved to https://github.com/Linuxbrew/brew/issues/73