test program(dlopen) fails on hp but run well on solaris


 
Thread Tools Search this Thread
Operating Systems HP-UX test program(dlopen) fails on hp but run well on solaris
# 1  
Old 03-17-2006
test program(dlopen) fails on hp but run well on solaris

Hi,

I have a c test program which test dlopen call. This program run well on solaris but fails on hp-ux.

Quote:
$ cat testjvm.c

#include <stdio.h>
#include <errno.h>
#include <dlfcn.h>
void main(void)
{
void *handle;
handle = dlopen("libjvm.sl", RTLD_LAZY);
if( handle == NULL )
{
printf("errno[%d], errmsg[%s]\n", errno, dlerror());
return;
}
else
{
printf("\nJVM loaded successfully");
}
dlclose(handle);
}
$

The program load jvm library successfully on solaris. On hp-ux it displays error

Quote:
$ testjvm
errno[0], errmsg[Can't open shared library: libjvm.sl]
$
$ echo $SHLIB_PATH
/opt/weblogic810sp3/jdk142_03/jre/lib/PA_RISC/server
$
I compile this program as
$cc -o testjvm testjvm.c


What am I missing? I have tried with different java version. but of no help.
any pointers?

Thanks in advance,
-Ashish
# 2  
Old 03-17-2006
What does
chatr testjvm
display?
Can you find all the libs referred to by your binary
at the given paths?
Are they readable by your uid?
# 3  
Old 03-20-2006
Hi buffoonix,

thanks for ur reply.
chatr to binary displays o/p as follows.


Quote:
$ chatr testjvm
testjvm:
shared executable
shared library dynamic path search:
SHLIB_PATH disabled second
embedded path disabled first Not Defined
shared library list:
dynamic /usr/lib/libc.2
shared library binding:
deferred
global hash table disabled
plabel caching disabled
global hash array size:1103
global hash array nbuckets:3
shared vtable support disabled
static branch prediction disabled
executable from stack: D (default)
kernel assisted branch prediction enabled
lazy swap allocation disabled
text segment locking disabled
data segment locking disabled
third quadrant private data space disabled
fourth quadrant private data space disabled
data page size: D (default)
instruction page size: D (default)
$

and the libs are readble by my uid.

Quote:
$ ldd testjvm
/usr/lib/libc.2 => /usr/lib/libc.2
/usr/lib/libdld.2 => /usr/lib/libdld.2
/usr/lib/libc.2 => /usr/lib/libc.2
$ ls -l /usr/lib/libc.2 /usr/lib/libdld.2 /usr/lib/libc.2
-r-xr-xr-x 1 bin bin 1814528 Jul 14 2004 /usr/lib/libc.2
-r-xr-xr-x 1 bin bin 1814528 Jul 14 2004 /usr/lib/libc.2
-r-xr-xr-x 1 bin bin 24576 Nov 14 2000 /usr/lib/libdld.2
$
any pointers??

-Ashish
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Bash script fails when run as file

The following bash script fails with error message: "./phpquery_KNBB_html_reader.sh: line 65: syntax error near unexpected token `done'" when do ./<scriptname> in the shell. However when I copy-paste the entire contents of the file directly into a shell environment it runs ok returning the intended... (2 Replies)
Discussion started by: BurritoSolution
2 Replies

2. Shell Programming and Scripting

Script fails to run properly when run from CRONTAB

Hello all, I'm trying to write a script to gather and send data and it works just fine at the bash command line, but when executing from CRON, it does not run properly. My scripting skills are pretty limited and there's probably a better way, but as I said it works at the command line, but... (12 Replies)
Discussion started by: rusman
12 Replies

3. Shell Programming and Scripting

Script fails with ORA-20000 when run with su

Hi, I have a ksh script that runs as root ans issues several commands as a user differente from root as 'su <user> -c "command" ' . It works fine except for one step where the command executes sql statements. That command fails with ORA-20000. Now the strangest thing, if I place a read command... (5 Replies)
Discussion started by: naf
5 Replies

4. Solaris

Solaris: clnt_create fails on solaris x86

Hi, I am facing an issue with Solaris x86 machine Machine Details: uname -a SunOS sol10-64 5.10 Generic_137138-09 i86pc i386 i86pc .............................. Description: I am trying to register a programm with proramm ID 300760 with version number 1, and tryint to create a... (0 Replies)
Discussion started by: DivakarAdari
0 Replies

5. Programming

Linux: dlopen fails to find symbols

I've attached a tar.gz containing three tests to demonstrate the problem I'm having. Within the tar are two shared libraries, two test applications, and a Makefile that builds the three tests. The shared libaries are libshlib1.so and libshlib2.so. Both export a function, libFunc, which takes... (5 Replies)
Discussion started by: DreamWarrior
5 Replies

6. Shell Programming and Scripting

crontab fails to run script

OS is Ubuntu 8.04.3. When I run the command: /usr/bin/syslogMailer < /etc/syslog.pipes/criticalMessagesFrom a bash shell it works and i receive an email as per the script however when run from crontab it does not work. Can anyone explain why and how to fix it? /usr/bin/syslogMailer... (4 Replies)
Discussion started by: jelloir
4 Replies

7. Solaris

hardware test fails

Hi, I have a SunFire 280R abd when I boot it there is a hardware check running and it fails. Here is a long output of the test rsc> poweron Are you sure you want to turn your system power on (Yes/No)? yes rsc> console RSC Alert: Host System has Reset @(#)OBP 4.5.10 2002/02/11 10:39... (2 Replies)
Discussion started by: Tex-Twil
2 Replies

8. Solaris

How to run the w120p.rex program in Solaris

Hi, I'm new to Solaris, i want to run one .rex program from solaris. My program w120p.rex which is working fine in windows. I want to run the same from the Solaris. I dont know how to do in Solaris. Can any one help me in this? Thanks in advance.... (1 Reply)
Discussion started by: vij_krr
1 Replies

9. UNIX for Advanced & Expert Users

make test fails for DBD::Oracle installation

I've already installed the DBI Perl Module with no issues and now I'm attempting to install the DBD::Oracle driver on a Red Hat Enterprise 4 server and am having some trouble. I've checked through the forums and haven't seen anything helpful at this point. Everything goes fine during the perl... (1 Reply)
Discussion started by: pstrosnyder
1 Replies

10. Programming

Compile and Run C Program on Solaris

Hello Guys, I am using Solaris Developer Express Edition 9/07, I am a beginner. Please tell me how to compile and execute a C program. Please give me your answers clearly, for the compilers cc,c89,c99. I not getting the answer anywhere. Please....... reply to me. Advance thanks......... (0 Replies)
Discussion started by: selva_ss
0 Replies
Login or Register to Ask a Question