Linuxbrew-core: glibc: and file-formula both fail with punctuation in $HOMEBREW_PREFIX

Created on 26 Aug 2016  ·  49Comments  ·  Source: Homebrew/linuxbrew-core

  • [x] Ran brew update and retried your prior step?
  • [x] Ran brew doctor, fixed as many issues as possible and retried your prior step?

    Bug reports:

brew install gcc and brew install glibc fail with the following error:

Inconsistency detected by ld.so: get-dynamic-info.h: 134: elf_get_dynamic_info: Assertion `info[15] == ((void *)0)' failed!

Debugging information from running brew gist-logs is available here:

https://gist.github.com/dd470ef4db96e064a1e59f863bb086f8

Thanks.

build failure needs response

All 49 comments

I think this is the same problem reported here.

Are you trying to install glibc on top of an existing Linuxbrew installation or is it one of the first formulae you've tried to install?

Sorry it took so long to get back to you.

I'm having the same problem on Centos 6.7

Try starting with a fresh installation of Linuxbrew and brew install gcc as the first thing you do, and do not run brew install glibc.

Running brew install gcc first is what I did the first time I tried installing linuxbrew a couple days ago. I tried it again just now with a fresh install, but it still gives the exact same error. I've tried a bunch of other stuff in between as well.

Any idea on what's actually causing the bug? If you give me a starting point I can dig into it on my end.

For the original poster, it was failing while building glibc with the error:

/home-2/[email protected]/.linuxbrew/Cellar/glibc/2.19/bin/localedef -i en_US -f UTF-8 en_US.UTF-8
Inconsistency detected by ld.so: get-dynamic-info.h: 134: elf_get_dynamic_info: Assertion `info[15] == ((void *)0)' failed!

https://gist.github.com/anonymous/dd470ef4db96e064a1e59f863bb086f8#file-01-localedef-L10

Are you getting the same error message at the same point, and if not, at which point is it failing? Please copy-and-paste the last ten or so lines from brew install gcc. Whichever formula is failing, glibc or gcc or whichever, please report brew gist-logs gcc

The error is caused by a version mismatch between the dynamic linker ld.so and the glibc shared library libc.so.6. That is, using one from the host and the other from Linuxbrew.

Yes, that's exactly what I'm getting. Here's a summary of the output from brew install gcc:

==> Installing dependencies for gcc: patchelf, zlib, binutils, linux-headers, glibc, xz, gmp, mpfr, libmpc, isl
==> Installing gcc dependency: patchelf

...

==> Installing gcc dependency: glibc

...

==> make install
==> /home-1/[email protected]/.linuxbrew/Cellar/glibc/2.19/bin/localedef -i en_US -f UTF-8 en_US.UTF-8
Last 15 lines from /home-1/[email protected]/.cache/Homebrew/Logs/glibc/post_install.01.localedef:
2017-03-03 16:31:18 -0500

/home-1/[email protected]/.linuxbrew/Cellar/glibc/2.19/bin/localedef
-i
en_US
-f
UTF-8
en_US.UTF-8

Inconsistency detected by ld.so: get-dynamic-info.h: 134: elf_get_dynamic_info: Assertion `info[15] == ((void *)0)' failed!
Warning: The post-install step did not complete successfully

...

==> Installing gcc

...

==> Pouring gcc-5.3.0.x86_64_linux.bottle.tar.gz
Inconsistency detected by ld.so: get-dynamic-info.h: 134: elf_get_dynamic_info: Assertion `info[15] == ((void *)0)' failed!
==> Creating the GCC specs file: specs
Inconsistency detected by ld.so: get-dynamic-info.h: 134: elf_get_dynamic_info: Assertion `info[15] == ((void *)0)' failed!
Warning: The post-install step did not complete successfully

...

I'm running on a large cluster with a complex environment. There's a module system that lets users load and unload various software packages. It doesn't surprise me that there's some crazy env var mixup.

What would be the easiest way to appropriately sanitize my environment before I do any of the brew stuff? Earlier I did try just unsetting LD_LIBRARY_PATH and anything that looked similar, but I still got the same error.

Report env | grep LD_
Definitely unset LD_LIBRARY_PATH and any other variables that start with LD_
Run brew doctor and heed its advice.
Try running at the prompt localedef -i en_US -f UTF-8 en_US.UTF-8
If that fails, report

patchelf --print-interpreter --print-rpath $(brew --prefix)/bin/localedef
ldd $(brew --prefix)/bin/localedef

I am getting similar errors while trying to install trinity:

==> Installing homebrew/science/trinity dependency: pkg-config
Inconsistency detected by ld.so: get-dynamic-info.h: 134: elf_get_dynamic_info: Assertion \`info[15] == ((void *)0)' failed!
Inconsistency detected by ld.so: get-dynamic-info.h: 134: elf_get_dynamic_info: Assertion \`info[15] == ((void *)0)' failed!
Error: pkg-config cannot be built with any available compilers.
Install Clang or brew install gcc

Reporting your command suggestions:

patchelf --print-interpreter --print-rpath $(brew --prefix)/bin/localedef
/home/ckeeling/.linuxbrew/Cellar/glibc/2.19/lib/ld-linux-x86-64.so.2
/usr/lib/gcc/x86_64-redhat-linux/4.4.7:/usr/local/intel/composerxe/mkl/lib/intel64
ldd $(brew --prefix)/bin/localedef
Inconsistency detected by ld.so: get-dynamic-info.h: 134: elf_get_dynamic_info: Assertion `info[15] == ((void *)0)' failed!
ldd: exited with unknown exit code (127)

