native

How to call machine code stored in char array?

允我心安 提交于 2019-12-29 10:13:09
问题 I'm trying to call native machine-language code. Here's what I have so far (it gets a bus error): char prog[] = {'\xc3'}; // x86 ret instruction int main() { typedef double (*dfunc)(); dfunc d = (dfunc)(&prog[0]); (*d)(); return 0; } It does correctly call the function and it gets to the ret instruction. But when it tries to execute the ret instruction, it has a SIGBUS error. Is it because I'm executing code on a page that is not cleared for execution or something like that? So what am I

How to call machine code stored in char array?

拈花ヽ惹草 提交于 2019-12-29 10:13:04
问题 I'm trying to call native machine-language code. Here's what I have so far (it gets a bus error): char prog[] = {'\xc3'}; // x86 ret instruction int main() { typedef double (*dfunc)(); dfunc d = (dfunc)(&prog[0]); (*d)(); return 0; } It does correctly call the function and it gets to the ret instruction. But when it tries to execute the ret instruction, it has a SIGBUS error. Is it because I'm executing code on a page that is not cleared for execution or something like that? So what am I

java-COM interop: Implement COM interface in Java

[亡魂溺海] 提交于 2019-12-29 09:39:07
问题 How can I implement a vtable COM interface in java? In the old days, I'd use the Microsft JVM, which had built in java-COM interop. What's the equivalent for a modern JRE? Answers to a similar SO question proposed JACOB. I've looked at JACOB, but that is based on IDispatch, and is aimed at controlling Automation serers. The COM interfaces I need are custom vtable (extend IUnknown), e.g. IPersistStream, IOleWindow, IContextMenu etc. For my use case, I could implement all the COM specifics in

No implementation found for native [closed]

*爱你&永不变心* 提交于 2019-12-29 08:42:55
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . I compiled my c sources with android-ndk then I put the .so file in the libs folder of my android project but when I call the native function i have a "No implementation found for native" error. If I try to call

Native crashes on abort in developer console with Oreo (8.1)

冷暖自知 提交于 2019-12-29 03:34:11
问题 In the developer console I get more and more a native crash in abort. This occurs ONLY for android 8.1 device! Is anybody aware of a regression? Here is the backtrace: #00 pc 000000000001da4c /system/lib64/libc.so (abort+112) #01 pc 0000000000007f7c /system/lib64/liblog.so (__android_log_assert+312) #02 pc 000000000006cff8 /system/lib64/libhwui.so (android::uirenderer::renderthread::EglManager::createSurface(ANativeWindow*, bool)+324) #03 pc 000000000006ad14 /system/lib64/libhwui.so (android:

How to determine whether a DLL is a managed assembly or native (prevent loading a native dll)?

末鹿安然 提交于 2019-12-28 11:51:21
问题 Original title: How can I prevent loading a native dll from a .NET app? Background: My C# application includes a plugin framework and generic plugin loader. The plugin loader enumerates the application directory in order to identify plugin dlls (essentially it searches for *.dll at this time). Within the same application directory is a native (Windows, non-.net) dll, which, indirectly, one of the plugin dlls depends upon. The plugin loader blindly assumes that the native.dll is a .NET

multiple (my and 3rd-party) native libraries in Android NDK

蹲街弑〆低调 提交于 2019-12-28 06:36:07
问题 I have to use two native libraries: one is my own and the other one is 3rd-party. As long as I used them in separate projects, everything was ok. But now I'm getting the Exception Ljava/lang/UnsatisfiedLinkError . I'm using Eclipse. I found out that if I place the existing library in libs/armeabi, Eclipse begins compilation of the native code and it fails. If I rebuild the JNI part from the command line, compilation succeeds but the 3rd party library disappears. Really stupid. So how do I

multiple (my and 3rd-party) native libraries in Android NDK

冷暖自知 提交于 2019-12-28 06:36:04
问题 I have to use two native libraries: one is my own and the other one is 3rd-party. As long as I used them in separate projects, everything was ok. But now I'm getting the Exception Ljava/lang/UnsatisfiedLinkError . I'm using Eclipse. I found out that if I place the existing library in libs/armeabi, Eclipse begins compilation of the native code and it fails. If I rebuild the JNI part from the command line, compilation succeeds but the 3rd party library disappears. Really stupid. So how do I

Java OutOfMemoryError 的原因是什么,什么是Java native方法

雨燕双飞 提交于 2019-12-26 20:39:24
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 一、Java OutOfMemoryError 的原因是什么,什么是Java native方法? 转载的博文 容易发生内存溢出问题的内存空间包括:Permanent Generation space和Heap space。 常见的几种错误: 1.1 OutOfMemoryError PerGen space 发生这种问题的原意是程序中使用了大量的jar或class,使java虚拟机装载类的空间不够,与Permanent Generation space有关。 解决方法:增加java虚拟机中的XX:PermSize和XX:MaxPermSize参数的大小,其中XX:PermSize是初始永久保存区域大小,XX:MaxPermSize是最大永久保存区域大小。如针对tomcat6.0,在catalina.sh 或catalina.bat文件中一系列环境变量名说明结束处(大约在70行左右) 增加一行: JAVA_OPTS=" -XX:PermSize=64M -XX:MaxPermSize=128m" 1.2 OutOfMemoryError Java Heap space 发生这种问题的原因是java虚拟机创建的对象太多,在进行垃圾回收之间,虚拟机分配的到堆内存空间已经用满了,与Heap space有关。

Azure App Service, run a native EXE to convert a file

醉酒当歌 提交于 2019-12-25 09:39:11
问题 I have a native EXE that converts a file based on command line arguments. Provided, I know how to give full path names of the input and output files, can I run such an EXE from my app service when some button is pressed and wait till the output file is created? Converting to DLL is not an option. 回答1: As far as I know, we could run a native exe in the azure app service. But we couldn't directly pass the parameter to the native exe. You need write a web application or something else for the