dlopen

What can cause dlopen: no suitable image found (can't map)?

匿名 (未验证) 提交于 2019-12-03 08:41:19
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: What can cause the following error when loading an additional bundle using dlopen: dlopen($(OBJ_DIR)/Test-2009 12 1721 12 56.ob, 6): no suitable image found. Did find: $(OBJ_DIR)/Test-2009 12 1721 12 56.ob: can't map Before this error, the process allocates large amounts of memory. (Substituted $(OBJ_DIR) in the error for the actual path to make it more legible). 回答1: One possibility is that the shared library you're trying to open isn't actually a shared library. Run the file(1) program on your library to make sure it's actually a shared

dlopen vs linking overhead

点点圈 提交于 2019-12-03 07:57:50
Suppose I have a library - foo.so . When building my binary (which needs this library), I can either (1) link foo.so , or, (2) within the program source code, dlopen this library and then call functions provided by this library Is there any performance difference between (1) and (2) when I call a function from the library? Note that I am aware that there will be different initialization characteristics (like the cost of the dlopen , overhead for first usage of a symbol etc) but in the steady state, are both alternatives equally fast or is one faster? Thanks. If the library is a shared object

Difference between linking OpenMP with -fopenmp and -lgomp

只谈情不闲聊 提交于 2019-12-03 06:41:25
I've been struggling a weird problem the last few days. We create some libraries using GCC 4.8 which link some of their dependencies statically - eg. log4cplus or boost. For these libraries we have created Python bindings using boost-python. Every time such a library used TLS (like log4cplus does in it's static initialization or stdlibc++ does when throwing an exception - not only during initialization phase) the whole thing crashed in a segfault - and every time the address of the thread local variable has been 0. I tried everything like recompiling, ensuring -fPIC is used, ensuring -tls

dlopen and global variables in C/C++

落花浮王杯 提交于 2019-12-03 06:25:17
Due to some restrictions I am being forced to load a library written in C at runtime. A third party provides two library to me as static archives which we turn into shared objects. The application I'm working with loads one of the libraries at runtime based on some hardware parameters. Unfortunately one of the libraries is configured largely with global variables. I am already using dlsym to load function references but can I used dlsym to load references to these global variables as well? Yes, you can use dlsym to access globals (as long as they are exported, and not static). The example

dlclose() does not call the destructor of global objects

余生颓废 提交于 2019-12-03 05:46:19
问题 plugin1.cpp: #include <iostream> static class TestStatic { public: TestStatic() { std::cout << "TestStatic create" << std::endl; } ~TestStatic() { std::cout << "TestStatic destroy" << std::endl; } } test_static; host.cpp #include <dlfcn.h> #include <iostream> int main(int argc,char *argv[]) { void* handle = dlopen("./plugin1.so",RTLD_NOW | RTLD_LOCAL ); dlclose(handle); return 0; } build and run: >g++ -c plugin1.cpp -o plugin1.o -fPIC >g++ -shared plugin.o -o plugin1.so >g++ host.cpp -o host

dlopen() failed to load a library: cairo / cairo-2

匿名 (未验证) 提交于 2019-12-03 02:24:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: This is my view: from django.conf import settings from django.http import HttpResponse from django.template.loader import render_to_string import weasyprint @staff_member_required def admin_order_pdf(request, order_id): order = get_object_or_404(Order, id=order_id) html = render_to_string('orders/order/pdf.html', {'order': order}) response = HttpResponse(content_type='application/pdf') response['Content-Disposition'] = 'filename="order_{}.pdf"'.format(order.id) weasyprint.HTML(string=html).write_pdf(response, stylesheets=[weasyprint.CSS

“OSError: dlopen(libSystem.dylib, 6): image not found” (OS X + macports + Celery 3.1.7)

匿名 (未验证) 提交于 2019-12-03 02:03:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I just updated celery via pip (1.5) to the latest version (3.1.7), but I get a fatal exception which I don't understand as soon I try to import the library. By running: from celery import Celery in the shell I get: File " ", line 1, in File "/Users/davidezanotti/CygoraPythonEnv/lib/python2.7/site-packages/celery/__init__.py", line 130, in from .five import recreate_module File "/Users/davidezanotti/CygoraPythonEnv/lib/python2.7/site-packages/celery/five.py", line 51, in from kombu.five import monotonic File "/Users/davidezanotti

UnsatisfiedLinkError: dlopen failed: cannot locate symbol “strtof” referenced by “libsupportjni.so” on API &lt;20

匿名 (未验证) 提交于 2019-12-03 01:27:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm getting the following error immediately on launch, but only for devices running API **edit: I initially reported this in Android Studio 2.4, and it's still an issue in Android Studio 3.0 stable D/dalvikvm: Trying to load lib /mnt/asec/[[packagename]]-1/lib/libsupportjni.so 0x41b13f30 E/dalvikvm: dlopen("/mnt/asec/[[packagename]]-1/lib/libsupportjni.so") failed: dlopen failed: cannot locate symbol "strtof" referenced by "libsupportjni.so"... W/dalvikvm: Exception Ljava/lang/UnsatisfiedLinkError; thrown while initializing Lcom/android

UnsatisfiedLinkError: dlopen failed: cannot locate symbol “__aeabi_memcpy4” referenced by

匿名 (未验证) 提交于 2019-12-03 01:17:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I've just updated from NDK 12.x to 13.x and now I'm getting the following crash: Caused by: java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "__aeabi_memcpy4" referenced by "/data/app/com.app.myapp-1/lib/arm/libJniBitmapOperationsLibrary.so"... at java.lang.Runtime.loadLibrary(Runtime.java:372) at java.lang.System.loadLibrary(System.java:1076) at com.jni.bitmap_operations.JniBitmapHolder.<clinit>(JniBitmapHolder.java:11) <...> The library I'm using is available here . I've seen a few similar issues on SO to do with cannot

Getting “OSError: dlopen() failed to load a library: cairo / cairo-2” on Windows

匿名 (未验证) 提交于 2019-12-03 01:10:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm getting OSError: dlopen() failed to load a library: cairo / cairo-2 when trying to execute Django after a new install. Using Windows. I'm using Weasyprint, seems to be related to that one, according to the full trace: Unhandled exception in thread started by <function wrapper at 0x03F605B0> Traceback (most recent call last): File "C:\my-venv\lib\site-packages\django\utils\autoreload.py", line 226, in wrapper fn(*args, **kwargs) File "C:\my-venv\lib\site-packages\django\core\management\commands\runserver.py", line 109, in inner_run