I tried a fresh install of linuxbrew and then immediately brew install gcc, but even this is failing with a similar problem with glibc installation during brew install gcc.

rm -rf .linuxbrew/
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install)"
brew install gcc

error: unknown option \`list'
usage: git tag [-a|-s|-u <key-id>] [-f] [-m <msg>|-F <file>] <tagname> [<head>]
   or: git tag -d <tagname>...
   or: git tag -l [-n[<num>]] [<pattern>]
   or: git tag -v <tagname>...

    -l                    list tag names
    -n[<n>]               print <n> lines of each tag message
    -d                    delete tags
    -v                    verify tags

Tag creation options
    -a                    annotated tag, needs a message
    -m <msg>              message for the tag
    -F <FILE>             message in a file
    -s                    annotated and GPG-signed tag
    -u <key-id>           use another key to sign the tag
    -f, --force           replace the tag if exists

Tag listing options
    --contains <commit>   print only tags that contain the commit

error: unknown option \`list'
usage: git tag [-a|-s|-u <key-id>] [-f] [-m <msg>|-F <file>] <tagname> [<head>]
   or: git tag -d <tagname>...
   or: git tag -l [-n[<num>]] [<pattern>]
   or: git tag -v <tagname>...

    -l                    list tag names
    -n[<n>]               print <n> lines of each tag message
    -d                    delete tags
    -v                    verify tags

Tag creation options
    -a                    annotated tag, needs a message
    -m <msg>              message for the tag
    -F <FILE>             message in a file
    -s                    annotated and GPG-signed tag
    -u <key-id>           use another key to sign the tag
    -f, --force           replace the tag if exists

Tag listing options
    --contains <commit>   print only tags that contain the commit

Updating Homebrew...
==> Homebrew has enabled anonymous aggregate user behaviour analytics.
Read the analytics documentation (and how to opt-out) here:
  http://docs.brew.sh/Analytics.html

error: unknown option \`local'
usage: git config [options]

Config file location
    --global              use global config file
    --system              use system config file
    -f, --file <FILE>     use given config file

Action
    --get                 get value: name [value-regex]
    --get-all             get all values: key [value-regex]
    --get-regexp          get values for regexp: name-regex [value-regex]
    --replace-all         replace all matching variables: name value [value_regex]
    --add                 adds a new variable: name value
    --unset               removes a variable: name [value-regex]
    --unset-all           removes all matches: name [value-regex]
    --rename-section      rename section: old-name new-name
    --remove-section      remove a section: name
    -l, --list            list all
    -e, --edit            opens an editor
    --get-color <slot>    find the color configured: [default]
    --get-colorbool <slot>
                          find the color setting: [stdout-is-tty]

Type
    --bool                value is "true" or "false"
    --int                 value is decimal number
    --bool-or-int         value is --bool or --int
    --path                value is a path (file or directory name)

Other
    -z, --null            terminate values with NUL byte

Error: Failure while executing: git config --local --replace-all homebrew.analyticsmessage true
==> Installing dependencies for gcc: patchelf, zlib, binutils, linux-headers, glibc, xz, gmp, mpfr, libmpc, isl
==> Installing gcc dependency: patchelf
==> Downloading https://linuxbrew.bintray.com/bottles/patchelf-0.9_1.x86_64_linux.bottle.tar.gz
Already downloaded: /home/ckeeling/.cache/Homebrew/patchelf-0.9_1.x86_64_linux.bottle.tar.gz
==> Pouring patchelf-0.9_1.x86_64_linux.bottle.tar.gz
🍺  /home/ckeeling/.linuxbrew/Cellar/patchelf/0.9_1: 6 files, 1.2M
==> Installing gcc dependency: zlib
==> Downloading https://linuxbrew.bintray.com/bottles/zlib-1.2.11.x86_64_linux.bottle.tar.gz
Already downloaded: /home/ckeeling/.cache/Homebrew/zlib-1.2.11.x86_64_linux.bottle.tar.gz
==> Pouring zlib-1.2.11.x86_64_linux.bottle.tar.gz
🍺  /home/ckeeling/.linuxbrew/Cellar/zlib/1.2.11: 12 files, 423.5K
==> Installing gcc dependency: binutils
==> Downloading https://linuxbrew.bintray.com/bottles/binutils-2.27.x86_64_linux.bottle.tar.gz
Already downloaded: /home/ckeeling/.cache/Homebrew/binutils-2.27.x86_64_linux.bottle.tar.gz
==> Pouring binutils-2.27.x86_64_linux.bottle.tar.gz
🍺  /home/ckeeling/.linuxbrew/Cellar/binutils/2.27: 3,212 files, 195.9M
==> Installing gcc dependency: linux-headers
==> Downloading https://linuxbrew.bintray.com/bottles/linux-headers-3.18.27.x86_64_linux.bottle.tar.gz
Already downloaded: /home/ckeeling/.cache/Homebrew/linux-headers-3.18.27.x86_64_linux.bottle.tar.gz
==> Pouring linux-headers-3.18.27.x86_64_linux.bottle.tar.gz
🍺  /home/ckeeling/.linuxbrew/Cellar/linux-headers/3.18.27: 742 files, 3.5M
==> Installing gcc dependency: glibc
==> Downloading https://ftpmirror.gnu.org/glibc/glibc-2.19.tar.bz2
Already downloaded: /home/ckeeling/.cache/Homebrew/glibc-2.19.tar.bz2
==> ../configure --disable-debug --disable-dependency-tracking --disable-silent-rules --prefix=/home/ckeeling/.linuxb
==> make
==> make install
==> /home/ckeeling/.linuxbrew/Cellar/glibc/2.19/bin/localedef -i en_CA -f UTF-8 en_CA.UTF-8
Last 15 lines from /home/ckeeling/.cache/Homebrew/Logs/glibc/post_install.01.localedef:
2017-03-04 22:14:55 -0800

/home/ckeeling/.linuxbrew/Cellar/glibc/2.19/bin/localedef
-i
en_CA
-f
UTF-8
en_CA.UTF-8

Inconsistency detected by ld.so: get-dynamic-info.h: 134: elf_get_dynamic_info: Assertion \`info[15] == ((void *)0)' failed!
Warning: The post-install step did not complete successfully
You can try again using \`brew postinstall glibc\`
==> Summary
🍺  /home/ckeeling/.linuxbrew/Cellar/glibc/2.19: 1,406 files, 41.5M, built in 3 minutes 29 seconds
==> Installing gcc dependency: xz
==> Downloading https://linuxbrew.bintray.com/bottles/xz-5.2.3.x86_64_linux.bottle.tar.gz
Already downloaded: /home/ckeeling/.cache/Homebrew/xz-5.2.3.x86_64_linux.bottle.tar.gz
==> Pouring xz-5.2.3.x86_64_linux.bottle.tar.gz
🍺  /home/ckeeling/.linuxbrew/Cellar/xz/5.2.3: 99 files, 1.8M
==> Installing gcc dependency: gmp
==> Downloading https://linuxbrew.bintray.com/bottles/gmp-6.1.1.x86_64_linux.bottle.1.tar.gz
Already downloaded: /home/ckeeling/.cache/Homebrew/gmp-6.1.1.x86_64_linux.bottle.1.tar.gz
==> Pouring gmp-6.1.1.x86_64_linux.bottle.1.tar.gz
🍺  /home/ckeeling/.linuxbrew/Cellar/gmp/6.1.1: 20 files, 3.6M
==> Installing gcc dependency: mpfr
==> Downloading https://linuxbrew.bintray.com/bottles/mpfr-3.1.5.x86_64_linux.bottle.tar.gz
Already downloaded: /home/ckeeling/.cache/Homebrew/mpfr-3.1.5.x86_64_linux.bottle.tar.gz
==> Pouring mpfr-3.1.5.x86_64_linux.bottle.tar.gz
🍺  /home/ckeeling/.linuxbrew/Cellar/mpfr/3.1.5: 26 files, 3.9M
==> Installing gcc dependency: libmpc
==> Downloading https://linuxbrew.bintray.com/bottles/libmpc-1.0.3.x86_64_linux.bottle.tar.gz
Already downloaded: /home/ckeeling/.cache/Homebrew/libmpc-1.0.3.x86_64_linux.bottle.tar.gz
==> Pouring libmpc-1.0.3.x86_64_linux.bottle.tar.gz
🍺  /home/ckeeling/.linuxbrew/Cellar/libmpc/1.0.3: 12 files, 466.4K
==> Installing gcc dependency: isl
==> Downloading https://linuxbrew.bintray.com/bottles/isl-0.15.x86_64_linux.bottle.tar.gz
Already downloaded: /home/ckeeling/.cache/Homebrew/isl-0.15.x86_64_linux.bottle.tar.gz
==> Pouring isl-0.15.x86_64_linux.bottle.tar.gz
🍺  /home/ckeeling/.linuxbrew/Cellar/isl/0.15: 71 files, 4.6M
==> Installing gcc 
==> Downloading https://linuxbrew.bintray.com/bottles/gcc-5.3.0.x86_64_linux.bottle.tar.gz
Already downloaded: /home/ckeeling/.cache/Homebrew/gcc-5.3.0.x86_64_linux.bottle.tar.gz
==> Pouring gcc-5.3.0.x86_64_linux.bottle.tar.gz
Inconsistency detected by ld.so: get-dynamic-info.h: 134: elf_get_dynamic_info: Assertion \`info[15] == ((void *)0)' failed!
==> Creating the GCC specs file: specs
Inconsistency detected by ld.so: get-dynamic-info.h: 134: elf_get_dynamic_info: Assertion \`info[15] == ((void *)0)' failed!
Warning: The post-install step did not complete successfully
You can try again using `brew postinstall gcc`
==> Summary
🍺  /home/ckeeling/.linuxbrew/Cellar/gcc/5.3.0: 1,350 files, 253.2M

Hi, Chris. Your RPATH looks suspicious: /usr/lib/gcc/x86_64-redhat-linux/4.4.7:/usr/local/intel/composerxe/mkl/lib/intel64.
Report env | grep LD_
Unset LD_LIBRARY_PATH and any other variables that start with LD_
Run brew doctor and heed its advice.

Hi Shaun, env | grep LD_ returns nothing.

brew doctor mentions:

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.

Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew provided
script of the same name. We found the following "config" scripts:
  /usr/local/python/bin/python-config
...approximately 20 files in /usr/local/

Warning: Unbrewed header files were found in /usr/local/include.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected header files:
  /usr/local/include/JAGS/compiler/Compiler.h
... many, many files in /usr/local/include/

Warning: Unbrewed .la files were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected .la files:
  /usr/local/lib/liblwgeom.la

Warning: Unbrewed static libraries were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected static libraries:
  /usr/local/lib/liblwgeom.a

Warning: An outdated version (1.7.1) of Git was detected in your PATH.
Git 1.7.10 or newer is required to perform checkouts over HTTPS from GitHub.
Please upgrade:
  brew install git

Do these warnings suggest my env for linuxbrew is not set correctly? This is a cluster I don't have sudo on.

brew install git also fails when installing git dependency: openssl due to similar error:
Inconsistency detected by ld.so: get-dynamic-info.h: 134: elf_get_dynamic_info: Assertion `info[15] == ((void *)0)' failed!

