Subject: Problem exec-ing apps

From: [email-masked]
Date: Wed, 16 Feb 2000 09:38:12

Hi,
I am having problems 'exec'ing applications in an
anvil EP7211-based board. The user apps exit giving a 
memory violation at pc=0x0.

I am using a very minimal shell (that just forks and
execs). The only application that I am able to
successfully exec from this shell is another instance
of itself. All other apps give the memory violation.
The exec system call itself does not return failure.

The shell is exec-ed from init/main.c as usual.
I have verified that the apps that fail (from the
shell) successfully execute if they are exec-ed from
init/main.c

The exec system call code-path, i.e, 

   /bin/sh
-> execve()
-> sys_execve_wrapper (/arch/arm/entry-common.S) 
-> sys_execve   (arch/arm/sys_arm.c)
-> do_execve    (fs/exec.c)
-> do_load_elf_binary (fs/binfmt_elf.c) 

and all other subfunctions, return success  in both 
cases (the load and pagetable mappings
for the new process successfully completed?).

Application memory map for the successful invocation
of the shell:

(start_brk) 203ec84
(end_code) 2034f54
(start_code) 2000000
(end_data) 203dfc0
(start_stack) bfffff90
(brk) 203ec84

Map when exec fails:

(start_brk) 203eb34
(end_code) 2034e04
(start_code) 2000000
(end_data) 203de70
(start_stack) bfffffa0
(brk) 203eb34

Message from the application that the shell
attempted to exec: 
/bin/print: memory violation at pc=0x00000000, lr=0x0202eb4c
(bad address=0x00000000, code 3)

The board has 16M of memory. The filesystem is ext2fs
and it resides in the flash. 
I've 16M of flash from phys address 0x0.
The applications are statically linked elf
executables.

Could anyone please suggest something?

Thanks & Rgds,
Srikrishnan V

 -------------------------------------------------------------------------------
Get a free mail address from http://www.indiainfo.com

unsubscribe: body of `unsubscribe linux-arm' to [email-masked]
++        Please use [email-masked] for           ++
++                        kernel-related discussions.                      ++

---

From: Ben Williamson <[email-masked]>
Date: Thu, 17 Feb 2000 00:32:55 +1100 (EST)

> memory violation at pc=0x0.

Cool, so someone else finally has an Anvil board!  Except it has 16MB?
That doesn't sound like an Anvil...

I'm assuming you're using my patch on top of crash+burn-26?  In that case
you probably have the same problem that Pawel found.  I've attached his
message below, which describes a fix.  My stupid mistake.  One day I'll
post a new patch, I was hoping to have some other stuff done on it but
haven't had time lately.  Usual story.

Anyway, hope this helps.  All the best,

- Ben.

-------------------------------------------------------------------
Ben Williamson       [email-masked]     http://www.pobox.com/~benw/

---------- Forwarded message ----------
From: Pawel Gburzynski <[email-masked]>
To: Ben Williamson <[email-masked]>
Subject: Re: Linux on ARM720T (more updates)

Ben,

There is a bit more. Your nice little shell runs fine, but the
system will panic as soon as you try, e.g., to do execve. The
problem is that the TLB is not flushed properly because
arch/arm/mm/proc-arm6,7.S assembles with the wrong CPU version.

Do this:

In arch/arm/mm/proc-arm6,7.S, replace all occurrences of
CONFIG_ARCH_ARMV4 with CONFIG_CPU_ARMV4.

Add "#include <linux/autoconf.h>" in the header.

Regards,

--
Pawel