shared-libraries

Python Shared Libraries: RTLD_GLOBAL segfault

心已入冬 提交于 2019-12-30 11:56:25
问题 I work with a python swig-wrapped C++ library. In it's __init__.py file, it sets the dlopen flag RTLD_GLOBAL before importing the shared object file containing the implementation code. This causes the subsequent import of scipy.linalg to segfault, at least on my machine. I think this behavior depends on the way in which scipy was built and what it's linked against though. # minimal example of what's going on $ cat test.py import sys import ctypes flags = sys.getdlopenflags() sys

Python Shared Libraries: RTLD_GLOBAL segfault

[亡魂溺海] 提交于 2019-12-30 11:56:13
问题 I work with a python swig-wrapped C++ library. In it's __init__.py file, it sets the dlopen flag RTLD_GLOBAL before importing the shared object file containing the implementation code. This causes the subsequent import of scipy.linalg to segfault, at least on my machine. I think this behavior depends on the way in which scipy was built and what it's linked against though. # minimal example of what's going on $ cat test.py import sys import ctypes flags = sys.getdlopenflags() sys

weird - mysql's sql::SQLException is not caught by its type, but is caught as std::exception and cast back successfully

℡╲_俬逩灬. 提交于 2019-12-30 11:51:34
问题 I am using mysql c++ connector with this (a bit simplified) code. try { statement->setString(1, word); statement->executeUpdate(); } catch( sql::SQLException& e ) { // I don't get here return sqlerrno_to_error_code( e.getErrorCode() ); } catch( std::exception& e ) { // I do get here and the cast works sql::SQLException& sqle = (sql::SQLException&) e; return sqlerrno_to_error_code( sqle.getErrorCode() ); } The connector is supposed to throw the sql::SQLException which derives from std:

Launching CYGWIN-built executable from Java on Windows 7 fails with “error while loading shared libraries: ?: No such file or directory”

懵懂的女人 提交于 2019-12-30 11:24:28
问题 The code in question has worked in more or less the exact same configuration on earlier releases of Windows, however, it is not known to have run on Windows 7 YET! That's what I need to solve now. Briefly, some C code performs some configuration and security checks before launching a java program, passing some data that would be neigh-into-impossible to do easily in Java. The Java in turn, at the appropriate time launches the same C code which then itself launches a different Java program.

Launching CYGWIN-built executable from Java on Windows 7 fails with “error while loading shared libraries: ?: No such file or directory”

回眸只為那壹抹淺笑 提交于 2019-12-30 11:24:03
问题 The code in question has worked in more or less the exact same configuration on earlier releases of Windows, however, it is not known to have run on Windows 7 YET! That's what I need to solve now. Briefly, some C code performs some configuration and security checks before launching a java program, passing some data that would be neigh-into-impossible to do easily in Java. The Java in turn, at the appropriate time launches the same C code which then itself launches a different Java program.

CMake: Run-time error (dyld: Library not loaded) for dynamically linked resources on MacOS

拜拜、爱过 提交于 2019-12-30 10:04:44
问题 Problem On MacOS, I get linking problems at runtime for a CMake project that depends on dynamically linked resources – but only after installing the project! The problem does not occur when I only build the binary without installing it. $ ./testapp Hello world! $ $INSTALLDIR/testapp dyld: Library not loaded: @rpath/libvtkDomainsChemistryOpenGL2-7.1.1.dylib Referenced from: /Users/normanius/workspace/installdir/testapp Reason: image not found [1] 76964 trace trap /Users/normanius/workspace

Can you compile a shared object to prefer local symbols even if it's being loaded by a program compiled with -rdynamic?

妖精的绣舞 提交于 2019-12-30 09:00:08
问题 I am building a shared library in C that is dynamically loaded by a program that I do not have source access to. The target platform is a 64-bit Linux platform and we're using gcc to build. I was able to build a reproduction of the issue in ~100 lines, but it's still a bit to read. Hopefully it's illustrative. The core issue is I have two non-static functions ( bar and baz ) defined in my shared library. Both need to be non-static as we expect the caller to be able to dlsym them. Additionally

How can I use Linux shared libraries in Java?

空扰寡人 提交于 2019-12-30 05:01:05
问题 Is there any way to call the functions which are in a so library from my Java code? Generally, is it possible to use Linux so libraries in Java programs? 回答1: The answer is "JNI" :) Here are a couple of links: How to compile dynamic library for a JNI application on linux? http://learn-from-the-guru.blogspot.com/2007/12/java-native-interface-jni-tutorial-hell.html http://docs.oracle.com/javase/6/docs/technotes/guides/jni/ 回答2: Another wayto access libraries form java besides JNI is JNA. I find

Executable shared libraries

霸气de小男生 提交于 2019-12-30 04:58:27
问题 Most of the time, when you compile a shared library, executing it is meaningless and doing so produces nothing useful: $ ./libfoobarbaz.so Segmentation fault However, the folks at GNU have been able to stick in some output when glibc is executed: $ /lib/libc.so.6 GNU C Library (Debian EGLIBC 2.11.2-10) stable release version 2.11.2, by Roland McGrath et al. Copyright (C) 2009 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not

LLVM out of source pass build: Loadable modules not supported (on Linux)

倾然丶 夕夏残阳落幕 提交于 2019-12-30 04:43:19
问题 I compiled and installed LLVM from trunk on debian wheezy some weeks ago (configure & make) and now tried to out of source compile the llvm-mutate pass. AFAICC, llvm-mutate follows the cmake out of source pass build instructions. When trying to build llvm-mutate mkdir build cd build cmake -DCMAKE_MODULE_PATH=/usr/local/share/llvm/cmake ../ I get: -- Mutate ignored -- Loadable modules not supported on this platform. hmm? opt and the loadable passes (at llvm_trunk/build/Debug+Asserts/lib/xxx.so