sjackman you were totally right about the localedef problem being related to a mismatched libc.so.6. I unset all LD_ vars and ran the diagnostics you suggested, and here's what I got:

>patchelf --print-interpreter --print-rpath $(brew --prefix)/bin/localedef
~/.linuxbrew/Cellar/glibc/2.19/lib/ld-linux-x86-64.so.2
/cm/shared/apps/parallel_studio_xe_2015_update2/composer_xe_2015.2.164/compiler/lib/intel64:/cm/shared/apps/parallel_studio_xe_2015_update2/composer_xe_2015.2.164/lib/mkl/lib/intel64

>ldd $(brew --prefix)/bin/localedef
Inconsistency detected by ld.so: get-dynamic-info.h: 134: elf_get_dynamic_info: Assertion `info[15] == ((void *)0)' failed!

>/usr/bin/ldd $(brew --prefix)/bin/localedef
~/.linuxbrew/bin/localedef: /lib64/libc.so.6: version `GLIBC_2.15' not found (required by ~/.linuxbrew/bin/localedef)
~/.linuxbrew/bin/localedef: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by ~/.linuxbrew/bin/localedef)
    linux-vdso.so.1 =>  (0x00007ffff7fde000)
    libc.so.6 => /lib64/libc.so.6 (0x00007ffff7c2e000)
    ~/.linuxbrew/Cellar/glibc/2.19/lib/ld-linux-x86-64.so.2 => /lib64/ld-linux-x86-64.so.2 (0x00007ffff7fdf000)

