RE: Runtime link problems on HP-UX

2006-09-20 Thread Fukuba, Yoshiki
Hi,

Symbols inside an object can be hidden by +e or -h option of HP-UX
ld command.

1. Compile your source and link them to create an object. (do not link
it with any libs at this time)

% cc -c -o source1.o source1.c
% cc -c -o source2.o source2.c
% ld -r -o main.o source1.o source2.o

2. Link main.o with OpenSSL (libcrypto.a) to create another object and
Hide all symbol of OpenSSL API. 

% ld -r -o main1.o +e 'main' main.o
/opt/openssl/lib/hpux32/libcrypto.a

Because all symbols except main() function are hidden by +e main
option,
OpenSSL API symbols inside main1.o are also hidden. 
A state of symbols inside object can be confirmed by nm command.

3. Link main1.o with other libraries such as Oracle to create an
executable.

% ld -o yourapp.exe main1.o libfoo.a libbar.so  ..

Best regards,

Yoshiki FUKUBA



From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Daniel Young
Sent: Wednesday, September 20, 2006 6:06 AM
To: openssl-users@openssl.org
Subject: Runtime link problems on HP-UX



Hi all,

 

I'm writing an XML-RPC client call under a Tuxedo app on HP-UX
11 and having run-time troubles due to an Oracle .so being picked up
instead of OpenSSL libraries.

 

My app statically links in the XML-RPC library, libcurl, libssl
and libcrypto, but at run-time it seg-faults with the following trace:

 

#0  0xc2433570:0 in BN_div+0x120 ()

   from /u01/app/oracle/OraHome_1/lib/libnnz10.so

#1  0x409f1e70:0 in BN_nnmod+0x30 ()

#2  0x409f7de0:0 in S_BN_mod_inverse+0x300 ()

#3  0x409ff2b0:0 in BN_MONT_CTX_set_locked+0x3d0 ()

#4  0x40a19740:0 in RSA_eay_public_decrypt+0x440 ()

#5  0x4088a6f0:0 in RSA_public_decrypt+0x70 ()

#6  0x4088bfd0:0 in RSA_verify+0x130 ()

#7  0x408d1380:0 in EVP_VerifyFinal+0x200 ()

#8  0x40a45bb0:0 in ASN1_item_verify+0x190 ()

#9  0x409479f0:0 in X509_verify+0x50 () #10
0x40936f90:0 in internal_verify+0xab0 ()

#11 0x409338e0:0 in X509_verify_cert+0xbd0 ()

#12 0x40838a20:0 in ssl_verify_cert_chain+0x230 ()

#13 0x40809460:0 in ssl3_connect+0x4ed0 ()

#14 0x408301a0:0 in SSL_connect+0x90 ()

#15 0x40824ab0:0 in ssl23_connect+0x1440 ()

#16 0x408301a0:0 in SSL_connect+0x90 ()

#17 0x407acbf0:0 in Curl_ossl_connect_step2
(conn=0x6070cf40,

sockindex=0, timeout_ms=0x9fffcf10) at ssluse.c:1391

 

Actually the error was originally in BN_set_word but I renamed
that, and then in BN_mod_inverse and I renamed that (to S_BN_mod_inverse
as you can see above)...  The BN_ functions are being picked up from
Oracle's libnnz10.so instead of libcrypto.a which I've statically linked
in.

 

At link time, $ORAHOME/lib is included with a -L flag, and it is
required.  I've tried changing the order of libraries on the command
line, and also tried -a,archive_shared flags on the linker to give
static libs a higher preference than shared.  I've also tried
temporarily removing $ORAHOME/lib from my SHLIB_PATH and LD_LIBRARY_PATH
environment variables.  However, nothing I do seems to get around this
problem.

 

Does anybody have an idea how I can link my app correctly to
avoid this problem?   

 

Does Oracle use openSSL internally (and hence the conflict)?
Has anybody had troubles with this before?

 

If I can't fix the linking, should I perform some preprocessor
trickery to put the OpenSSL bn.h functions in some namespace, or would
the Oracle/OpenSSL overlap be so great that this will be too hard and
encompass more than just the functions in bn.h?

 

 

Any help or hints would be much appreciated,

 

cheers,

Daniel Young
Senior Software Engineer





  

  

