- /usr/lib/x86_64-linux-gnu/libpthread.so: invalid ELF header #1
- Comments
- iamacarpet commented May 3, 2019
- notti commented May 4, 2019
- notti commented May 4, 2019
- iamacarpet commented May 7, 2019
- iamacarpet commented May 7, 2019
- notti commented May 7, 2019
- notti commented May 9, 2019
- undefined symbol when importing torchaudio with pytorch #62
- Comments
- ccoulombe commented Oct 3, 2018 •
- sh0416 commented Oct 6, 2018
- XilunWu commented Oct 30, 2018
- darkspring2015 commented Nov 8, 2018
- darkspring2015 commented Nov 8, 2018
- ccoulombe commented Feb 11, 2019 •
- prajwalkr commented Feb 24, 2019
- dav-ell commented Apr 4, 2020
- jmlemercier commented Apr 16, 2020 •
- ccoulombe commented Apr 16, 2020 •
- NumesSanguis commented Mar 10, 2021
- Странная ошибка связывания: DSO отсутствует в командной строке
- 10 ответов
- Can’t find libawt.so #147
- Comments
- maseev commented Jul 7, 2016
- maseev commented Jul 7, 2016 •
- teichert commented Jul 8, 2016
- maseev commented Jul 8, 2016
- RichardWarburton commented Jul 8, 2016
- ikavalio commented Aug 5, 2016
- ajaygeorge commented Aug 30, 2016
- hube commented Oct 6, 2016
- ackhare commented Nov 24, 2016
- ackhare commented Nov 24, 2016
- RichardWarburton commented Dec 19, 2016
- ikavalio commented Dec 30, 2016
- RichardWarburton commented Jan 9, 2017
- ikavalio commented Jan 9, 2017
- ChrisLancs commented Mar 15, 2019 •
/usr/lib/x86_64-linux-gnu/libpthread.so: invalid ELF header #1
Comments
iamacarpet commented May 3, 2019
I’m trying to test this against my SQLite3 bindings, which I’ve modified to add Linux support with this library and pushed to a temporary repository: https://github.com/iamacarpet/go-sqlite3-dynamic
Trying to run it, I created a new folder with main_test.go , running with CGO_ENABLED=0 go test
It’s throwing the error:
On Ubuntu 18.04, /usr/lib/x86_64-linux-gnu/libpthread.so is an text file:
I checked for references to libpthread.so in your code and found a few.
Looking here , changing libpthread.so to libpthread.so.0 did nothing.
When I changed all occurrences in this file, the error changes to a segfault.
Am I doing something stupid?
The text was updated successfully, but these errors were encountered:
notti commented May 4, 2019
relink is from an older implementation and no longer needed.
So https://github.com/notti/nocgo/blob/master/fakecgo/symbols_linux.go is the right place and yeah it should have been libpthread.so.0 .
Hmm not sure yet about the segfault; I need to investigate a bit further there.
notti commented May 4, 2019
@iamacarpet something unrelated: You don’t have to specify the full path in https://github.com/iamacarpet/go-sqlite3-dynamic/blob/3b18947cf2a96fb8845e27db717c46781ec2fb6d/dynamic_register_linux.go#L65 — «libsqlite3.so.0» is enough.
On my linux your test works — so looks like there is something else going on that’s dependent on your environment. The traceback looks a bit weird (segfault on calling entersyscall?)
Can you try getting a traceback with gdb?
iamacarpet commented May 7, 2019
Back trace from gdb :
/go-projects/src/github.com/notti/nocgo/call_amd64.s:145 #8 0x00007ffff7f49078 in ?? () #9 0x00007ffff7fb3c28 in ?? () #10 0x00000000005bf440 in ?? () #11 0x00000000004545b0 in runtime.asmcgocall () at /usr/local/go/src/runtime/asm_amd64.s:635 #12 0x0000000000450ffc in runtime.(*mheap).alloc.func1 () at /usr/local/go/src/runtime/mheap.go:1048 #13 0x0000000000452dd6 in runtime.systemstack () at /usr/local/go/src/runtime/asm_amd64.s:351 #14 0x000000000042e2b0 in ?? () at /usr/local/go/src/runtime/proc.go:1082 #15 0x0000000000452c69 in runtime.rt0_go () at /usr/local/go/src/runtime/asm_amd64.s:201 #16 0x0000000000000000 in ?? () «>
I guess the actual error is this: dl-debug.c: No such file or directory.
Frustrating as the file does exist:
I changed my code to remove the full path as you suggested:
Then also tried:
to see if maybe it just didn’t want to follow the symlink, but no joy.
Tried it on an old Ubuntu 14.04 VM with Go 1.11 as well, but still the same thing.
Just out of interest, what distro/version did you test against that worked?
iamacarpet commented May 7, 2019
Ah, my mistake, that error was related to the glibc sources not being available, not the library not being found — my apologies, haven’t really used gdb before.
/go-projects/src/github.com/notti/nocgo/call_amd64.s:145 #8 0x00007ffff7f49078 in ?? () #9 0x00007ffff7fb3c28 in ?? () #10 0x00000000005bf440 in ?? () #11 0x00000000004545b0 in runtime.asmcgocall () at /usr/local/go/src/runtime/asm_amd64.s:635 #12 0x0000000000450ffc in runtime.(*mheap).alloc.func1 () at /usr/local/go/src/runtime/mheap.go:1048 #13 0x0000000000452dd6 in runtime.systemstack () at /usr/local/go/src/runtime/asm_amd64.s:351 #14 0x000000000042e2b0 in ?? () at /usr/local/go/src/runtime/proc.go:1082 #15 0x0000000000452c69 in runtime.rt0_go () at /usr/local/go/src/runtime/asm_amd64.s:201 #16 0x0000000000000000 in ?? () «>
Although that appears to make less sense to me now — hope it means something to you!
notti commented May 7, 2019
Thanks for the backtrace. This makes a bit more sense now (although I think I need a bit more debugging). What we’re seeing here is that calling dlopen works but it crashes then somewhere inside glibc.
Sadly it looks like I need to try to replicate this in a virtual machine or something — this will take a couple of days.
notti commented May 9, 2019
I could reproduce it. So now for the hard part: fixing it.
Источник
undefined symbol when importing torchaudio with pytorch #62
Comments
ccoulombe commented Oct 3, 2018 •
Hi,
When importing torchaudio with pytorch 0.4.1 I get an undefined symbol. It does however work with v0.4.0. audio version: 7314b36
The text was updated successfully, but these errors were encountered:
sh0416 commented Oct 6, 2018
I also encounter same problem.
The reason why the problem occur is virtual environment.
I use base environment and the problem doesn’t occur even if the version is 0.4.1
XilunWu commented Oct 30, 2018
Same problem. When I use virtual environment in conda, it occurs while it doesn’t occur in the base environment.
darkspring2015 commented Nov 8, 2018
How to install the package into existing virtual environment with Anaconda3?
I can not change to use the ‘base’ environment, because the Conda environment have installed so many packages
darkspring2015 commented Nov 8, 2018
To be Use the ‘base’ environment may cause some unkown errors,how to fix this bug?
ox.cpython-37m-x86_64-linux-gnu.so
linux-vdso.so.1 (0x00007ffefa331000)
libsox.so.3 => /usr/lib/x86_64-linux-gnu/libsox.so.3 (0x00007f15ce295000)
libstdc++.so.6 => /home//.conda/envs/PyTorch/lib/libstdc++.so.6 (0x00007f15ce5c8000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f15cdef7000)
libgcc_s.so.1 => /home//.conda/envs/PyTorch/lib/libgcc_s.so.1 (0x00007f15ce5b3000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f15cdcd8000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f15cd8e7000)
libltdl.so.7 => /usr/lib/x86_64-linux-gnu/libltdl.so.7 (0x00007f15cd6dd000)
libpng16.so.16 => /usr/lib/x86_64-linux-gnu/libpng16.so.16 (0x00007f15cd4ab000)
libz.so.1 => /home//.conda/envs/PyTorch/lib/libz.so.1 (0x00007f15cd294000)
libmagic.so.1 => /usr/lib/x86_64-linux-gnu/libmagic.so.1 (0x00007f15cd072000)
libgsm.so.1 => /usr/lib/x86_64-linux-gnu/libgsm.so.1 (0x00007f15cce65000)
libgomp.so.1 => /home//.conda/envs/PyTorch/lib/libgomp.so.1 (0x00007f15ce58b000)
Is this problem caused by source bug ?or other reason ?
how to build the packages?
or where to download the rebuild package with pip?
ccoulombe commented Feb 11, 2019 •
With torch 1.0.0, I monkey patched this issue. It is caused by an issue in torch where is does not detect correctly the ABI of the wheel and forces to add -D_GLIBCXX_USE_CXX11_ABI=0 when it was compiled with -D_GLIBCXX_USE_CXX11_ABI=1 . CFLAGS are not heard as the flag is forced at the end and the right most argument is the one heard by the compiler.
Make sure torchaudio is compiled with -D_GLIBCXX_USE_CXX11_ABI=1 if torch was build with CXX11_ABI.
prajwalkr commented Feb 24, 2019
@ccoulombe How do I make sure that torchaudio is compiled with that specific flag?
dav-ell commented Apr 4, 2020
Interested in the solution to this problem as well.
jmlemercier commented Apr 16, 2020 •
Really intersted in this solution as well: I have the same problem with Virtual AND Base environments. I use pytorch=1.4.0 and torchaudio=0.4.0
Tried installing torchaudio with pip and conda but I get the same issue.
Also tried to downgrade pytorch and torchaudio, but does not solve the issue, just adding new conflicts.
Would be very much appreciated if we re-opened this issue
[EDIT : solved this issue by downgrading to torchaudio=0.3.0 and torch=1.3.1 ]
ccoulombe commented Apr 16, 2020 •
This issue was fixed in pytorch
1.0.0 but I can re-trace the steps and provide more details when building from source. But maybe the wheels available on PyPI are built differently.
NumesSanguis commented Mar 10, 2021
This issue occurred to me with pytorch=1.8.0 , torchaudio=0.8.0 and cudatoolkit=11.1.1 through a conda environment.yaml install on Ubuntu 18.04:
/anaconda3/envs/some_env/lib/python3.8/site-packages/torchaudio/__init__.py in —-> 1 from . import extension # noqa: F401 2 from torchaudio._internal import module_utils as _mod_utils # noqa: F401 3 from torchaudio import ( 4 compliance, 5 datasets,
/anaconda3/envs/some_env/lib/python3.8/site-packages/torchaudio/extension/__init__.py in 3 ) 4 —-> 5 _init_extension() 6 7 del _init_extension
Источник
Странная ошибка связывания: DSO отсутствует в командной строке
когда я компилирую openvswitch-1.5.0, я столкнулся со следующей ошибкой компиляции:
Если я попытаюсь увидеть символы libpthread , это выглядит нормально.
не могли бы вы дать какие-либо подсказки или указатели?
10 ответов
вы должны упомянуть библиотеку в командной строке после объектные файлы, скомпилированные:
объяснение: связывание зависит от порядка следования модулей. Символы сначала запрашиваются, а затем связываются из библиотеки, в которой они есть. Поэтому сначала необходимо указать модули, использующие библиотеки,а затем библиотеки. Вот так:
кроме того, если есть круговая зависимость, вы должны указать ту же библиотеку на командная строка несколько раз. Так в случае libb нужен символ libc и libc нужен символ libb командная строка должна быть:
сообщение об ошибке зависит от дистрибутива / версии компилятора:
Ubuntu Raring: (более информативно)
устранение: на этапе компоновки может отсутствовать библиотека в шагах компиляции. В моем случае я добавил’ — lz ‘ к флагам makefile / GCC.
Справочная информация: DSO-это динамический общий объект или общая библиотека.
я нашел другой случай, и поэтому я думаю, что вы все ошибаетесь.
вот что у меня было:
проблема в том, что командная строка не содержит -lX11 — хотя libX11.поэтому следует добавить как зависимость, потому что в аргументах также были библиотеки GTK и GNOME.
Итак, единственное объяснение для меня заключается в том, что это сообщение могло быть предназначено для помочь, но он не сделал этого должным образом. Это было, вероятно, простой: библиотека, предоставляющая символ, не была добавлена в командную строку.
обратите внимание на три важных правила, касающиеся связи в POSIX:
- динамические библиотеки имеют определенные зависимости, поэтому только библиотеки из верхней зависимости должны быть предоставлены в любом порядке (хотя после статических библиотек)
- статические библиотеки имеют только неопределенные символы — это зависит от вас, чтобы узнать их зависимости и предоставить все из них в команде линия
- порядок static библиотеки всегда: истец впервые, провайдер следующее. В противном случае вы получите неопределенное символьное сообщение, как когда вы забыли добавить библиотеку в командную строку
- при указании библиотеки с -l , вы никогда не знаете, будет ли он принимать lib .so или lib .a . Динамическая библиотека предпочтительнее, если она найдена, а статические библиотеки могут применяться только с помощью опции компилятора — это все. И есть ли у вас какие-либо проблемы, как указано выше, это зависит от того, были ли у вас статические или динамические библиотеки
- ну, иногда зависимости могут отсутствовать в динамических библиотеках: D
Я обнаружил, что у меня была такая же ошибка. Я компиляции кода с lapack и Блас. Когда я переключил порядок вызова двух библиотек, ошибка исчезла.
» LAPACK_LIB = -llapack-lblas » работал там, где «LAPACK_LIB = -lblas-llapack» дал ошибку, описанную выше.
Я также столкнулся с той же проблемой. Не знаю почему, просто добавляю -lpthread опция компилятора и все в порядке.
получил следующее сообщение об ошибке. Если я добавлю -lpthread опция для команды выше, затем OK.
Я обнаружил, что иногда библиотека, на которую жалуется компоновщик, не является причиной проблемы. Возможно, есть умный способ выяснить, где проблема, но это то, что я делаю:
- прокомментируйте все связанные библиотеки в команде link.
- очистить все .o’s,.так и т. д. (Обычно достаточно очистить, но вы можете запустить рекурсивный find + rm или что-то подобное).
- раскомментируйте библиотеки по ссылке командуйте по одному и при необходимости меняйте порядок.
@peter karasev: я столкнулся с той же проблемой с проектом gcc 4.8.2 cmake на CentOS7. Порядок библиотек в разделе «target_link_libraries» важно. Я думаю, cmake просто передает список компоновщику как есть, т. е. он не пытается выработать правильный порядок. Это разумно — когда вы думаете об этом, cmake не может знать, что такое правильный порядок, пока соединение не будет успешно завершенный.
пожалуйста, добавьте: CFLAGS=»-lrt» и LDFLAGS=»-lrt»
то же самое произошло со мной, когда я устанавливал тест HPCC (включает HPL и несколько других тестов). Я добавил -lm к флагам компилятора в моем скрипте сборки, а затем он успешно скомпилирован.
та же проблема произошла со мной, когда я использую distcc сделать мой проект c++ ; Наконец, я решил это с export CXX=»distcc g++» .
при использовании g++ убедитесь, что вы не используете
Источник
Can’t find libawt.so #147
Comments
maseev commented Jul 7, 2016
I’ve been trying to run my application with honest-profiler agent recently, but I constantly get the following error during the JVM initialization:
Error occurred during initialization of VM
Could not find agent library /home/maseev/tools/other/honest-profiler/liblagent.so in absolute path, with error: libawt.so: cannot open shared object file: No such file or directory
At first, I thought that the problem was in the libawt.so library itself, because it didn’t exist. But then I run the find shell command:
My JAVA_HOME environment variable points to the same folder where the libawt.so library is located:
I even added another environment variable how it was suggested in this issue.
But it didn’t help at all.
My OS description:
Am I missing something? Are there any additional steps I have to perform in order to run honest-profiler?
The text was updated successfully, but these errors were encountered:
maseev commented Jul 7, 2016 •
It looks like that the liblagent.so has some unsatisfied shared dependencies:
In particular, it can’t find this library — libjvm.so. According to find this library does actually exist:
teichert commented Jul 8, 2016
I ran into this yesterday, too. After discovering the libraries that weren’t found (using ldd as you did) and after find where there were on my system (btw locate libjvm.so works well for that), I did something like the following to add them to the library path (I’m using bash):
Things worked for me after that (I actually was missing two libraries). I also added that line to my .bash_profile to make it automatic.
maseev commented Jul 8, 2016
It actually did the trick. Now I’m able to run my application with the honest-profiler agent. Thanks @teichert!
@RichardWarburton I think It would be great to add this information to the project’s wiki. WDYT?
RichardWarburton commented Jul 8, 2016
I’m happy to add the information. I just want to test it out first 😉
ikavalio commented Aug 5, 2016
Hi. I faced the same issue on machine where some of libjawt.so dependencies were not met and couldn’t be installed (i.e. libXext.so). I solved it by patching liblagent.so and removing libjawt.so from dynamic dependencies (https://github.com/NixOS/patchelf). Everything worked just fine after that. I guess AWT dependency is not required to build agent but CMake findJNI appends awt*.so to JNI_LIBRARIES. If you set JNI_LIBRARIES explicitly (to libjvm.so only) in CMakeLists.txt, shared library will be linked correctly.
ajaygeorge commented Aug 30, 2016
Thanks @ikavalio . Using patchelf helped me resolved this issue.
hube commented Oct 6, 2016
I ran into this issue and the solution suggested by @maseev in his July 8 comment worked for me
ackhare commented Nov 24, 2016
Please help I am facing the same issue
How to use patchelf @ajaygeorge
ackhare commented Nov 24, 2016
I was able to do
The command will be
patchelf —remove-needed libjawt.so /home/chetan/Downloads/honest-profiler/liblagent.so
RichardWarburton commented Dec 19, 2016
I’ve just investigated this issue this afternoon and for me libjawt.so isn’t required for me. Is this an issue that is specific to a certain JVM version or is it Mac specific or something?
ikavalio commented Dec 30, 2016
@RichardWarburton, when I’m compiling agent from scratch under Ubuntu 16.10 it’s not added as a dependency, however cmake includes libawt to JNI_LIBRARIES variable. Under El Capitan libawt is not added as a dependency as well.
I think it is an issue of old .so library and the way it was linked.
RichardWarburton commented Jan 9, 2017
@ikavalio my apologies for being dumb here, but I’m not sure whether the issue is fixed for you or not? If it’s not fixed, is there any chance you can just list how to reproduce the problem or on what platform it occurs?
ikavalio commented Jan 9, 2017
@RichardWarburton, no problem at all. I couldn’t reproduce the problem on any machine/platform available to me (both OS X and Linux, clang++ and gcc).
ChrisLancs commented Mar 15, 2019 •
A solution I found to work generally may not work in this case is worth a try, at the worst it will make no difference, at best it will fix the issue you have.
Find the path you want to the link applying to (/usr/lib/ as below is common, but may not show in your properties output, adjust this part to reflect one that is shown by the following command, if there is one that has java in the path you may use that for sake of keeping things together but /usr/lib would work just as well if available.)
$ java -XshowSettings:properties
Find the location of any existing libjawt.so and use its path in the place of
$ locate libjawt.so
make the link.
$ sudo ln -s /libjawt.so /usr/lib/libjawt.so
Run your application again, should resolve the dependency.
This was mine under *Ubuntu18.04 with openjdk 11 installed but yours may be different, just «locate» it and you should be set.
With this there is no need to
add anything to the environment or bashrc as its already pulled in.
Источник