- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: exec format error while running JVM using C sl
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
Forums
Discussions
Discussions
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
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
11-17-2004 02:55 AM
11-17-2004 02:55 AM
exec format error while running JVM using C sl
I am new to HP-UX programming, so your patience is greatly appreciated if I there is a trivial issue here.
I am compiling a simple C shared library for HP-UX 11i that initializes the JVM using JNI_CreateJVM and destroys it after using DestroyJavaVM.
I have set the SHLIB_PATH, LD_LIBRARY_PATH env. variables to point to /opt/java1.4/jre/lib/PA_RISC2.0 and /opt/java1.4/jre/lib/PA_RISC2.0/server.
However, I receive a "exec format error" message when I make a JNI call in my shared library.
I am using a 64-bit HP-UX I compiled my program using the following statements (please correct me if I am wrong):
cc +z -c -I.. -I. -I/opt/java1.4/include -I/opt/java1.4/include/hp-ux -Ae +DAporta
ble +ESsfc +ESlit -DHP11 +u1 invokejvm.c
ld -s -b -L/opt/java1.4/jre/lib/PA_RISC2.0 -L/opt/java1.4/jre/lib/PA_RISC2.0/server -ljava -o libinvokejvm.sl invokejvm.o
The library compiles and links with no errors or warnings.
Has someone encountered this issue before? If yes, please let me know any steps you have taken to evade this error. Thanks.
model : 9000/800/L3000-7x (server)
CPU : (2) PA8600 750 MHz (PA-RISC 2.0)
RAM : 4 GB
OS : HP-UX B.11.11 (64-bit)
JVM : Java 1.4.1.03 (/opt/java1.4/bin/java)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2004 03:17 AM
11-17-2004 03:17 AM
Re: exec format error while running JVM using C sl
What is the compiler you have
Maybe problem with using both cfront and aCC libs
Steve Steel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-18-2004 08:57 AM
11-18-2004 08:57 AM
Re: exec format error while running JVM using C sl
I have managed to run a few tools on the shared library that I have generated. Here is some output that may help in determining the problem:
> odump -sllibload libueEditSharedData.sl
Shared Library Load List for libueEditStatusData.sl:
Order Name
0 libueEditStatusData.sl
1 ^ /opt/java1.4/jre/lib/PA_RISC2.0/server/libjvm.sl
2 ^ ^ /usr/lib/libpthread.1
3 ^ ^ /usr/lib/libdld.2
4 ^ ^ /usr/lib/libm.2
5 ^ ^ /usr/lib/librt.2
6 ^ ^ /usr/lib/libcl.2
7 ^ ^ ^ /usr/lib/libdld.2
8 ^ ^ ^ /usr/lib/libisamstub.1
9 ^ ^ /usr/lib/libCsup.2
10 ^ /opt/java1.4/jre/lib/PA_RISC2.0/libjava.sl
11 ^ ^ /opt/java1.4/jre/lib/PA_RISC2.0/server/libjvm.sl
12 ^ ^ ^ /usr/lib/libpthread.1
13 ^ ^ ^ /usr/lib/libdld.2
14 ^ ^ ^ /usr/lib/libm.2
15 ^ ^ ^ /usr/lib/librt.2
16 ^ ^ ^ /usr/lib/libcl.2
17 ^ ^ ^ ^ /usr/lib/libdld.2
18 ^ ^ ^ ^ /usr/lib/libisamstub.1
19 ^ ^ ^ /usr/lib/libCsup.2
20 ^ ^ /opt/java1.4/jre/lib/PA_RISC2.0/libverify.sl
21 ^ ^ ^ /opt/java1.4/jre/lib/PA_RISC2.0/server/libjvm.sl
22 ^ ^ ^ ^ /usr/lib/libpthread.1
23 ^ ^ ^ ^ /usr/lib/libdld.2
24 ^ ^ ^ ^ /usr/lib/libm.2
25 ^ ^ ^ ^ /usr/lib/librt.2
26 ^ ^ ^ ^ /usr/lib/libcl.2
27 ^ ^ ^ ^ ^ /usr/lib/libdld.2
28 ^ ^ ^ ^ ^ /usr/lib/libisamstub.1
29 ^ ^ ^ ^ /usr/lib/libCsup.2
30 ^ ^ ^ /usr/lib/libc.2
31 ^ ^ ^ ^ /usr/lib/libdld.2
32 ^ ^ /usr/lib/libdld.2
33 ^ ^ /usr/lib/libc.2
34 ^ ^ ^ /usr/lib/libdld.2
> ldd libueEditStatusData.sl
/opt/java1.4/jre/lib/PA_RISC2.0/libjava.sl => /opt/java1.4/jre/lib/PA_
RISC2.0/libjava.sl
/usr/lib/libc.2 => /usr/lib/libc.2
/usr/lib/libdld.2 => /usr/lib/libdld.2
/usr/lib/libc.2 => /usr/lib/libc.2
/usr/lib/libdld.2 => /usr/lib/libdld.2
../../../build/HP_UX/lib/PA_RISC2.0/libverify.sl => /opt/java1.4/jre
/lib/PA_RISC2.0/libverify.sl
/usr/lib/libc.2 => /usr/lib/libc.2
/CLO/Components/JAVA_12/Src/build/HP_UX/lib/PA_RISC2.0/server/libjvm.sl
=> /opt/java1.4/jre/lib/PA_RISC2.0/server/libjvm.sl
/usr/lib/libCsup.2 => /usr/lib/libCsup.2
/usr/lib/libcl.2 => /usr/lib/libcl.2
/usr/lib/libisamstub.1 => /usr/lib/libisamstub.1
/usr/lib/libdld.2 => /usr/lib/libdld.2
/usr/lib/librt.2 => /usr/lib/librt.2
/usr/lib/libm.2 => /usr/lib/libm.2
/usr/lib/libdld.2 => /usr/lib/libdld.2
/usr/lib/libpthread.1 => /usr/lib/libpthread.1
/CLO/Components/JAVA_12/Src/build/HP_UX/lib/PA_RISC2.0/server/libjvm.sl
=> /opt/java1.4/jre/lib/PA_RISC2.0/server/libjvm.sl
/opt/java1.4/jre/lib/PA_RISC2.0/server/libjvm.sl => /opt/java1.4/jre
/lib/PA_RISC2.0/server/libjvm.sl
> fastbind
fastbind: Exec format error
fastbind: End of file encountered during read.
FYI, I am using the standard HP-UX 11i compiler (cc or cc_bundled) that comes with the default installation.
Does anyone know if patch PHSS_30968 might aid in resolving this issue?
Thank you for your help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-18-2004 10:30 AM
11-18-2004 10:30 AM
Re: exec format error while running JVM using C sl
To perform fastbind during compile you can option +fb to linker (ld) or -Wl,+fb to compiler (cc).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-18-2004 10:33 AM
11-18-2004 10:33 AM
Re: exec format error while running JVM using C sl
The command I ran is: fastbind libueEditStatusData.sl
I have also noticed that whenever I run fastbind on a shared lib, it returns the exec format error. I am thinking that I am incorrectly using fastbind.
Can anyone tell me how to do a static linkage to the libraries listed in the odump ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-18-2004 05:08 PM
11-18-2004 05:08 PM
Re: exec format error while running JVM using C sl
Back to your original problem with 'exec format error' when making JNI call in your shared library. Does it also come up with error message saying that "can't shl_load() a library containing Thread Local Storage" etc?
To overcome this problem you can define environment variable LD_PRELOAD and set it to full path to the library dld.sl is complaining about.
$ LD_PRELOAD=/opt/java1.4/jre/lib/PA_RISC2.0/server/libjvm.sl
Your dynamic loader must be up to date to support LD_PRELOAD. Check man page for dld.sl , if there are references to LD_PRELOAD all the chances are it will work.