Databases
cancel
Showing results for 
Search instead for 
Did you mean: 

Bad magic number for shared library

Arlindo Ferreira_1
Occasional Contributor

Bad magic number for shared library

HI,
We have finished the installation Oracle 8.1.7 -64bit on HP-UX 11.00 -64bit an upgraded SAP to 4.6C SR2. Now when we start oracle/sap with command "startsap" or "stopsap" we get an error message:
/usr/lib/dld.sl: bad magic number for shared library: /oracle//817_64/lib64/libclntsh.sl.8.0
/usr/lib/dls.sl: Exec format error
/usr/sap//SYS/exe/run/stopdb[229]: 7056 Abort(coredump)

All our kernel SAP are in 64bit
What is the problem? environment variables?
SHLIB_PATH is set to /oracle//817_64/lib64:/usr/sap//SYS/exe/run

Best regards,
Arlindo Ferreira.
9 REPLIES
Steven Gillard_2
Honored Contributor

Re: Bad magic number for shared library

Is it possible that you're using a 32bit version of SAP? It kind of looks like a 32bit app is trying to load a 64bit library. Does it work if you remove /oracle//817_64/lib64 from your SHLIB_PATH variable? What about if you replace it with /oracle//817_64/lib?

Regards,
Steve
Ceesjan van Hattum
Esteemed Contributor

Re: Bad magic number for shared library

this error occurs when trying to use 64-bit client libraries on HP11.
To verify if the Oracle installation is 64-bit or 32-bit, use the following command at the unix prompt:

chatr $ORACLE_HOME/lib/libclntsh.sl

If the output from this command shows a 64-bit ELF shared library, the user will need to get a 32-bit Oracle client installed on the machine used.

Regards, Ceesjan
pap
Respected Contributor

Re: Bad magic number for shared library

HI,
I think there is a problem related to Kernel parameters setting.

Please post output from "kmtune" command.



"Winners don't do different things , they do things differently"
Arlindo Ferreira_1
Occasional Contributor

Re: Bad magic number for shared library

kmtune command output
in attachment file.
Krishna Prasad
Trusted Contributor

Re: Bad magic number for shared library

We are on the same OS and SAP verision that you are on. We are on Oracle 8.1.7.2

Make sure you have the following libc patches on your machine.

PHCO_23092 libc cuml. header patch
PHCO_23770 libc cuml. patch.

You may have to re-link Oracle after the install of the patches.

Positive Results requires Positive Thinking
pap
Respected Contributor

Re: Bad magic number for shared library

Hi Arlino,
It looks like kernel parameters are alright.

Please consider following points that will help you in resolving your problem.

1. SHLIB_PATH should include both $ORACLE_HOME/lib and $ORACLE_HOME/lib64

I belive there still is some 32 bit software within the Oracle package.


2.
Not sure if this will help you or not,

From the HP Doc KBRC00000398
"bad magic number" and "exec" errors from dld.sl

/Begin/
Possible causes and the fixes are:


If libc is older than dld.sl or vice versa, then the two libraries will have difficulties understanding each other. Update both by installing the latest libc and dld.sl patches.

If the error was encountered while attempting to run a COBOL program, then it is possible that the executable was created on a PA1.1 machine using a shared library that was created on a PA2.0 machine. The linker did not give the typical warning that a PA2.0 object was detected. Instead, the only error returned occurred at runtime, when dld.sl attempted to bind the shared libraries. The only solutions are to:

compile and run the program on the same machine.
install the latest dld.sl and libc patches on both machines and recompile.

If /lib is not linked to /usr/lib, then the shared libraries will not have a reference point.
ln -s /usr/lib /lib


Hope this helps.

Thanks,

-pap
"Winners don't do different things , they do things differently"
Al Fournier
Advisor

Re: Bad magic number for shared library

Please search the SAP OSS database for the answer to this problem. As I recall you have edit the start-up shell files .cs for both users adm and ora. in their respective home directories.

Al Fournier
Advisor

Re: Bad magic number for shared library

IMPORTANT: HPUX_64 only. Before continuing with the database load portion of R3SETUP you must edit 4 files to remove reference to the SHLIB_PATH. Comment out the lines within the case statement for HP in the .dbenv_.sh, and the .dbenv_.csh files for both users adm (in directory /home/adm) and ora (in directory /oracle//). It was simple to edit these files by opening them in Xwindows --- select the file in the GUI, rightmouse click and select open. Before editing the files check note 313110. SAP had a note that displayed the eact context but they have removed that note from the database. This will fix your problem.
Al Fournier
Advisor

Re: Bad magic number for shared library

an example of the change made to the .dbenv_.csh file follows (It is only the section that needs to be remoraked out):
case HP*:
# if ( ! $?SHLIB_PATH ) then
# setenv SHLIB_PATH $ORACLE_HOME/lib64
# else
# foreach d ( $ORACLE_HOME/lib64 )
# set i=0
# foreach p ( `echo $SHLIB_PATH | sed 's/:/ /g'` )
# if ( "$p" == "$d" ) then
# set i=1
# break
# endif
# end
# if ( $i == 0 ) then
# setenv SHLIB_PATH ${SHLIB_PATH}:$d
# endif
# end
# endif
breaksw


All the lines are commented out except the case statement and the breaksw.