Skip to content
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

linuxbrew: brew install grpc fails: failed to set dynamic section sizes: File truncated #94

Closed
timotheecour opened this issue Nov 11, 2016 · 12 comments · Fixed by #99
Closed

Comments

@timotheecour
Copy link
Contributor

timotheecour commented Nov 11, 2016

brew install grpc
==> Reinstalling grpc/grpc/grpc
==> Downloading https://github.com/grpc/grpc/archive/v1.0.1.tar.gz
Already downloaded: /home/timothee/.cache/Homebrew/grpc-1.0.1.tar.gz
==> [ "$(ls -A third_party/nanopb)" ] || git clone --branch=nanopb-0.3.5 https://github.com/nanopb/nanopb.git third_party/nanopb
==> make install prefix=/home/timothee/shared/temp1/.linuxbrew/Cellar/grpc/1.0.1
Last 15 lines from /home/timothee/.cache/Homebrew/Logs/grpc/02.make:
[LD]      Linking /tmp/grpc-20161111-9385-100u5xd/grpc-1.0.1/libs/opt/libgrpc.so.1.0.1
[LD]      Linking /tmp/grpc-20161111-9385-100u5xd/grpc-1.0.1/libs/opt/libgrpc_cronet.so.1.0.1
[LD]      Linking /tmp/grpc-20161111-9385-100u5xd/grpc-1.0.1/libs/opt/libgrpc_unsecure.so.1.0.1
[INSTALL] Installing C++ pkg-config files
[STRIP]   Stripping libgpr.a
[STRIP]   Stripping libgrpc.a
/usr/bin/ld: failed to set dynamic section sizes: File truncated
collect2: error: ld returned 1 exit status
make: *** [Makefile:2939: /tmp/grpc-20161111-9385-100u5xd/grpc-1.0.1/libs/opt/libgrpc_cronet.so.1.0.1] Error 1
make: *** Waiting for unfinished jobs....
/usr/bin/ld: failed to set dynamic section sizes: File truncated
collect2: error: ld returned 1 exit status
make: *** [Makefile:2690: /tmp/grpc-20161111-9385-100u5xd/grpc-1.0.1/libs/opt/libgrpc.so.1.0.1] Error 1
[STRIP]   Stripping libgrpc_cronet.a
[STRIP]   Stripping libgrpc_unsecure.a

READ THIS: https://github.com/Linuxbrew/brew/blob/master/docs/Troubleshooting.md#troubleshooting
If reporting this issue please do so at (not Homebrew/brew):
  https://github.com/grpc/homebrew-grpc/issues

These open issues may also help:
grpc++.h is missing https://github.com/grpc/homebrew-grpc/issues/68
grpc python installed with virtualenv, code complains no google.protobuf found on Mac OS X https://github.com/grpc/homebrew-grpc/issues/71
Add a test to formula to verify that gRPC built correctly https://github.com/grpc/homebrew-grpc/issues/2
Installer fails with "error: could not create '/usr/local/lib/python2.7/dist-packages/grpc': Permission denied" https://github.com/grpc/homebrew-grpc/issues/75
exit_code: 1

brew gist-logs grpc
https://gist.github.com/5ceafa82a41179f10fba35695108baf6

rerunning sometimes gives:

*** Error in `/tmp/grpc-20161114-25812-1x1fxxg/grpc-1.0.1/bins/opt/grpc_cpp_plugin': free(): invalid pointer: 0x00007fff39e92c88 ***
@timotheecour
Copy link
Contributor Author

timotheecour commented Nov 15, 2016

related: http://www.linuxquestions.org/questions/programming-9/usr-bin-ld-failed-to-set-dynamic-section-sizes-file-truncated-4175553982/

says this worked (in another setting)

Code:
%build
make X-Configure name=linux
make -j 1
The "make X-Configure name=linux" is the configure step for the build.

The "-j 1" turns off the multiple simultaneous compile feature of gnu make; it appears in this circumstance, the make results were stomping on each other.

but I tried:

HOMEBREW_MAKE_JOBS=1 ./bin/brew install grpc

it gives:

*** Error in `/tmp/grpc-20161114-2713-1jmg025/grpc-1.0.1/bins/opt/grpc_cpp_plugin': free(): invalid pointer: 0x00007ffdce002d78 ***
third_party/protobuf/src: warning: directory does not exist.

@eiennohito
Copy link

Actually fails with

Undefined symbols for architecture x86_64:
  "_grpc_global_wakeup_fd", referenced from:
      _grpc_init_poll_posix in ev_poll_posix.o
      _grpc_init_poll_cv_posix in ev_poll_posix.o
      _pollset_work in ev_poll_posix.o
      _kick_poller in ev_poll_posix.o
      _shutdown_engine in ev_poll_posix.o
ld: symbol(s) not found for architecture x86_64

when adding --verbose to homebrew flags.

