alpinelinux / docker-alpine

Official Alpine Linux Docker image. Win at minimalism!
MIT License
1.09k stars 261 forks source link

backtrace_symbols_fd: symbol / backtrace: symbol not found / error while loading shared libraries: libz.so.1 #26

Closed SaturnusDJ closed 5 years ago

SaturnusDJ commented 5 years ago

Internet searched quite a bit, tried a lot of things including previous issues in this repo, some progress, but no working program yet.

Trying to build a minimal image. Works with debian:stretch, but size is x10 versus alpine. (All via Dockerfile build)

Initially:

Command not found

/fr24feed_amd64 # ldd fr24feed
        /lib64/ld-linux-x86-64.so.2 (0x7f7495169000)
        libz.so.1 => /lib/libz.so.1 (0x7f7494f52000)
        libpthread.so.0 => /lib64/ld-linux-x86-64.so.2 (0x7f7495169000)
Error loading shared library libstdc++.so.6: No such file or directory (needed by fr24feed)
        libm.so.6 => /lib64/ld-linux-x86-64.so.2 (0x7f7495169000)
Error loading shared library libgcc_s.so.1: No such file or directory (needed by fr24feed)
        libc.so.6 => /lib64/ld-linux-x86-64.so.2 (0x7f7495169000)
Error relocating fr24feed: _ZNSs6appendEPKcm: symbol not found
Error relocating fr24feed: _ZNKSs16find_last_not_ofEPKcmm: symbol not found
Error relocating fr24feed: _ZSt20__throw_length_errorPKc: symbol not found
Error relocating fr24feed: _ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RSbIS4_S5_T1_ES4_: symbol not found
Error relocating fr24feed: _ZNSolsEi: symbol not found
Error relocating fr24feed: backtrace: symbol not found
Error relocating fr24feed: _ZSt16__throw_bad_castv: symbol not found
Error relocating fr24feed: _ZNSo9_M_insertIlEERSoT_: symbol not found
Error relocating fr24feed: _ZSt24__throw_out_of_range_fmtPKcz: symbol not found
Error relocating fr24feed: _ZNSs9_M_mutateEmmm: symbol not found
Error relocating fr24feed: _ZNKSs6substrEmm: symbol not found
Error relocating fr24feed: _ZNSt8ios_baseC2Ev: symbol not found
Error relocating fr24feed: __cxa_guard_acquire: symbol not found
Error relocating fr24feed: _ZNSsC1EPKcmRKSaIcE: symbol not found
Error relocating fr24feed: _ZNSs6assignEPKc: symbol not found
Error relocating fr24feed: _Znam: symbol not found
Error relocating fr24feed: _ZdlPv: symbol not found
Error relocating fr24feed: _ZNSs7reserveEm: symbol not found
Error relocating fr24feed: _ZNKSt5ctypeIcE13_M_widen_initEv: symbol not found
Error relocating fr24feed: __cxa_rethrow: symbol not found
Error relocating fr24feed: __cxa_throw_bad_array_new_length: symbol not found
Error relocating fr24feed: _ZNSt6chrono3_V212system_clock3nowEv: symbol not found
Error relocating fr24feed: _ZNKSs12find_last_ofEPKcmm: symbol not found
Error relocating fr24feed: _ZSt18_Rb_tree_decrementPSt18_Rb_tree_node_base: symbol not found
Error relocating fr24feed: _ZNSs4_Rep9_S_createEmmRKSaIcE: symbol not found
Error relocating fr24feed: _ZNSsC1ERKSs: symbol not found
Error relocating fr24feed: _ZNSt13runtime_errorC1ERKSs: symbol not found
Error relocating fr24feed: _ZNSt13basic_filebufIcSt11char_traitsIcEE4openEPKcSt13_Ios_Openmode: symbol not found
Error relocating fr24feed: _ZNSsD1Ev: symbol not found
Error relocating fr24feed: _ZNKSs17find_first_not_ofEPKcmm: symbol not found
Error relocating fr24feed: _ZNSs4_Rep10_M_destroyERKSaIcE: symbol not found
Error relocating fr24feed: _ZNKSs13find_first_ofEPKcmm: symbol not found
Error relocating fr24feed: __cxa_guard_release: symbol not found
Error relocating fr24feed: _ZNSs6insertEmPKcm: symbol not found
Error relocating fr24feed: _ZSt18_Rb_tree_incrementPKSt18_Rb_tree_node_base: symbol not found
Error relocating fr24feed: _ZNKSs4findEcm: symbol not found
Error relocating fr24feed: _ZNKSs7compareEPKc: symbol not found
Error relocating fr24feed: _ZNSsC1EPKcRKSaIcE: symbol not found
Error relocating fr24feed: _ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev: symbol not found
Error relocating fr24feed: _ZNKSs4findEPKcmm: symbol not found
Error relocating fr24feed: _ZNSs2atEm: symbol not found
Error relocating fr24feed: _ZNSt6localeC1Ev: symbol not found
Error relocating fr24feed: _ZNSo9_M_insertIbEERSoT_: symbol not found
Error relocating fr24feed: _ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l: symbol not found
Error relocating fr24feed: _ZNSt19basic_istringstreamIcSt11char_traitsIcESaIcEED1Ev: symbol not found
Error relocating fr24feed: _ZNSt9basic_iosIcSt11char_traitsIcEE4initEPSt15basic_streambufIcS1_E: symbol not found
Error relocating fr24feed: _ZSt29_Rb_tree_insert_and_rebalancebPSt18_Rb_tree_node_baseS0_RS_: symbol not found
Error relocating fr24feed: _ZNSt8ios_baseD2Ev: symbol not found
Error relocating fr24feed: _ZNSt19basic_ostringstreamIcSt11char_traitsIcESaIcEED1Ev: symbol not found
Error relocating fr24feed: _ZSt28_Rb_tree_rebalance_for_erasePSt18_Rb_tree_node_baseRS_: symbol not found
Error relocating fr24feed: _ZNSt12__basic_fileIcED1Ev: symbol not found
Error relocating fr24feed: __cxa_allocate_exception: symbol not found
Error relocating fr24feed: _ZNSs6assignEPKcm: symbol not found
Error relocating fr24feed: __cxa_free_exception: symbol not found
Error relocating fr24feed: _ZNSt15basic_stringbufIcSt11char_traitsIcESaIcEE7_M_syncEPcmm: symbol not found
Error relocating fr24feed: _ZNSs5eraseEmm: symbol not found
Error relocating fr24feed: _ZNSs6assignERKSs: symbol not found
Error relocating fr24feed: _ZSt19__throw_logic_errorPKc: symbol not found
Error relocating fr24feed: _ZNSt13runtime_errorD1Ev: symbol not found
Error relocating fr24feed: _ZdaPv: symbol not found
Error relocating fr24feed: _ZNSs6appendEPKc: symbol not found
Error relocating fr24feed: _ZNSs5eraseEN9__gnu_cxx17__normal_iteratorIPcSsEES2_: symbol not found
Error relocating fr24feed: _ZNSt9basic_iosIcSt11char_traitsIcEE5clearESt12_Ios_Iostate: symbol not found
Error relocating fr24feed: __cxa_throw: symbol not found
Error relocating fr24feed: backtrace_symbols_fd: symbol not found
Error relocating fr24feed: _ZNKSt15basic_stringbufIcSt11char_traitsIcESaIcEE3strEv: symbol not found
Error relocating fr24feed: _ZNSt13basic_filebufIcSt11char_traitsIcEEC1Ev: symbol not found
Error relocating fr24feed: _ZNSo9_M_insertImEERSoT_: symbol not found
Error relocating fr24feed: _ZSt18_Rb_tree_incrementPSt18_Rb_tree_node_base: symbol not found
Error relocating fr24feed: _ZNSo9_M_insertIdEERSoT_: symbol not found
Error relocating fr24feed: __cxa_end_catch: symbol not found
Error relocating fr24feed: _ZNKSs7compareEmmRKSs: symbol not found
Error relocating fr24feed: _ZNKSs7compareEmmPKc: symbol not found
Error relocating fr24feed: _ZNSt13basic_filebufIcSt11char_traitsIcEED1Ev: symbol not found
Error relocating fr24feed: __cxa_guard_abort: symbol not found
Error relocating fr24feed: __cxa_begin_catch: symbol not found
Error relocating fr24feed: _ZNSt6chrono3_V212steady_clock3nowEv: symbol not found
Error relocating fr24feed: __gxx_personality_v0: symbol not found
Error relocating fr24feed: _ZNSt19basic_ostringstreamIcSt11char_traitsIcESaIcEEC1ESt13_Ios_Openmode: symbol not found
Error relocating fr24feed: _Znwm: symbol not found
Error relocating fr24feed: _ZNSsC1ERKSsmm: symbol not found
Error relocating fr24feed: _Unwind_Resume: symbol not found
Error relocating fr24feed: _ZNSt6localeD1Ev: symbol not found
Error relocating fr24feed: _ZNKSt12__basic_fileIcE7is_openEv: symbol not found
Error relocating fr24feed: _ZNSs12_M_leak_hardEv: symbol not found
Error relocating fr24feed: _ZNSs4swapERSs: symbol not found
Error relocating fr24feed: _ZNSs6appendERKSs: symbol not found
Error relocating fr24feed: _ZNSt13basic_filebufIcSt11char_traitsIcEE5closeEv: symbol not found
Error relocating fr24feed: _ZTVSt15basic_stringbufIcSt11char_traitsIcESaIcEE: symbol not found
Error relocating fr24feed: _ZTVSt9basic_iosIcSt11char_traitsIcEE: symbol not found
Error relocating fr24feed: _ZTVSt19basic_ostringstreamIcSt11char_traitsIcESaIcEE: symbol not found
Error relocating fr24feed: _ZTTSt19basic_istringstreamIcSt11char_traitsIcESaIcEE: symbol not found
Error relocating fr24feed: _ZTVSt13basic_filebufIcSt11char_traitsIcEE: symbol not found
Error relocating fr24feed: _ZTTSt19basic_ostringstreamIcSt11char_traitsIcESaIcEE: symbol not found
Error relocating fr24feed: _ZTVSt14basic_ifstreamIcSt11char_traitsIcEE: symbol not found
Error relocating fr24feed: _ZTVN10__cxxabiv117__class_type_infoE: symbol not found
Error relocating fr24feed: _ZTISt13runtime_error: symbol not found
Error relocating fr24feed: _ZTIPKc: symbol not found
Error relocating fr24feed: _ZTIi: symbol not found
Error relocating fr24feed: _ZTVN10__cxxabiv120__si_class_type_infoE: symbol not found
Error relocating fr24feed: _ZTTSt14basic_ifstreamIcSt11char_traitsIcEE: symbol not found
Error relocating fr24feed: _ZTVN10__cxxabiv121__vmi_class_type_infoE: symbol not found
Error relocating fr24feed: _ZTVSt15basic_streambufIcSt11char_traitsIcEE: symbol not found
Error relocating fr24feed: _ZNSs4_Rep20_S_empty_rep_storageE: symbol not found
Error relocating fr24feed: _ZTVSt19basic_istringstreamIcSt11char_traitsIcESaIcEE: symbol not found

After getting libgcc libstdc++ (apk add libgcc libstdc++ )

/fr24feed_amd64 # ldd ./fr24feed
        /lib64/ld-linux-x86-64.so.2 (0x7ff8351a8000)
        libz.so.1 => /lib/libz.so.1 (0x7ff834f91000)
        libpthread.so.0 => /lib64/ld-linux-x86-64.so.2 (0x7ff8351a8000)
        libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x7ff834c3f000)
        libm.so.6 => /lib64/ld-linux-x86-64.so.2 (0x7ff8351a8000)
        libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x7ff834a2d000)
        libc.so.6 => /lib64/ld-linux-x86-64.so.2 (0x7ff8351a8000)
Error relocating ./fr24feed: backtrace: symbol not found
Error relocating ./fr24feed: backtrace_symbols_fd: symbol not found

After:

wget --no-check-certificate "https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.29-r0/glibc-2.29-r0.apk" && \
apk add --allow-untrusted glibc-2.29-r0.apk && \

Result:

/fr24feed_amd64 # ./fr24feed
./fr24feed: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
/fr24feed_amd64 #

Also tried: libbsd libbsd-dev zlib1g.

Just not gonna work due to the pre-compiling (source not available) or still something left to try?

SaturnusDJ commented 5 years ago

Would https://wiki.alpinelinux.org/wiki/Running_glibc_programs be a solution? I tried it but cannot get it to work yet. If this is the wrong place to ask, apologies, please point me where to go.

SaturnusDJ commented 5 years ago

Got it working like this:

wget --no-check-certificate https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.29-r0/glibc-2.29-r0.apk && \
wget --no-check-certificate https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.29-r0/glibc-bin-2.29-r0.apk && \
apk add --no-cache --allow-untrusted glibc-2.29-r0.apk && \
apk add --no-cache --allow-untrusted glibc-bin-2.29-r0.apk && \