In my case unsetting the LIBRARY_PATH env var seemed to do the trick. Now after all that unsetting and a rebuild, localedef is linked against the appropriate libc and brew install gcc finishes cleanly.

HOWEVER, now I'm getting a new error which I suspect is somehow related to the old one. After I got gcc installed, I tried doing brew install python3. That started off by trying to install the pkg-config dependency, which failed durring ./configure as so:

checking for gcc... ~/.linuxbrew/bin/gcc-5
checking whether the C compiler works... no
configure: error: in `/tmp/pkg-config-20170306-126881-1y5462m/pkg-config-0.29.1':
configure: error: C compiler cannot create executables
See `config.log' for more details

Digging into config.log a little, it seems the problem is that my brewed gcc always fails when trying to link libc.so:

configure:3487: gcc    conftest.c  >&5
~/.linuxbrew/lib/libc.so: file not recognized: File format not recognized

Trying to compile the test program outside of the config script also fails with exactly the same message. Here's the complete test program:

/* confdefs.h */
#define PACKAGE_NAME "pkg-config"
#define PACKAGE_TARNAME "pkg-config"
#define PACKAGE_VERSION "0.29.1"
#define PACKAGE_STRING "pkg-config 0.29.1"
#define PACKAGE_BUGREPORT "https://bugs.freedesktop.org/enter_bug.cgi?product=pkg-config"
#define PACKAGE_URL ""
#define PACKAGE "pkg-config"
#define VERSION "0.29.1"
/* end confdefs.h.  */

int
main ()
{

  ;
  return 0;
}

Is this related to the initial libc.so linking issues? If not, should I open a new issue?

In my case unsetting the LIBRARY_PATH env var seemed to do the trick.

Good news! Thanks for following up.
@ckeeling Do you have the environment variable LIBRARY_PATH set?

~/.linuxbrew/lib/libc.so: file not recognized: File format not recognized

You're lucky (I guess?) that I just ran into this bug yesterday, so I know exactly what it is. Linuxbrew depends on file and recently (due to a change in upstream Homebrew) a sufficiently recent version of file that supports the option --print0. Things break in weird and wonderful ways

