New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debain fails to resolve _ZTIN6google8protobuf11MessageLiteE #3

Closed
akihikodaki opened this Issue May 10, 2017 · 18 comments

Comments

Projects
None yet
5 participants
@akihikodaki
Owner

akihikodaki commented May 10, 2017

Reported at tootsuite/mastodon#2949 (comment).

have error too with debian...

LoadError: Could not open library '/home/mastodon/live/vendor/bundle/ruby/2.4.0/gems/cld3-3.1.0/lib/../ext/cld3/libcld3.so': /home/mastodon/live/vendor/bundle/ruby/2.4.0/gems/cld3-3.1.0/lib/../ext/cld3/libcld3.so: undefined symbol: _ZTIN6google8protobuf11MessageLiteE

Debian 8 doesn't have g++6 (https://packages.debian.org/fr/jessie/g++) only 4.9
so the use of CLD3 is problematic

@akihikodaki already installed

root@d0p1:~# dpkg -l | grep protobuf
ii libprotobuf-dev:amd64 2.6.1-1 amd64 protocol buffers C++ library (development files)
ii libprotobuf-lite9:amd64 2.6.1-1 amd64 protocol buffers C++ library (lite version)
ii libprotobuf9:amd64 2.6.1-1 amd64 protocol buffers C++ library
ii protobuf-compiler 2.6.1-1 amd64 compiler for protocol buffer definition files

It sounds like a problem with pkg-config.

require "mkmf"

# Check pkg-config first to inform the library is missing if so.
pkg_config("protobuf")

pkg_config("protobuf")

@akihikodaki akihikodaki added the bug label May 10, 2017

@akihikodaki akihikodaki self-assigned this May 10, 2017

@akihikodaki akihikodaki referenced this issue May 10, 2017

Merged

Use CLD3 #2949

@d6rkaiz

This comment has been minimized.

d6rkaiz commented May 10, 2017

I install to libprotobuf-dev. then fix it.

@beatrix-bitrot

This comment has been minimized.

beatrix-bitrot commented May 10, 2017

reposting my comments from tootsuite here all together in one

i also have problems executing code after this update (attempted to execute bundle exec rails db:migrate)

eg

LoadError: Could not open library '/REDACTED/vendor/bundle/ruby/2.4.0/gems/cld3-3.1.0/lib/../ext/cld3/libcld3.so': /REDACTED/vendor/bundle/ruby/2.4.0/gems/cld3-3.1.0/lib/../ext/cld3/libcld3.so: undefined symbol: _ZTIN6google8protobuf11MessageLiteE

ldd vendor/bundle/ruby/2.4.0/gems/cld3-3.1.0/lib/libcld3.so
linux-vdso.so.1 => (0x00007ffe239ed000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fb0b1fb9000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fb0b1cb0000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fb0b18e6000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fb0b16cf000)
/lib64/ld-linux-x86-64.so.2 (0x000055fb7d4a8000)

so yeah, no protobuf it seems?

but

dpkg -l | grep pkg-config
ii pkg-config 0.29.1-0ubuntu1 amd64 manage compile and link flags for libraries

i wonder what i am missing here ):

also relevant

dpkg -l | grep protobuf
ii libprotobuf-dev:amd64 2.6.1-1.3 amd64 protocol buffers C++ library (development files)
ii libprotobuf-lite9v5:amd64 2.6.1-1.3 amd64 protocol buffers C++ library (lite version)
ii libprotobuf9v5:amd64 2.6.1-1.3 amd64 protocol buffers C++ library
ii protobuf-compiler 2.6.1-1.3 amd64 compiler for protocol buffer definition files

@akihikodaki

This comment has been minimized.

Owner

akihikodaki commented May 10, 2017

Could you tell me the result of pkg-config --modversion protobuf?

@beatrix-bitrot

This comment has been minimized.

beatrix-bitrot commented May 10, 2017

@akihikodaki $ pkg-config --modversion protobuf
2.6.1

@akihikodaki

This comment has been minimized.

Owner

akihikodaki commented May 10, 2017

Hmm, so pkg-config is fine... I have no idea what is wrong.
Could you upload what you have in vendor/bundle/ruby/2.4.0/extensions/x86_64-linux/2.4.0/cld3-3.1.0 or somewhere similar?

@beatrix-bitrot

This comment has been minimized.

beatrix-bitrot commented May 10, 2017

hmmmmmmmmmm can't right now since it's on my production server and i haven't set up any way to transfer files to and fro. i'll work something out and get back to you

@beatrix-bitrot

This comment has been minimized.

beatrix-bitrot commented May 10, 2017

@akihikodaki

This comment has been minimized.

Owner

akihikodaki commented May 10, 2017

@beatrix-bitrot Thanks! Do you have any other files in the directory? They would help to understand how it buillt.

@akihikodaki

This comment has been minimized.

Owner

akihikodaki commented May 10, 2017

$ readelf -d libcld3.so

