- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- received SIGSEGV while executing an exe
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-09-2011 04:11 AM
тАО05-09-2011 04:11 AM
received SIGSEGV while executing an exe
There, I have created an executable file by compiling it with gcc 4.4.3.
When I am running that binary file error is coming :Segmentation fault (core dumped)
# file core
ELF-32 core file - IA64 from 'iEngine' - received SIGSEGV
Also please let me know how to create 64 bit executable on the same machine using gcc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-09-2011 11:11 AM
тАО05-09-2011 11:11 AM
Re: received SIGSEGV while executing an exe
Use -mlp64 for 64 bit.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-10-2011 02:13 AM
тАО05-10-2011 02:13 AM
Re: received SIGSEGV while executing an exe
Program received signal SIGSEGV, Segmentation fault
si_code: 2 - SEGV_ACCERR - Invalid Permissions for object.
0x9fffffffed949cd0:0 in ENTER_PTHREAD_LIBRARY_FUNC+0x50 ()
from /usr/lib/hpux64/libpthread.so.1
(gdb) where
#0 0x9fffffffed949cd0:0 in ENTER_PTHREAD_LIBRARY_FUNC+0x50 ()
from /usr/lib/hpux64/libpthread.so.1
#1 0x9fffffffed98e920:0 in pthread_num_processors_np+0xa0 ()
from /usr/lib/hpux64/libpthread.so.1
#2 0x9fffffffee9367e0:0 in os::active_processor_count ()
at /CLO/Components/JAVA_HOTSPOT/Src/src/os/hp-ux/vm/os_hp-ux.cpp:842
#3 0x9fffffffeec1b3f0:0 in os::is_server_class_machine ()
at /CLO/Components/JAVA_HOTSPOT/Src/src/share/vm/runtime/os.cpp:845
#4 0x9fffffffeec1ad60:0 in Arguments::set_ergonomics_flags ()
at /CLO/Components/JAVA_HOTSPOT/Src/src/share/vm/runtime/arguments.cpp:1239
#5 0x9fffffffeec0db60:0 in Arguments::parse ()
at /CLO/Components/JAVA_HOTSPOT/Src/src/share/vm/runtime/arguments.cpp:2673
#6 0x9fffffffeec06cc0:0 in Threads::create_vm ()
at /CLO/Components/JAVA_HOTSPOT/Src/src/share/vm/runtime/thread.cpp:3451
#7 0x9fffffffeec048b0:0 in JNI_CreateJavaVM ()
at /CLO/Components/JAVA_HOTSPOT/Src/src/share/vm/prims/jni.cpp:2674
#8 0x4000000000004340:0 in JNI_main (argc=1, argv=0x9ffffffffffff5c0)
at eInvokeJVM.c:493
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-10-2011 11:49 PM
тАО05-10-2011 11:49 PM
Re: received SIGSEGV while executing an exe
I am working on HP_UX Itanium processor
Sample Code is
#include
#include
#include
/* This is the program's "main" routine. */
int main (int argc, char *argv[]) {
JavaVM *jvm; /* denotes a Java VM */
JNIEnv *env; /* pointer to native method interface */
JavaVMInitArgs vm_args;
JavaVMOption options[1];
jint res;
jclass cls;
jmethodID mid;
/* IMPORTANT: need to specify vm_args version especially if you are not using JDK1.1.
* Otherwise, will the compiler will revert to using the 'JDK1_1InitArgs' struct.
*/
vm_args.version = JNI_VERSION_1_4;
/* This option doesn't do anything, just to illustrate how to pass args to JVM. */
options[0].optionString = "-verbose:none";
vm_args.nOptions = 1;
vm_args.options = options;
vm_args.ignoreUnrecognized = JNI_FALSE;
/* load and initialize a Java VM, return a JNI interface pointer in env */
res = JNI_CreateJavaVM(&jvm,(void**)&env,&vm_args);
if (res < 0) {
fprintf(stderr, "Can't create Java VM\n");
exit(1);
}
jclass ver;
jmethodID print;
ver = (*env)->FindClass(env, "sun/misc/Version");
if (ver == 0) {
fprintf(stderr, "Can't find Version");
}
print = (*env)->GetStaticMethodID(env, ver, "print", "()V");
(*env)->CallStaticVoidMethod(env, ver, print);
/* invoke the Main.test method using the JNI */
cls = (*env)->FindClass(env, "Main");
if (cls == 0) {
fprintf(stderr, "Can't find Main.class\n");
exit(1);
}
mid = (*env)->GetStaticMethodID(env, cls, "test", "(I)V");
if (mid==0) {
fprintf(stderr, "No such method!\n");
exit(1);
}
// otherwise execute this method
(*env)->CallStaticVoidMethod(env, cls, mid,100);
/* We are done. */
(*jvm)->DestroyJavaVM(jvm);
return 0;
}
---------------------------------------------------------------------------------------------------------------------------------------------------
It is successfully compiling & generating an exe
To generate exe following script is used
JAVA_HOME=/opt/java6
LIB_PATH=$JAVA_HOME/jre/lib/IA64W
INCLUDE_PATH=$JAVA_HOME/include
$JAVA_HOME/bin/javac Main.java
#Compile the invoker .c file
~/gcc -g -mlp64 -I$INCLUDE_PATH -I$INCLUDE_PATH/hp-ux -L$LIB_PATH -L$LIB_PATH/server -ljava -ljvm -lverify testJNI.c -o testJNI
---------------------------------------------------------------------------------------------------------------------------------------------------
public class Main
{
public static void main(String[] args)
{
System.out.println("Argument: " + args[0]);
}
public static void test(int arg)
{
System.out.println("Test Argument: " + arg);
}
}
---------------------------------------------------------------------------------------------------------------------------------------------------
export JAVA_HOME=/opt/java6
export LIB_PATH=$JAVA_HOME/jre/lib/IA64W
export LD_LIBRARY_PATH=$LIB_PATH:$LIB_PATH/server
./testJNI
---------------------------------------------------------------------------------------------------------------------------------------------------
following is the debugger output
Program received signal SIGSEGV, Segmentation fault
si_code: 2 - SEGV_ACCERR - Invalid Permissions for object.
0x9fffffffed949cd0:0 in ENTER_PTHREAD_LIBRARY_FUNC+0x50 ()
from /usr/lib/hpux64/libpthread.so.1
(gdb) where
#0 0x9fffffffed949cd0:0 in ENTER_PTHREAD_LIBRARY_FUNC+0x50 ()
from /usr/lib/hpux64/libpthread.so.1
#1 0x9fffffffed98e920:0 in pthread_num_processors_np+0xa0 ()
from /usr/lib/hpux64/libpthread.so.1
#2 0x9fffffffee9367e0:0 in os::active_processor_count ()
at /CLO/Components/JAVA_HOTSPOT/Src/src/os/hp-ux/vm/os_hp-ux.cpp:842
#3 0x9fffffffeec1b3f0:0 in os::is_server_class_machine ()
at /CLO/Components/JAVA_HOTSPOT/Src/src/share/vm/runtime/os.cpp:845
#4 0x9fffffffeec1ad60:0 in Arguments::set_ergonomics_flags ()
at /CLO/Components/JAVA_HOTSPOT/Src/src/share/vm/runtime/arguments.cpp:1239
#5 0x9fffffffeec0db60:0 in Arguments::parse ()
at /CLO/Components/JAVA_HOTSPOT/Src/src/share/vm/runtime/arguments.cpp:2673
#6 0x9fffffffeec06cc0:0 in Threads::create_vm ()
at /CLO/Components/JAVA_HOTSPOT/Src/src/share/vm/runtime/thread.cpp:3451
#7 0x9fffffffeec048b0:0 in JNI_CreateJavaVM ()
at /CLO/Components/JAVA_HOTSPOT/Src/src/share/vm/prims/jni.cpp:2674
#8 0x4000000000000f90:0 in main (argc=1, argv=0x9ffffffffffff660)
at testJNI.c:29
(gdb) list
11 JavaVMOption options[1];
12
13 jint res;
14 jclass cls;
15 jmethodID mid;
16
17 /* IMPORTANT: need to specify vm_args version especially if you are not using JDK1.1.
18 * Otherwise, will the compiler will revert to using the 'JDK1_1InitArgs' struct.
19 */
20 vm_args.version = JNI_VERSION_1_4;
---------------------------------------------------------------------------------------------------------------------------------------------------
Can u pleas help me out in finding the solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-11-2011 05:57 AM
тАО05-11-2011 05:57 AM
Re: received SIGSEGV while executing an exe
libjava.so => /opt/java1.5/jre/lib/IA64W/libjava.so
libjvm.so => /opt/java1.5/jre/lib/IA64W/hotspot/libjvm.so
libverify.so => /opt/java1.5/jre/lib/IA64W/libverify.so
libunwind.so.1 => /lib/hpux64/libunwind.so.1
libc.so.1 => /lib/hpux64/libc.so.1
libverify.so => /opt/java1.5/jre/lib/IA64W/./libverify.so
libdl.so.1 => /usr/lib/hpux64/libdl.so.1
libc.so.1 => /usr/lib/hpux64/libc.so.1
libpthread.so.1 => /usr/lib/hpux64/libpthread.so.1
libdl.so.1 => /usr/lib/hpux64/libdl.so.1
libm.so.1 => /usr/lib/hpux64/libm.so.1
librt.so.1 => /usr/lib/hpux64/librt.so.1
libuca.so.1 => /usr/lib/hpux64/libuca.so.1
libunwind.so.1 => /usr/lib/hpux64/libunwind.so.1
libstd_v2.so.1 => /usr/lib/hpux64/libstd_v2.so.1
libcl.so.1 => /usr/lib/hpux64/libcl.so.1
libCsup.so.1 => /usr/lib/hpux64/libCsup.so.1
libuca.so.1 => /usr/lib/hpux64/libuca.so.1
libdl.so.1 => /usr/lib/hpux64/libdl.so.1
libIO77.so.1 => /usr/lib/hpux64/libIO77.so.1
libunwind.so.1 => /usr/lib/hpux64/libunwind.so.1