Here's a hack workaround that may work. Note that ~/.linuxbrew/lib/libc.so is a plain text linker script.

grep @@HOMEBREW_CELLAR@@ ~/.linuxbrew/lib/libc.so
sed -i 's/@@HOMEBREW_CELLAR@@/'$(brew --cellar)/ ~/.linuxbrew/lib/libc.so
grep @@HOMEBREW_CELLAR@@ ~/.linuxbrew/lib/libc.so

For future installations of Linuxbrew from a clean slate, try:

brew install -s file-formula
brew install gcc

@ckeeling Does your HPC system use a modules system? If so, try unloading all the loaded modules.

Please report

echo x $LIBRARY_PATH x
which -a cc gcc
ls /usr/bin/gcc*
/usr/bin/gcc --version

My LIBRARY_PATH is not set.

I'm getting nearly identical results as @telamonian

patchelf --print-interpreter --print-rpath $(brew --prefix)/bin/localedef

/home/ckeeling/.linuxbrew/Cellar/glibc/2.19/lib/ld-linux-x86-64.so.2
/usr/lib/gcc/x86_64-redhat-linux/4.4.7:/usr/local/intel/composerxe/mkl/lib/intel64

ldd $(brew --prefix)/bin/localedef

Inconsistency detected by ld.so: get-dynamic-info.h: 134: elf_get_dynamic_info: Assertion \`info[15] == ((void *)0)' failed!
ldd: exited with unknown exit code (127)

/usr/bin/ldd $(brew --prefix)/bin/localedef

/home/ckeeling/.linuxbrew/bin/localedef: /lib64/libc.so.6: version \`GLIBC_2.15' not found (required by /home/ckeeling/.linuxbrew/bin/localedef)
/home/ckeeling/.linuxbrew/bin/localedef: /lib64/libc.so.6: version \`GLIBC_2.14' not found (required by /home/ckeeling/.linuxbrew/bin/localedef)
    linux-vdso.so.1 =>  (0x00007ffeca7ff000)
    libc.so.6 => /lib64/libc.so.6 (0x000000350a600000)
    /home/ckeeling/.linuxbrew/Cellar/glibc/2.19/lib/ld-linux-x86-64.so.2 => /lib64/ld-linux-x86-64.so.2 (0x000000350a200000)

Reporting:
echo x $LIBRARY_PATH x

x x

which -a cc gcc

~/.linuxbrew/bin/cc
~/.linuxbrew/bin/cc
/usr/local/bin/cc
/usr/bin/cc
~/.linuxbrew/bin/gcc
~/.linuxbrew/bin/gcc
/usr/local/gcc/bin/gcc
/usr/bin/gcc

(not sure why there is duplication here)

/usr/bin/gcc --version

gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-3)
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

HPC system does use modules, but module list

No Modulefiles Currently Loaded.

@ckeeling Please enclose copy-and-paste blocks in triple back ticks.
See https://help.github.com/articles/basic-writing-and-formatting-syntax/#quoting-code

(not sure why there is duplication here)

You likely have ~/.linuxbrew/bin twice in your PATH environment variable.

@ckeeling Please report

/usr/local/bin/cc --version
/usr/local/gcc/bin/gcc --version

also

which -a file
file --version
file --print0 /bin/ls

and try setting PATH=/usr/bin:/bin and reinstalling Linuxbrew from scratch.

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install)"
PATH="$HOME/.linuxbrew/bin:$PATH"
ln -s /usr/bin/gcc44 ~/.linuxbrew/bin/gcc-4.4
ln -s /usr/bin/g++44 ~/.linuxbrew/bin/g++-4.4
file --print0 /bin/ls || brew install -s file-formula # Only if file --print0 above gives an error message
brew install gcc
brew test gcc

/usr/local/bin/cc --version

Inconsistency detected by ld.so: get-dynamic-info.h: 134: elf_get_dynamic_info: Assertion `info[15] == ((void *)0)' failed!

/usr/local/gcc/bin/gcc

gcc: fatal error: no input files
compilation terminated.

/usr/local/gcc/bin/gcc --version

gcc (GCC) 4.8.0
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

which -a file

/usr/bin/file

file --version

file-5.04
magic file from /etc/magic:/usr/share/misc/magic

file --print0 /bin/ls

/bin/ls: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped

I'll set path and reinstall Linuxbrew now...

@ckeeling Note that this was a typo:

ln -s /usr/bin/gcc44 ~/.linuxbrew/bin/gcc-4.4
ln -s /usr/bin/g++44 ~/.linuxbrew/bin/g++-4.4

and should have been

ln -s /usr/bin/gcc ~/.linuxbrew/bin/gcc-4.4
ln -s /usr/bin/g++ ~/.linuxbrew/bin/g++-4.4
/usr/local/bin/cc --version

