Subject: Re: More ELF stuff
To: Ben Harris <bjh21@netbsd.org>
From: Chris Gilbert <chris@paradox.demon.co.uk>
List: port-arm32
Date: 02/11/2001 16:40:53
On Sunday 11 February 2001  4:27 pm, Ben Harris wrote:
> On Sun, 11 Feb 2001, Chris Gilbert wrote:
> > On Sunday 11 February 2001  2:24 pm, Ben Harris wrote:
> > bash-2.04$ ./sh
> > Illegal instruction (core dumped)
> >
> > gdb doesn't understand elf it seems, so couldn't debug. (ksh and csh also
> > core dump)
>
> Hmm.  I haven't even looked at GDB yet.

I don't suppose it's as simple as an option that needs changing somewhere?

> > So it looks to work enough that the binaries run, however interactive
> > things core dump?
>
> Hmm.  I'm more inclined to say that it's a matter of how big they are, or
> how many page faults they cause, or something like that.  Can you get
> ktruss output from one of the ones that doesn't work?  Maybe you could
> also try getting them to do something simple (e.g. "sh /dev/null") and see
> if that works

As requested:
 ktruss ./sh /dev/null
                                                   = 0
   218 ktruss   emul(netbsd)
   218 ktruss   execve("./sh", 0xefbfdc2c, 0xefbfdc38) JUSTRETURN
   218 sh       emul(netbsd)
SIGILL SIG_DFL
   218 sh       "sh.core"

Normally it's something like:
 ktruss /bin/sh /dev/null
                                                   = 0
   216 ktruss   emul(netbsd)
   216 ktruss   execve("/bin/sh", 0xefbfdc28, 0xefbfdc34) JUSTRETURN
   216 sh       emul(netbsd)
   216 sh       getpid                             = 216
   216 sh       __sysctl(0xefbfda30, 0x2, 0xefbfda2c, 0xefbfda28, 0, 0) = 0
[snip rest of output]

however ksh gets further, as does csh:
 ktruss ./ksh
                                                   = 0
   229 ktruss   emul(netbsd)
   229 ktruss   execve("./ksh", 0xefbfdc38, 0xefbfdc40) JUSTRETURN
   229 ksh      emul(netbsd)
   229 ksh      __sysctl(0xefbfd8d8, 0x2, 0xefbfd8d4, 0xefbfd8d0, 0, 0) = 0
   229 ksh      "/etc/malloc.conf"                 Err#2 ENOENT
   229 ksh      mmap(0, 0x1000, 0x3, 0x1002, 0xffffffff, 0, 0, 0) = 537395200
   229 ksh      break(0x88efc)                     = 0
   229 ksh      break(0x88efc)                     = 0
   229 ksh      break(0x8a000)                     = 0
   229 ksh      break(0x8a000)                     = 0
   229 ksh      break(0x8b000)                     = 0
   229 ksh      __sigaction14(SIGINT, 0x831fc, 0xefbfd998) = 0
   229 ksh      __sigaction14(SIGINT, 0xefbfd998, 0) = 0
   229 ksh      __sigaction14(SIGQUIT, 0x831fc, 0xefbfd998) = 0
   229 ksh      __sigaction14(SIGQUIT, 0xefbfd998, 0) = 0
   229 ksh      __sigaction14(SIGTERM, 0x831fc, 0xefbfd998) = 0
   229 ksh      __sigaction14(SIGTERM, 0xefbfd998, 0) = 0
   229 ksh      __sigaction14(SIGHUP, 0x831fc, 0xefbfd998) = 0
   229 ksh      __sigaction14(SIGHUP, 0xefbfd998, 0) = 0
   229 ksh      break(0x8b000)                     = 0
   229 ksh      break(0x8c000)                     = 0
   229 ksh      break(0x8c000)                     = 0
   229 ksh      break(0x8d000)                     = 0
   229 ksh      break(0x8d000)                     = 0
   229 ksh      break(0x8e000)                     = 0
   229 ksh      __stat13("/var/mail/chris", 0xefbfd8a8) Err#2 ENOENT
   229 ksh      getpid                             = 229
   229 ksh      break(0x8e000)                     = 0
   229 ksh      break(0x8f000)                     = 0
   229 ksh      __stat13("/home/chris/elf/bin", 0xefbfdac0) = 0
   229 ksh      __stat13(".", 0xefbfda60)          = 0
   229 ksh      getppid                            = 228
   229 ksh      gettimeofday(0xefbfd9d8, 0)        = 0
SIGILL SIG_DFL
   229 ksh      "ksh.core"

Cheers,
Chris