Level 13, 175 Eagle Street
Brisbane QLD 4000
T. +61 7 3406 1939
F. +61 7 3406 1999
www.synyati.com.au



This email message and information contained in
or attached to this message may be privileged, confidential, and
protected from disclosure and is intended only for the person or entity
to which it is addressed. Any review, retransmission, dissemination,
printing or other use of, or taking of any action in reliance upon, this
information by persons or entities other than the intended recipient is
prohibited. If you received this message in error, please immediately
inform the sender by reply e-mail and delete the message and any

Runtime link problems on HP-UX

2006-09-19 Thread Daniel Young








Hi all,



Im writing an XML-RPC client call under a Tuxedo app
on HP-UX 11 and having run-time troubles due to an Oracle .so being picked up
instead of OpenSSL libraries.



My app statically links in the XML-RPC library, libcurl, libssl
and libcrypto, but at run-time it seg-faults with the following trace:



#0
0xc2433570:0 in BN_div+0x120 ()

 from
/u01/app/oracle/OraHome_1/lib/libnnz10.so

#1
0x409f1e70:0 in BN_nnmod+0x30 ()

#2 0x409f7de0:0
in S_BN_mod_inverse+0x300 ()

#3
0x409ff2b0:0 in BN_MONT_CTX_set_locked+0x3d0 ()

#4
0x40a19740:0 in RSA_eay_public_decrypt+0x440 ()

#5
0x4088a6f0:0 in RSA_public_decrypt+0x70 ()

#6
0x4088bfd0:0 in RSA_verify+0x130 ()

#7
0x408d1380:0 in EVP_VerifyFinal+0x200 ()

#8
0x40a45bb0:0 in ASN1_item_verify+0x190 ()

#9
0x409479f0:0 in X509_verify+0x50 () #10 0x40936f90:0 in
internal_verify+0xab0 ()

#11 0x409338e0:0 in
X509_verify_cert+0xbd0 ()

#12 0x40838a20:0 in
ssl_verify_cert_chain+0x230 ()

#13 0x40809460:0 in
ssl3_connect+0x4ed0 ()

#14 0x408301a0:0 in
SSL_connect+0x90 ()

#15 0x40824ab0:0 in
ssl23_connect+0x1440 ()

#16 0x408301a0:0 in
SSL_connect+0x90 ()

#17 0x407acbf0:0 in
Curl_ossl_connect_step2 (conn=0x6070cf40,

 sockindex=0,
timeout_ms=0x9fffcf10) at ssluse.c:1391



Actually the error was originally in BN_set_word but I
renamed that, and then in BN_mod_inverse and I renamed that (to
S_BN_mod_inverse as you can see above) The BN_ functions are being
picked up from Oracles libnnz10.so instead of libcrypto.a which
Ive statically linked in.



At link time, $ORAHOME/lib is included with a L flag,
and it is required. Ive tried changing the order of libraries on
the command line, and also tried -a,archive_shared flags on the
linker to give static libs a higher preference than shared. Ive
also tried temporarily removing $ORAHOME/lib from my SHLIB_PATH and
LD_LIBRARY_PATH environment variables. However, nothing I do seems to get
around this problem.



Does anybody have an idea how I can link my app correctly to
avoid this problem? 



Does Oracle use openSSL internally (and hence the
conflict)? Has anybody had troubles with this before?



If I cant fix the linking, should I perform some
preprocessor trickery to put the OpenSSL bn.h functions in some namespace, or
would the Oracle/OpenSSL overlap be so great that this will be too hard and
encompass more than just the functions in bn.h?





Any help or hints would be much appreciated,





cheers,




 
  
  Daniel Young
  Senior Software Engineer
  
  
  
  
  
  
  
  
   




 


 


Level 13, 175 Eagle Street
BrisbaneQLD
4000
T. +61 7 3406 1939
F. +61 7 3406 1999
www.synyati.com.au

   
  
  
  
 


This email message and information contained in or attached to
this message may be privileged, confidential, and protected from disclosure and
is intended only for the person or entity to which it is addressed. Any review,
retransmission, dissemination, printing or other use of, or taking of any
action in reliance upon, this information by persons or entities other than the
intended recipient is prohibited. If you received this message in error, please
immediately inform the sender by reply e-mail and delete the message and any
attachments.