Inconsistency detected by ld.so: get-dynamic-info.h: 134: elf_get_dynamic_info: Assertion `info[15] == ((void *)0)' failed!

That's not a good sign. Since /usr/local/bin/cc has nothing to do with Linuxbrew, and it's the same error message, it makes me wonder if there's something wrong with the system outside of Linuxbrew's control.

What's the result of

ls -l /usr/local/bin/cc
realpath /usr/local/bin/cc

I think it's likely that this unhappy compiler /usr/local/bin/cc was used to compiled glibc, which is now failing for you.

Still installing, but in another session on server:

ls -l /usr/local/bin/cc

-rwxr-xr-x 1 root root 980 Jul  3  2013 /usr/local/bin/cc

realpath /usr/local/bin/cc

-bash: realpath: command not found

But in this other session:
/usr/local/bin/cc --version

icc (ICC) 13.1.3 20130607
Copyright (C) 1985-2013 Intel Corporation.  All rights reserved.

OK, it failed installing gcc again. Same output as my comment above 2 d ago starting, "I tried a fresh install of linuxbrew and then immediately brew install gcc..."
https://github.com/Linuxbrew/homebrew-core/issues/814#issuecomment-284208849

Did you create the gcc-4.4 and g++-4.4 symlinks above? Does the following test work?

brew install -s hello
brew test -v hello

brew install -s hello failed

error: unknown option `list'
usage: git tag [-a|-s|-u <key-id>] [-f] [-m <msg>|-F <file>] <tagname> [<head>]
   or: git tag -d <tagname>...
   or: git tag -l [-n[<num>]] [<pattern>]
   or: git tag -v <tagname>...

    -l                    list tag names
    -n[<n>]               print <n> lines of each tag message
    -d                    delete tags
    -v                    verify tags

Tag creation options
    -a                    annotated tag, needs a message
    -m <msg>              message for the tag
    -F <FILE>             message in a file
    -s                    annotated and GPG-signed tag
    -u <key-id>           use another key to sign the tag
    -f, --force           replace the tag if exists

Tag listing options
    --contains <commit>   print only tags that contain the commit

Updating Homebrew...
==> Homebrew has enabled anonymous aggregate user behaviour analytics.
Read the analytics documentation (and how to opt-out) here:
  http://docs.brew.sh/Analytics.html

error: unknown option `local'
usage: git config [options]

Config file location
    --global              use global config file
    --system              use system config file
    -f, --file <FILE>     use given config file

Action
    --get                 get value: name [value-regex]
    --get-all             get all values: key [value-regex]
    --get-regexp          get values for regexp: name-regex [value-regex]
    --replace-all         replace all matching variables: name value [value_regex]
    --add                 adds a new variable: name value
    --unset               removes a variable: name [value-regex]
    --unset-all           removes all matches: name [value-regex]
    --rename-section      rename section: old-name new-name
    --remove-section      remove a section: name
    -l, --list            list all
    -e, --edit            opens an editor
    --get-color <slot>    find the color configured: [default]
    --get-colorbool <slot>
                          find the color setting: [stdout-is-tty]

Type
    --bool                value is "true" or "false"
    --int                 value is decimal number
    --bool-or-int         value is --bool or --int
    --path                value is a path (file or directory name)

Other
    -z, --null            terminate values with NUL byte

Error: Failure while executing: git config --local --replace-all homebrew.analyticsmessage true
Inconsistency detected by ld.so: get-dynamic-info.h: 134: elf_get_dynamic_info: Assertion `info[15] == ((void *)0)' failed!
==> Downloading https://ftpmirror.gnu.org/hello/hello-2.10.tar.gz
==> Downloading from http://ca.mirror.babylon.network/gnu/hello/hello-2.10.tar.gz
###################################################################       93.9%
==> ./configure --disable-silent-rules --prefix=/home/ckeeling/.linuxbrew/Cellar/hello/2.10
Last 15 lines from /home/ckeeling/.cache/Homebrew/Logs/hello/01.configure:
--disable-silent-rules
--prefix=/home/ckeeling/.linuxbrew/Cellar/hello/2.10

configure: WARNING: unrecognized options: --disable-debug
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for gcc... /home/ckeeling/.linuxbrew/bin/gcc-4.4
checking whether the C compiler works... no
configure: error: in `/tmp/hello-20170306-20833-1uizjs2/hello-2.10':
configure: error: C compiler cannot create executables
See `config.log' for more details

READ THIS: https://github.com/Linuxbrew/brew/blob/master/docs/Troubleshooting.md#troubleshooting

Please report brew gist-logs hello
You'll need a working git for that, which it looks as though you may not have.

Error: Failure while executing: git config --local --replace-all homebrew.analyticsmessage true
Inconsistency detected by ld.so: get-dynamic-info.h: 134: elf_get_dynamic_info: Assertion `info[15] == ((void *)0)' failed!

Please report

which -a git
git --version

which -a git
git --version

/usr/bin/git
git version 1.7.1

I see that git 1.7.10 or newer is required to perform checkouts over HTTPS from GitHub., but brew install git fails when installing openssl due to the same problem with ld.so
I'm checking with the server person about the cc error.

brew gist-logs hello

https://gist.github.com/2c57604b13c0a403897cc5cbf70baf8b
configure:4014: checking whether the C compiler works
configure:4036: /home/ckeeling/.linuxbrew/bin/gcc-4.4 -Os -w -pipe -march=native -isystem/home/ckeeling/.linuxbrew/include -L/home/ckeeling/.linuxbrew/lib -Wl,--dynamic-linker=/home/ckeeling/.linuxbrew/lib/ld.so -Wl,-rpath,/home/ckeeling/.linuxbrew/lib conftest.c  >&5
Inconsistency detected by ld.so: get-dynamic-info.h: 134: elf_get_dynamic_info: Assertion `info[15] == ((void *)0)' failed!