@timotheecour
Copy link
Contributor Author

timotheecour commented Jan 8, 2017

any update on this?
running on a fresh linuxbrew install i get:

/sbin/ldconfig.real: Can't create temporary cache file /etc/ld.so.cache~: Permission denied
*** Error in `/tmp/grpc-20170108-7068-uypgdh/grpc-1.0.1/bins/opt/grpc_cpp_plugin': free(): invalid pointer: 0x00007ffed9028b58 ***
third_party/protobuf/src: warning: directory does not exist.
make: *** [Makefile:2011: /tmp/grpc-20170108-7068-uypgdh/grpc-1.0.1/gens/src/proto/grpc/testing/payloads.grpc.pb.cc] Error 1

@eiennohito: please show your brew gist-logs grpc

@eiennohito
Copy link

eiennohito commented Jan 10, 2017

@timotheecour brew install grpc --with-plugins --HEAD worked for me right now:
homebrew-grpc: 54bc688
grpc: a3960b98d6a1b85a1e3b89cd7797a509505fa207

@timotheecour
Copy link
Contributor Author

doesn't work for me (on linuxbrew) ; are you using hombrew or linuxbrew?
https://gist.github.com/11924a4b0dd385438052d570ef5e667f

@eiennohito
Copy link

I was using Mac, so Homebrew.
Need to check Linuxbrew as well.

@eiennohito
Copy link

Linuxbrew version works for me as well. (Built on CentOS 7)

@timotheecour
Copy link
Contributor Author

i am on ubuntu 14.04

@timotheecour
Copy link
Contributor Author

timotheecour commented Jan 17, 2017

UPDATE:
this bug occurred when running brew install grpc on linuxbrew.
I found the cause: https://github.com/grpc/homebrew-grpc/blob/master/Formula/grpc.rb uses https://github.com/grpc/grpc/archive/v1.0.1.tar.gz and that includes a generated pb file (include/grpc++/ext/reflection.grpc.pb.h) in the sources (which is a bad idea) that was compiled w proto version 3.0.

But brew install proto installs proto version 3.1 (currently), hence this error message:

[CXX]     Compiling src/cpp/ext/proto_server_reflection.cc
In file included from include/grpc++/ext/reflection.grpc.pb.h:73:0,
                 from ./src/cpp/ext/proto_server_reflection.h:39,
                 from src/cpp/ext/proto_server_reflection.cc:39:
include/grpc++/ext/reflection.pb.h:51:2: error: #error This file was generated by an older version of protoc which is
 #error This file was generated by an older version of protoc which is
include/grpc++/ext/reflection.pb.h:52:2: error: #error incompatible with your Protocol Buffer headers. Please
 #error incompatible with your Protocol Buffer headers.  Please
  ^
include/grpc++/ext/reflection.pb.h:53:2: error: #error regenerate this file with a newer version of protoc.
 #error regenerate this 

This PR grpc/grpc#8380 has recently removed the offending generated files, so the brew formula should use a revision >= grpc/grpc@169c985

But: brew install --HEAD grpc unfortunately doesn't work either (see above), due to (yet) another reason

NOTE: #96 is probably related

brew install --HEAD -v grpc:


[INSTALL] Installing libgrpc_unsecure.a
/sbin/ldconfig.real: Can't create temporary cache file /etc/ld.so.cache~: Permission denied
[AR]      Creating /tmp/grpc-20170117-23042-1bmc0aa/libs/opt/libgrpc_plugin_support.a

[GRPC]    Generating gRPC's protobuf service CC file from src/proto/grpc/reflection/v1alpha/reflection.proto
/tmp/grpc-20170117-23042-1bmc0aa/bins/opt/grpc_cpp_plugin: symbol lookup error: /tmp/grpc-20170117-23042-1bmc0aa/bins/opt/grpc_cpp_plugin: undefined symbol: _ZNK6google8protobuf8compiler13CodeGenerator11GenerateAllERKSt6vectorIPKNS0_14FileDescriptorESaIS6_EERKSsPNS1_16GeneratorContextEPSs
--grpc_out: protoc-gen-grpc: Plugin failed with status code 127.

@timotheecour timotheecour changed the title brew install grpc fails: failed to set dynamic section sizes: File truncated linuxbrew: brew install grpc fails: failed to set dynamic section sizes: File truncated Feb 13, 2017
@timotheecour
Copy link
Contributor Author

ping @stanley-cheung is this repository still being developped?
brew install grpc/grpc/grpc from a fresh brew clone is still broken as of today (and has been since first time i tried, 3 months ago). Tried on multiple different ubuntu machines.

@timotheecour
Copy link
Contributor Author

@stanley-cheung question still holds: is this repository still being developped?

@stanley-cheung
Copy link
Contributor

Yes the repository is still being maintained, although I am also trying to add the grpc formula to the main homebrew repo. See #97

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants