pmelsted / bifrost

Bifrost: Highly parallel construction and indexing of colored and compacted de Bruijn graphs
BSD 2-Clause "Simplified" License
201 stars 25 forks source link

stack smashing detected #62

Closed khodor14 closed 2 years ago

khodor14 commented 2 years ago

I installed the source code of bifrost to use large kmer size.

I used this command to compile cmake .. -DENABLE_AVX2=OFF -DCOMPILATION_ARCH=OFF -DMAX_KMER_SIZE=64 && make && make install

Then i executed the build command ./bifrost/build/build/bin/Bifrost build -r genomes/LM995446.1.fa -k 63 -t 16 -o bifrost_dbg

I ended up with this message *** stack smashing detected ***: ./bifrost/build/build/bin/Bifrost terminated ======= Backtrace: ========= *** /lib64/libc.so.6(__fortify_fail+0x37)[0x7fc0d3e4d7a7*** stack smashing detected ***: ./bifrost/build/build/bin/Bifrost terminated /lib64/libc.so.6(+0x118762)[0x7fc0d3e4d762] It seems that there is a buffer overflow.

Could you give insight how to do a workaround this issue?

Thank you in advance

GuillaumeHolley commented 2 years ago

Hi @khodor14,

Thanks for reporting the issue. Your compile and execution commands seem fine to me. Could you share the output log of Bifrost and eventually the input fasta file you used?

Guillaume

khodor14 commented 2 years ago

Thank you @GuillaumeHolley for your reply

I think this is a problem in the machine where I'm trying to compile the code. I tried to compile bifrost on my personal pc, it worked but when copying the binary code it raised other issues ./Bifrost: /lib64/libm.so.6: versionGLIBC_2.29' not found (required by ./Bifrost) ./Bifrost: /lib64/libc.so.6: version GLIBC_2.33' not found (required by ./Bifrost) ./Bifrost: /lib64/libstdc++.so.6: versionGLIBCXX_3.4.20' not found (required by ./Bifrost) ./Bifrost: /lib64/libstdc++.so.6: version CXXABI_1.3.8' not found (required by ./Bifrost) ./Bifrost: /lib64/libstdc++.so.6: versionGLIBCXX_3.4.29' not found (required by ./Bifrost) ./Bifrost: /lib64/libstdc++.so.6: version GLIBCXX_3.4.26' not found (required by ./Bifrost) ./Bifrost: /lib64/libstdc++.so.6: versionGLIBCXX_3.4.21' not found (required by ./Bifrost) ./Bifrost: /lib64/libstdc++.so.6: version GLIBCXX_3.4.22' not found (required by ./Bifrost) ./Bifrost: /lib64/libm.so.6: versionGLIBC_2.29' not found (required by libbifrost.so) ./Bifrost: /lib64/libc.so.6: version GLIBC_2.33' not found (required by libbifrost.so) ./Bifrost: /lib64/libstdc++.so.6: versionGLIBCXX_3.4.20' not found (required by libbifrost.so) ./Bifrost: /lib64/libstdc++.so.6: version CXXABI_1.3.8' not found (required by libbifrost.so) ./Bifrost: /lib64/libstdc++.so.6: versionGLIBCXX_3.4.29' not found (required by libbifrost.so) ./Bifrost: /lib64/libstdc++.so.6: version GLIBCXX_3.4.26' not found (required by libbifrost.so) ./Bifrost: /lib64/libstdc++.so.6: versionGLIBCXX_3.4.21' not found (required by libbifrost.so) ./Bifrost: /lib64/libstdc++.so.6: version GLIBCXX_3.4.22' not found (required by libbifrost.so)

which means that it needs static compilation because in the previous compilation it did not raise this issue, it just gets aborted during the graph construction.

GuillaumeHolley commented 2 years ago

Yes, it is likely that the machine where you are trying to run Bifrost has older GLIBC dependencies than your personal PC. One solution is to compile Bifrost using an older GCC on your personal PC (same version as the GCC on the machine you are using for execution). Another solution is what you mention, static linking. For that, please try to modify the following line in the src/CMakeLists.txt such that

target_link_libraries(Bifrost bifrost_dynamic)

is replaced with

target_link_libraries(Bifrost bifrost_static)

If it works, I will probably add an option to the cmake to force static over dynamic linking. That being said, if the machine where you are trying to run Bifrost is also the machine where you had your first issue, I am not completely convinced that the static linking will help but you can try. Please let me know how it goes.

Guillaume

GuillaumeHolley commented 2 years ago

Also, please make sure you delete and make a new build directory after modifying the line in order for Cmake to make a brand new compilation. Otherwise, it might reuse some (older and hence, invalid) files and things might get messy.

khodor14 commented 2 years ago

Thank you @GuillaumeHolley for your help

it was a problem with cmake and gcc. Now it works well on the previous machine.

i will close the issue