https://gist.github.com/anonymous/2c57604b13c0a403897cc5cbf70baf8b#file-config-log-L93

Try

printf '#include <stdio.h>\nint main() { puts("Hello"); return 0; }' >hello.c
/usr/bin/gcc -o hello hello.c
./hello
patchelf --print-interpreter --print-rpath --print-needed hello
/usr/bin/ldd hello
~/.linuxbrew/bin/ldd hello

No love for /usr/bin/gcc -o hello hello.c

Inconsistency detected by ld.so: get-dynamic-info.h: 134: elf_get_dynamic_info: Assertion `info[15] == ((void *)0)' failed!

Shot in the dark, but is the LD_PRELOAD environment variable set? echo x $LD_PRELOAD x

No love for /usr/bin/gcc -o hello hello.c

That's definitely bigger problems outside of our control. I'll be curious to hear what your system's chaps say. Are you certain the LD_LIBRARY_PATH environment variable is not set?

Both of those variables are empty. Will see what the system person says for this server. In the meantime, I will try a different server to see if I get similar errors.

I am getting past the point of problems when I brew install gcc on this other server and now trying to install trinity. This is consistent with your thinking that it is a server issue and not related to linuxbrew. Thanks for all your help and getting to the bottom of this Shaun.

Happy to help, Chris.

@sjackman I tried your suggestions, but sadly neither worked. First I tried the hack you suggested. grep @@HOMEBREW_CELLAR@@ ~/.linuxbrew/lib/libc.so returns nothing, so the sed command also does nothing. When I opened up libc.so to take a look, the correct absolute path to my cellar already appeared to be where it should be.

Also, I wasn't sure if you meant @@HOMEBREW_CELLAR@@ as a literal, so I also tried

sed 's=\/home\/[email protected]\/.linuxbrew\/Cellar='$(brew --cellar)= ~/.linuxbrew/lib/libc.so

but now gcc just complains about a syntax error in libc.so. After some consideration I assume you didn't mean for the literal $(brew --cellar) to end up in libc.so, which is what ended up happening.

Next I tried a clean install followed by brew install -s file-formula (I had to do brew tap homebrew/dupes first). The problem with this seems to be that both gcc and libmagic are dependencies of file-formula. What happens is that gcc is installed before libmagic, and then brew tries to build libmagic with the brewed gcc and runs smack into the same libc.so problem.

Finally I tried a clean install of linuxbrew followed by brew install libmagic, but that fails during the make install step. Here's the relevant section of the 02.make log file:

sed -e s@__CSECTION__@1@g \
        -e s@__FSECTION__@5@g \
        -e s@[email protected]@g \
        -e s@__MAGIC__@/home/[email protected]/.linuxbrew/Cellar/libmagic/5.30/share/misc/magic@g ./file.man > file.1
sed -e s@__CSECTION__@1@g \
        -e s@__FSECTION__@5@g \
        -e s@[email protected]@g \
        -e s@__MAGIC__@/home/[email protected]/.linuxbrew/Cellar/libmagic/5.30/share/misc/magic@g ./magic.man > magic.5
sed -e s@__CSECTION__@1@g \
        -e s@__FSECTION__@5@g \
        -e s@[email protected]@g \
        -e s@__MAGIC__@/home/[email protected]/.linuxbrew/Cellar/libmagic/5.30/share/misc/magic@g ./libmagic.man > libmagic.3
sed: -e expression #4, char 30: unknown option to `s'
sed: -e expression #4, char 30: unknown option to `s'
sed: -e expression #4, char 30: unknown option to `s'

I'm starting to think maybe my problem is that my user name/home dir has a @ symbol in the middle: [email protected] (not my choice).

Any idea how to get around the chicken/egg issue with libmagic?

Next I tried a clean install followed by brew install -s file-formula (I had to do brew tap homebrew/dupes first). The problem with this seems to be that both gcc and libmagic are dependencies of file-formula.

Sorry, that should have been brew install -s libmagic file-formula so that it doesn't depend on gcc. My mistake.

I'm starting to think maybe my problem is that my user name/home dir has a @ symbol in the middle: [email protected] (not my choice).

Wow! That's really unlucky! You can report the bug upstream to the authors of file.
In the mean time you can edit the Makefile of file to use a different delimiter than @.
Try brew install -sdv libmagic when it fails select shell. Edit the Makefile in a text editor. Run make install. It could be easier in this case I think to download and install file outside of Linuxbrew and put the file executable in your PATH before installing Linuxbrew.

I tried what you said and it worked! The busted Makefile was in docs/Makefile, and the busted sed lines were at the bottom. I replaced @ with = for the delimiter and then ran make install and everything finished normally. I then exited the shell and picked the ignore option. But then brew raised another error:

