Subject: Re: firefox-bin failing
To: Ed Gould , Martin Husemann <martin@duskware.de>
From: Brian Buhrow <buhrow@lothlorien.nfbcal.org>
List: port-i386
Date: 04/12/2006 17:34:21
	What does the command file on the binary say?
What about the ldd command?
-Brian
On Apr 12,  4:55pm, Ed Gould wrote:
} Subject: Re: firefox-bin failing
} >> The question is, why isn't the kernel recognizing this as a valid 
} >> executable?
} > 
} > ktrace it - that should tell you the emulation the kernel picks and/or
} > if something else fails in the exec call (like missing ld.so in the emul
} > directory)
} 
} Not much help.  The execve() issued by ktruss (same for ktrace) returns
} ENOEXEC, then it falls back to the shell:
} 
} $ ktruss /usr/pkg/lib/firefox-linux/firefox-bin 2>/dev/null
}  15517      1 ktruss   emul(netbsd)
}  15517      1 ktruss   fcntl(0x4, 0x3, 0)          = 1
}  15517      1 ktruss   fcntl(0x4, 0x4, 0x1)        = 0
}  15517      1 ktruss   execve("/usr/pkg/lib/firefox-linux/firefox-bin", 0xbfbfe564, 0xbfbfe56c) Err#8 ENOEXEC
}  15517      1 sh       emul(netbsd)
}  15517      1 sh       execve("/bin/sh", 0xbfbfe060, 0xbfbfe56c) JUSTRETURN
}  15517      1 sh       mmap(0, 0x8000, 0x3, 0x1002, 0xffffffff, 0, 0, 0) = 0xbbbec000
}  15517      1 sh       open("/etc/ld.so.conf", 0, 0xffffffff) = 3
}  15517      1 sh       __fstat30(0x3, 0xbfbfe450)  = 0
}  15517      1 sh       mmap(0, 0x37, 0x1, 0x1, 0x3, 0, 0, 0) = 0xbbbeb000
}  15517      1 sh       close(0x3)                  = 0
}  15517      1 sh       munmap(0xbbbeb000, 0x37)    = 0
}  15517      1 sh       open("/lib/libedit.so.2", 0, 0) = 3
}  15517      1 sh       __fstat30(0x3, 0xbfbfdd30)  = 0
}  15517      1 sh       mmap(0, 0x1000, 0x1, 0x1, 0x3, 0, 0, 0) = 0xbbbeb000
}  15517      1 sh       munmap(0xbbbeb000, 0x1000)  = 0
}  15517      1 sh       mmap(0, 0x1a000, 0x5, 0x2, 0x3, 0, 0, 0) = 0xbbbd2000
}  15517      1 sh       mmap(0xbbbea000, 0x2000, 0x3, 0x12, 0x3, 0, 0x17000, 0) = 0xbbbea000
}  15517      1 sh       mmap(0xbbbec000, 0, 0x3, 0x1012, 0xffffffff, 0, 0, 0) = 0xbbbec000
}  15517      1 sh       close(0x3)                  = 0
}  15517      1 sh       open("/lib/libtermcap.so.0", 0, 0xbfbfdd30) = 3
}  15517      1 sh       __fstat30(0x3, 0xbfbfdd30)  = 0
}  15517      1 sh       mmap(0, 0x1000, 0x1, 0x1, 0x3, 0, 0, 0) = 0xbbbd1000
}  15517      1 sh       munmap(0xbbbd1000, 0x1000)  = 0
}  15517      1 sh       mmap(0, 0x3000, 0x5, 0x2, 0x3, 0, 0, 0) = 0xbbbcf000
}  15517      1 sh       mmap(0xbbbd1000, 0x1000, 0x3, 0x12, 0x3, 0, 0x2000, 0) = 0xbbbd1000
}  15517      1 sh       mmap(0xbbbd2000, 0, 0x3, 0x1012, 0xffffffff, 0, 0, 0) = 0xbbbd2000
}  15517      1 sh       close(0x3)                  = 0
}  15517      1 sh       open("/lib/libc.so.12", 0, 0xbfbfdd30) = 3
}  15517      1 sh       __fstat30(0x3, 0xbfbfdd30)  = 0
}  15517      1 sh       mmap(0, 0x1000, 0x1, 0x1, 0x3, 0, 0, 0) = 0xbbbce000
}  15517      1 sh       munmap(0xbbbce000, 0x1000)  = 0
}  15517      1 sh       mmap(0, 0xd3000, 0x5, 0x2, 0x3, 0, 0, 0) = 0xbbafc000
}  15517      1 sh       mmap(0xbbbb8000, 0x7000, 0x3, 0x12, 0x3, 0, 0xbb000, 0) = 0xbbbb8000
}  15517      1 sh       mmap(0xbbbbf000, 0x10000, 0x3, 0x1012, 0xffffffff, 0, 0, 0) = 0xbbbbf000
}  15517      1 sh       close(0x3)                  = 0
}  15517      1 sh       issetugid()                 = 0
}  15517      1 sh       getpid()                    = 15517
}  15517      1 sh       __sysctl(0xbfbfe2f8, 0x2, 0xbfbfe2f0, 0xbfbfe2f4, 0, 0) = 0
}  15517      1 sh       readlink("/etc/malloc.conf", 0xbfbfe370, 0x3f) Err#2 ENOENT
}  15517      1 sh       mmap(0, 0x1000, 0x3, 0x1002, 0xffffffff, 0, 0, 0) = 0xbbafb000
}  15517      1 sh       break(0x8063bd8)            = 0
}  15517      1 sh       break(0x8064bd8)            = 0
}  15517      1 sh       break(0x8065000)            = 0
}  15517      1 sh       break(0x8066000)            = 0
}  15517      1 sh       break(0x8067000)            = 0
}  15517      1 sh       geteuid()                   = 101
}  15517      1 sh       __stat30(".", 0xbfbfe3d0)   = 0
}  15517      1 sh       __stat30("/sys/arch/i386/conf", 0xbfbfe360) = 0
}  15517      1 sh       open("/usr/pkg/lib/firefox-linux/firefox-bin", 0, 0x3) = 3
}  15517      1 sh       fcntl(0x3, 0, 0xa)          = 10
}  15517      1 sh       close(0x3)                  = 0
}  15517      1 sh       fcntl(0xa, 0x2, 0x1)        = 0
}  15517      1 sh       getuid()                    = 101
}  15517      1 sh       geteuid()                   = 101
}  15517      1 sh       getgid()                    = 101
}  15517      1 sh       getegid()                   = 101
}  15517      1 sh       __sigaction_sigtramp(0x2, 0, 0xbfbfe3f0, 0, 0) = 0
}  15517      1 sh       __sigaction_sigtramp(0x2, 0xbfbfe3e0, 0xbfbfe3c0, 0xbbb5ec0c, 0x2) = 0
}  15517      1 sh       __sigaction_sigtramp(0x2, 0, 0xbfbfe3e0, 0, 0) = 0
}  15517      1 sh       __sigaction_sigtramp(0x2, 0xbfbfe3e0, 0, 0xbbb5ec0c, 0x2) = 0
}  15517      1 sh       __sigprocmask14(0x2, 0xbfbfe440, 0) = 0
}  15517      1 sh       __sigaction_sigtramp(0x3, 0, 0xbfbfe3f0, 0, 0) = 0
}  15517      1 sh       __sigaction_sigtramp(0x3, 0xbfbfe3e0, 0xbfbfe3c0, 0xbbb5ec0c, 0x2) = 0
}  15517      1 sh       __sigprocmask14(0x2, 0xbfbfe440, 0) = 0
}  15517      1 sh       __sigaction_sigtramp(0x1, 0, 0xbfbfe3f0, 0, 0) = 0
}  15517      1 sh       __sigaction_sigtramp(0x1, 0xbfbfe3e0, 0xbfbfe3c0, 0xbbb5ec0c, 0x2) = 0
}  15517      1 sh       __sigprocmask14(0x2, 0xbfbfe440, 0) = 0
}  15517      1 sh       __sigaction_sigtramp(0x12, 0, 0xbfbfe3f0, 0, 0) = 0
}  15517      1 sh       __sigaction_sigtramp(0x12, 0xbfbfe3e0, 0xbfbfe3c0, 0xbbb5ec0c, 0x2) = 0
}  15517      1 sh       __sigprocmask14(0x2, 0xbfbfe440, 0) = 0
}  15517      1 sh       __sigaction_sigtramp(0xd, 0, 0xbfbfe3f0, 0, 0) = 0
}  15517      1 sh       __sigaction_sigtramp(0xd, 0xbfbfe3e0, 0xbfbfe3c0, 0xbbb5ec0c, 0x2) = 0
}  15517      1 sh       __sigprocmask14(0x2, 0xbfbfe440, 0) = 0
}  15517      1 sh       read(0xa, 0x8062960, 0x3f8) = 1016
}        "\^?ELF\^A\^A\^A\0\0\0\0\0\0\0\0\0\^B\0\^C\0\^A\0\0\0Dq\a\b4\0\0\0\M-T"
}  15517      1 sh       break(0x8068000)            = 0
}  15517      1 sh       write(0x2, 0x8067000, 0x2b) = 43
}        "/usr/pkg/lib/firefox-linux/firefox-bin: 1: "
}  15517      1 sh       write(0x2, 0x8067000, 0x1d) = 29
}        "Syntax error: "(" unexpected\n"
}  15517      1 sh       exit(0x2)
} 
} 
} 	--Ed
} 
>-- End of excerpt from Ed Gould