reiseburo / hermann

A gem providing cross-platform Kafka producer and consumer support
MIT License
70 stars 78 forks source link

undefined symbol: crc32 #117

Open aliekens opened 9 years ago

aliekens commented 9 years ago

After installing the Hermann gem on a clean Ubuntu LTS box, I get the following error when using Hermann from a simple producer test:

ruby: symbol lookup error: /home/HOME/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/hermann-0.24.1.dev/ext/hermann/hermann_lib.so: undefined symbol: crc32

Upon inspecting the hermann_lib.so file, I see no references to zlib (which should contain the crc32 symbol):

$ ldd /home/HOME/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/hermann-0.24.1.0/ext/hermann/hermann_lib.so
        linux-vdso.so.1 =>  (0x00007ffe71775000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fd7bb514000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fd7bb14f000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fd7bb96f000)

The only references to crc32 in this project are in the source code of librdkafka, which correctly includes zlib as a dependency:

$ ldd /home/HOME/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/hermann-0.24.1.0/ext/hermann/tmp/x86_64-linux-gnu/ports/librdkafka/0.8.6/librdkafka-0.8.6/src/librdkafka.so.1 
        linux-vdso.so.1 =>  (0x00007fff3f353000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f01fb45a000)
        libz.so.1 => /usr/local/lib/libz.so.1 (0x00007f01fb240000)
        librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f01fb037000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f01fac72000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f01fb8b2000)

I cannot replicate this problem on a my development Mac. Can someone help me pinpointing where the missing reference to crc32 may originate? Am I missing a dependency? Or did something go wrong in my build process (nothing seems to be wrong)?

rtyler commented 9 years ago

@aliekens do you have a full stacktrace? I don't think I've ever seen that before; 100% of my development is on Linux so I'm somewhat surprised that you're seeing an error.

One interesting thing that I do see is that zlib is coming from /usr/local/lib instead of /usr/lib64 which is where I would expect it to be.

rtyler commented 9 years ago

Bumping this thread, another question which migh tbe useful to answer is if LTS means 14.04 in this case?

evanchaoli commented 7 years ago

Try: export LD_PRELOAD=/usr/lib64/libz.so

before run the ruby process.