Error: No such file or directory - ~/.linuxbrew/Library/Taps/linuxbrew/homebrew-xorg/xorg.rb

I fixed it by starting over after running brew tap homebrew/homebrew-xorg. I checked the libmagic formula and there was no mention of xorg, though. Is that a bug in the linuxbrew error handling system?

Anyhow, all of that seemed to get libmagic to install correctly, but when I ran brew install -s file-formula it still listed both gcc and glibc as a dependencies, and so it failed with the same C compiler cannot create executables error message when it got to the step of building file itself.

In fact, there were still a whole boatload of dependencies:

patchelf, zlib, binutils, linux-headers, glibc, xz, gmp, mpfr, libmpc, isl, gcc, gpatch

They're not listed in file-formula.rb, but the patch command is used in that formula, so maybe all the rest are dependencies of gpatch?

Alright, so what should I try next?

They're not listed in file-formula.rb, but the patch command is used in that formula, so maybe all the rest are dependencies of gpatch?

Yes, that's correct. Try building gpatch from source with

brew install -s gpatch libmagic file-formula
brew install gcc

Okay, I think I have everything fixed. I was able to get file-formula to install by doing:

brew install -sdv --ignore-dependencies file-formula

and then wrangling some makefiles.

I still was getting the same problem trying to build anything with gcc:

~/.linuxbrew/lib/libc.so: file not recognized: File format not recognized
collect2: error: ld returned 1 exit status

Doing some googling, I came across this little tidbit in the IBM version of the ld manpage:

When ld is invoked from the shell, any option-arguments or operands specified that contain characters with special meaning to the shell must be escaped. For example, source files that are specified as PDS member names contain parentheses; and if they are specified as fully qualified names, they contain single quotation marks. To escape these special characters, either enclose the option-argument or operand in double quotation marks, or precede each character with a backslash.

So I tried just opening up libc.so and adding quotes around the paths and it worked! After doing the same thing for libpthread.so I'm now able to use gcc. I built python3 and it's working fine, so I think everything is good now. Thanks for all your help

Amazing! Good sleuthing. That had not occurred to me.
Note that having an at sign in your home directory exposed bugs in two totally different software packages (file and glibc). I'd write your sys admin and suggest that having any punctuation in your home directory is a bad idea™.

Guys. Far better thriller than I have ever read!

Great job nailing it down!

@sjackman I'm sorry to bother you, but I meet the same problem too.
The postinstallation of glibc fails:

dyhu@mit232:~$ brew postinstall glibc
==> /home/dyhu/.linuxbrew/Cellar/glibc/2.19/bin/localedef -i en_US -f UTF-8 en_US.UTF-8
Last 15 lines from /home/dyhu/.cache/Homebrew/Logs/glibc/post_install.01.localedef:
2017-05-12 17:22:44 +0800

/home/dyhu/.linuxbrew/Cellar/glibc/2.19/bin/localedef
-i
en_US
-f
UTF-8
en_US.UTF-8

And below are some check commands:

dyhu@mit232:~$ env | grep LD_     (Nothing return.)
dyhu@mit232:~$ localedef -i en_US -f UTF-8 en_US.UTF-8
Illegal instruction (core dumped)
dyhu@mit232:~$ patchelf --print-interpreter --print-rpath $(brew --prefix)/bin/localedef
/home/dyhu/.linuxbrew/Cellar/glibc/2.19/lib/ld-linux-x86-64.so.2

dyhu@mit232:~$ ldd $(brew --prefix)/bin/localedef
    linux-vdso.so.1 (0x00007fff5a3ff000)
    libc.so.6 => /home/dyhu/.linuxbrew/Cellar/glibc/2.19/lib/libc.so.6 (0x00007f45df708000)
    /home/dyhu/.linuxbrew/Cellar/glibc/2.19/lib/ld-linux-x86-64.so.2 (0x00007f45dfab3000)
dyhu@mit232:~$ echo $LIBRARY_PATH     (Nothing return.)
dyhu@mit232:~/bak/.linuxbrew$ /usr/bin/gcc --version
gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3

And I don't have @ or other strange characters in my username.
And the output of brew gist-logs hello posted here: brew gist-logs hello
I reinstalled Linuxbrew from scratch twice, as you suggested:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install)"
PATH="$HOME/.linuxbrew/bin:$PATH"
ln -s /usr/bin/gcc ~/.linuxbrew/bin/gcc-4.6
ln -s /usr/bin/g++ ~/.linuxbrew/bin/g++-4.6
file --print0 /bin/ls || brew install -s file-formula # Only if file --print0 above gives an error message
brew install gcc

The problem still exists. The postinstall of glibc fails again.
I've read the discussion above, but I'm a little bit confused about many of the details.
Maybe it's due to the system itself as you pointed("a bigger problem out of our control?"), since the system on my server is a little bit old. I'm sure Linuxbrew runs OK in my own laptop. But I have only one server and have to work on it. Is there any hope to solve this problem? Really really thanks...

Hi, @psubnwell. Please open a new issue rather than posting in an old and closed issue. Thanks!

Was this page helpful?
0 / 5 - 0 ratings