Dynamic section at offset 0xb2d70 contains 28 entries:
  Tag        Type                         Name/Value
 0x0000000000000001 (NEEDED)             Shared library: [libstdc++.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libm.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libgcc_s.so.1]
 0x000000000000000f (RPATH)              Library rpath: [/home/mastodon/.rbenv/versions/2.4.1/lib]
 0x000000000000000c (INIT)               0xb728
 0x000000000000000d (FINI)               0x3baf8
 0x0000000000000019 (INIT_ARRAY)         0x2af408
 0x000000000000001b (INIT_ARRAYSZ)       40 (bytes)
 0x000000000000001a (FINI_ARRAY)         0x2af430
 0x000000000000001c (FINI_ARRAYSZ)       8 (bytes)
 0x000000006ffffef5 (GNU_HASH)           0x1f0
 0x0000000000000005 (STRTAB)             0x1138
 0x0000000000000006 (SYMTAB)             0x2f8
 0x000000000000000a (STRSZ)              8081 (bytes)
 0x000000000000000b (SYMENT)             24 (bytes)
 0x0000000000000003 (PLTGOT)             0x2b3000
 0x0000000000000002 (PLTRELSZ)           2472 (bytes)
 0x0000000000000014 (PLTREL)             RELA
 0x0000000000000017 (JMPREL)             0xad80
 0x0000000000000007 (RELA)               0x3310
 0x0000000000000008 (RELASZ)             31344 (bytes)
 0x0000000000000009 (RELAENT)            24 (bytes)
 0x000000006ffffffe (VERNEED)            0x3200
 0x000000006fffffff (VERNEEDNUM)         4
 0x000000006ffffff0 (VERSYM)             0x30ca
 0x000000006ffffff9 (RELACOUNT)          1208
 0x0000000000000000 (NULL)               0x0

Looks like it is not linked with libprotobuf at all.

@beatrix-bitrot

This comment has been minimized.

beatrix-bitrot commented May 10, 2017

the only other file in the directory with that one is cld3.rb

@akihikodaki

This comment has been minimized.

Owner

akihikodaki commented May 10, 2017

Probably you looked at gems directory. It should have extensions directory. For your information, I have:

  • ruby/2.4.0/extensions/x86_64-linux/2.4.0/cld3-3.1.0/gem.build_complete
  • ruby/2.4.0/extensions/x86_64-linux/2.4.0/cld3-3.1.0/gem_make.out
  • ruby/2.4.0/extensions/x86_64-linux/2.4.0/cld3-3.1.0/libcld3.so
  • ruby/2.4.0/extensions/x86_64-linux/2.4.0/cld3-3.1.0/mkmf.log

ruby/2.4.0/gems/cld3-3.1.0/ext/lib has libcld3.so and cld3.rb, as you said.

@beatrix-bitrot

This comment has been minimized.

beatrix-bitrot commented May 10, 2017

hmm

mkmf.log contains this:

package configuration for protobuf is not found

@beatrix-bitrot

This comment has been minimized.

beatrix-bitrot commented May 10, 2017

gem.build_complete was empty
gem_make.out had the verbose console output from building the gem, just warnings like

cc1plus: warning: command line option ‘-Wimplicit-int’ is valid for C/ObjC but not for C++
cc1plus: warning: unrecognized command line option ‘-Wno-self-assign’

and such

@akihikodaki

This comment has been minimized.

Owner

akihikodaki commented May 10, 2017

mkmf.log contains this:

package configuration for protobuf is not found

That is odd. Could you remove everything and reinstall? just in case something odd occurred.

cc1plus: warning: command line option ‘-Wimplicit-int’ is valid for C/ObjC but not for C++
cc1plus: warning: unrecognized command line option ‘-Wno-self-assign’

That is a fault of mkmf, which sets their C configuration to CXXFLAGS. They are just warnings and it should work anyway.

@esetomo

This comment has been minimized.

Contributor

esetomo commented May 10, 2017

same problem on Ubuntu 16.04.2 LTS

Could you tell me the result of pkg-config --modversion protobuf?

$ pkg-config --modversion protobuf
The program 'pkg-config' can be found in the following packages:
 * pkg-config
 * pkgconf
Try: sudo apt install <selected package>
$ sudo apt-get install pkg-config
$ gem install cld3

It became no problem.

It seems that installation was not aborted when pkg-config could not be detected.

@beatrix-bitrot

This comment has been minimized.

beatrix-bitrot commented May 10, 2017

@akihikodaki you were right! the one in vendor/bundle was created the first time i ran bundle install and didn't have the necessary dependencies. after that i was testing by doing gem install cld3, which installs to a different path, so the old one stayed in vendor/bundle. after removing it and bundling again everything is fine. thank you! i will copy this update into the other repo as well.

@akihikodaki

This comment has been minimized.

Owner

akihikodaki commented May 10, 2017

@beatrix-bitrot glad to see the problem got solved. :)

esetomo added a commit to esetomo/cld3-ruby that referenced this issue May 10, 2017

Should link protobuf (prevent akihikodaki#3)
When "-lprotobuf" can not be added to LIBS, installation is canceled.
This prevents installation of broken binary.

esetomo added a commit to esetomo/cld3-ruby that referenced this issue May 11, 2017

Abort install if failed to locate protobuf package. (prevent akihikod…
…aki#3)

Continue installing without collect LIBS will cause run-time error. Added abort.

akihikodaki added a commit that referenced this issue May 12, 2017

Abort install if failed to locate protobuf package. (prevent #3)
Continue installing without collect LIBS will cause run-time error. Added abort.

danhunsaker added a commit to danhunsaker/cld3-ruby that referenced this issue May 18, 2017

Bump Version Number
Bump the version number so the latest fix (for akihikodaki#3) can be published for the RubyGem.

akihikodaki added a commit that referenced this issue May 18, 2017

Bump Version Number
Bump the version number so the latest fix (for #3) can be published for the RubyGem.
@tvaz

This comment has been minimized.

tvaz commented Aug 22, 2018

esetomo's solution just worked for me, you need to sudo apt-get install pkg-config apparently. I thought my protobuf install was broken or something. orz thanks!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment