The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM


UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Bad magic number on /dev/md0 ravinandan UNIX for Advanced & Expert Users 0 08-17-2007 04:56 AM
LVM magic number 0x4D48 ghimanshu Filesystems, Disks and Memory 2 07-18-2007 05:27 AM
Bad Magic Number wesweshahaha Filesystems, Disks and Memory 0 05-18-2006 10:28 AM
Bad magic number batosai SUN Solaris 1 04-22-2006 08:29 AM
shell magic number with a - vino Shell Programming and Scripting 3 07-08-2005 08:23 PM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-05-2005
Registered User
 

Join Date: Dec 2004
Location: Zürich
Posts: 146
bad magic number

Hi,

when installing a piece of third part software I get the error "Bad magic number" at one point when it tries to use libraries from the bea tuxedo server. Am I correct that this means that the software is expecting 32bit while I'm on 64bit? Is there a way around it or can it only be solved during compilation time?

Thanks.
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 01-05-2005
google's Avatar
Moderator
 

Join Date: Jul 2002
Location: Atlanta
Posts: 740
Which OS and shell are you using? Also, in the install script that throws the error, what is the path of the very first line in the script. It should be something like #!/bin/ksh (if its a korn shell script). Compare this setting with the output of which ksh. They should match (substitute ksh for whichever shell you are using). See this FAQ for information regarding the "Magic Number"
Reply With Quote
  #3 (permalink)  
Old 01-05-2005
Registered User
 

Join Date: Dec 2004
Location: Zürich
Posts: 146
I'm using HP-UX 11vi with KSH

the script is written in perl but at least I know now where to look. I read somewhere that this error was common when upgrading from Oracle 8 32bit to Oracle 9i 64bit so I thought it might be a similiar problem.
Reply With Quote
  #4 (permalink)  
Old 01-05-2005
google's Avatar
Moderator
 

Join Date: Jul 2002
Location: Atlanta
Posts: 740
You will get a bad magic number error when attempting to execute any interpreted script (be it perl or shell) when the sha-bang line (thats the magic number) does not correctly point to the path of the interpreter. Fix that and you should be good as gold. In your case, check the output of the command which perl and compare that to the first line of your perl script.
Reply With Quote
  #5 (permalink)  
Old 01-05-2005
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,354
Remember that magic numbers are not just for shell scripts. Executables also have magic numbers. In fact, almost everything that is not a text file has a magic number. See
magic(4). And the file command uses a file called /etc/magic that lists them.

So this very well could be a 64 bit vs 32 bit problem. See our new faq "32 or 64 bit filesystems/files/OS's/CPU's" which has links to some info on the HP web site.
Reply With Quote
  #6 (permalink)  
Old 01-05-2005
Registered User
 

Join Date: Dec 2004
Location: Zürich
Posts: 146
I'm definitely using a 64bit system. I suspect the software I'm trying to install is supposing it is on a 32bit system and throws an error when it tries to access a 64bit library. Is there a way of figuring that out?
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 06:39 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0