Segmentation fault when running binaries off a CF card on arcom pxa255 SBC

Ajay Pal S Grewal ajay_grewal at yahoo.com
Thu Apr 24 21:10:21 EDT 2008


Hello Everyone,

I am using Arcom Viper-Lite board (200MHz PXA255 XScale® SBC) with embedded linux (kernel 2.6.16-28) (http://www.arcom.com/pc104-xscale-viper-lite.htm)

This board has onboard 16MB Flash and 64MB SDRAM and CF+ slot. Arcom ships this board with preloaded embedded linux  distro on 16MB flash with all standard stuff: sshd, httpd etc All stored on single MTD partition mounted on /  Boot loader is RedBoot.

I am turning to this list after receiving no response from arcom and searching much on the web.

I am facing following problem:

Segmentation fault when executing any binary (e.g. sshd, scp) residing on sandisk ultra II 2GB memory card (512MB card gives same problem) in CF slot on Arcom Viper-Lite board for first couple of times..then it works fine.

Background:

1. To increase the memory (wanted to install debian arm perl packages etc) on the board i decided to use CF card and created three partitions with ext3 filesystem.
/dev/hda1 mounted on /usr ( 1 GB)
/dev/hda2 mounted on /var (512 MB)
/dev/hda3 mounted on /home (512 MB)

2. Copied all /usr, /var and /home contents (from onboard 16MB flash, MTD) to above respective partitions
3. modified /etc/fstab to mount above partitions during bootup

Observations:
Now when the system boots sshd, httpd all fail to start initially. It has been observed that these services can be started however after executing their startup files. e.g. running "/etc/rc3.d/S55sshd start" multiple times.

In general it has been observed that any binary residing on /dev/hda1 partition (mounted on /usr) when executed for the first time, second or even third time gives segmentation fault. However, it is able to run fourth time and onwards. Examples:
...

root at viper bin# pwd      
/usr/bin
root at viper bin# ./scp
Segmentation fault
root at viper bin# ./scp
usage: scp [-1246BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file]
           [-l limit] [-o ssh_option] [-P port] [-S program]
           [[user@]host1:]file1 [...] [[user@]host2:]file2
....

root at viper bin# ./ssh-keygen
Segmentation fault
root at viper bin# ./ssh-keygen
You must specify a key type (-t).
Usage: ssh-keygen [options]
Options:
  -b bits     Number of bits in the key to create.
  -c          Change comment in private and public key files.
.....


I would appreciate guidance/help from this community.

Thanks

SYSTEM BOOT LOG:

------
CF: Cannot enable card
Ethernet eth0: MAC address 00:80:66:10:dc:cc
IP: 192.168.0.1/255.255.255.0, Gateway: 0.0.0.0
Default server: 192.168.0.2, DNS server IP: 0.0.0.0

RedBoot(tm) bootstrap and debug environment [ROM]
Non-certified release, version W468 V3I7 - built 10:11:20, Mar 15 2006

Platform: VIPER (XScale PXA255) 
Copyright (C) 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.

RAM: 0x00000000-0x04000000, [0x00400000-0x03fd1000] available
FLASH: base 0x60000000, size 0x01000000, 128 blocks of 0x00020000 bytes each.
== Executing boot script in 6.000 seconds - enter ^C to abort
RedBoot> clock -l 27 -m 2 -n 10
mem:99.532MHz run:199.065MHz turbo:199.065MHz. cccr 0x141 (L=27 M=1 N=1.0)
RedBoot> mount -t jffs2 -f filesystem
RedBoot> load -r -b %{FREEMEMLO} %{kernel}
Using default protocol (file)
Raw file loaded 0x00400000-0x00518f8f, assumed entry at 0x00400000
RedBoot> exec -c %{cmdline}
Using base address 0x00400000 and length 0x00118f90
Uncompressing Linux.............................................................
Linux version 2.6.16.28-arcom1 (ajay at localhost.localdomain) (gcc version 3.4.4)8
CPU: XScale-PXA255 [69052d06] revision 6 (ARMv5TE)
Machine: Arcom VIPER SBC
Memory policy: ECC disabled, Data cache writeback
Memory clock: 99.53MHz (*27)
Run Mode clock: 199.07MHz (*2)
Turbo Mode clock: 199.07MHz (*1.0, active)
CPU0: D VIVT undefined 5 cache
CPU0: I cache: 32768 bytes, associativity 32, 32 byte lines, 32 sets
CPU0: D cache: 32768 bytes, associativity 32, 32 byte lines, 32 sets
Built 1 zonelists
Kernel command line: root=/dev/mtdblock2 rootfstype=jffs2 rw console=ttyS0,11520
Map ISA IRQ 3 to IRQ 104
Map ISA IRQ 4 to IRQ 105
Map ISA IRQ 5 to IRQ 106
Map ISA IRQ 6 to IRQ 107
Map ISA IRQ 7 to IRQ 108
Map ISA IRQ 10 to IRQ 109
Map ISA IRQ 11 to IRQ 110
Map ISA IRQ 12 to IRQ 111
Map ISA IRQ 9 to IRQ 112
Map ISA IRQ 14 to IRQ 113
Map ISA IRQ 15 to IRQ 114
PID hash table entries: 512 (order: 9, 8192 bytes)
Console: colour dummy device 80x30
Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
Memory: 64MB = 64MB total
Memory: 62396KB available (1948K code, 382K data, 80K init)
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
NET: Registered protocol family 16
viper: setting CPU core voltage to 1.0V at 199.065MHz
viper: hardware v2i5 detected. CPLD revision 1.
pxa25x: CPU frequency change support initialized (performance tables)
viper: setting CPU core voltage to 1.3V at 398.131MHz
NetWinder Floating Point Emulator V0.97 (double precision)
Installing knfsd (copyright (C) 1996 okir at monad.swb.de).
JFFS2 version 2.2. (NAND) (C) 2001-2003 Red Hat, Inc.
Initializing Cryptographic API
io scheduler noop registered
io scheduler deadline registered (default)
Serial: 8250/16550 driver $Revision: 1.90 $ 64 ports, IRQ sharing enabled
serial8250.0: ttyS0 at MMIO 0x40100000 (irq = 15) is a XScale
serial8250.0: ttyS1 at MMIO 0x40200000 (irq = 14) is a XScale
serial8250.0: ttyS2 at MMIO 0x40700000 (irq = 13) is a XScale
serial8250.0: ttyS3 at MMIO 0x14300010 (irq = 27) is a 16450
serial8250.0: ttyS4 at MMIO 0x14300000 (irq = 26) is a 16450
loop: loaded (max 8 devices)
smc91x.c: v1.1, sep 22 2004 by Nicolas Pitre <nico at cam.org>
eth0: SMC91C11xFD (rev 2) at c4856300 IRQ 1 [nowait]
eth0: Ethernet addr: 00:80:66:10:dc:cc
Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2
ide: Assuming 50MHz system bus speed for PIO modes; override with idebus=xx
Probing VIPER flash device at physical address 0x04000000
Probing flash at physical address 0x04000000
flash: Found 1 x16 devices at 0x0 in 16-bit bank
 Intel/Sharp Extended Query Table at 0x010A
 Intel/Sharp Extended Query Table at 0x010A
 Intel/Sharp Extended Query Table at 0x010A
 Intel/Sharp Extended Query Table at 0x010A
 Intel/Sharp Extended Query Table at 0x010A
Using buffer write method
cfi_cmdset_0001: Erase suspend on write enabled
Unlocking VIPER flash device
VIPER flash unlocked
cmdlinepart partition parsing not available
Searching for RedBoot partition table in flash at offset 0x0
3 RedBoot partitions found on MTD device flash
Creating 3 MTD partitions on "flash":
0x00000000-0x0001f000 : "FIS directory"
0x0001f000-0x00020000 : "RedBoot config"
0x00020000-0x01000000 : "filesystem"
i2c /dev entries driver
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 4096 (order: 2, 16384 bytes)
TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
TCP: Hash tables configured (established 4096 bind 4096)
TCP reno registered
TCP bic registered
NET: Registered protocol family 1
NET: Registered protocol family 17
VFS: Mounted root (jffs2 filesystem).
Freeing init memory: 80K
pccard: PCMCIA card inserted into slot 0
pcmcia: registering new device pcmcia0.0
INIT: version 2.85 booting
hda: SanDisk SDCFH-2048, CFA DISK drive
Activating swap.
ide0 at 0xc4860000-0xc4860007,0xc486000e on irq 31
hda: max request size: 128KiB
hda: 4001760 sectors (2048 MB) w/1KiB Cache, CHS=3970/16/63
 hda: hda1 hda2 hda3
ide-cs: hda: Vcc = 3.3, Vpp = 0.0
Calculating module dependencies... done.
Loading modules...
All modules loaded.
Setting clock (utc):The Hardware Clock does not contain a valid time, so we can.
Unable to set system clock.
Checking all file systems...
fsck 1.35 (28-Feb-2004)
/dev/hda1 has gone 49710 days without being checked, check forced.
./dev/hda1: 923/125440 files (0.0% non-contiguous), 12404/250480 blocks         
^@/dev/hda2 has gone 49710 days without being checked, check forced.
./dev/hda2: 320/125984 files (0.9% non-contiguous), 24823/501984 blocks         
Configuring serial devices...ttyS3: LSR safety check engaged!
ttyS3: LSR safety check engaged!
ttyS4: LSR safety check engaged!
ttyS4: LSR safety check engaged!
done.
Mounting local filesystems...
kjournald starting.  Commit interval 5 seconds
EXT3 FS on hda1, internal journal
EXT3-fs: mounted filesystem with ordered data mode.
kjournald starting.  Commit interval 5 seconds
EXT3 FS on hda2, internal journal
EXT3-fs: mounted filesystem with ordered data mode.
/dev/hda1 on /usr type ext3 (rw)
/dev/hda2 on /var type ext3 (rw)
tmpfs on /var/tmp type tmpfs (rw,size=4M)
Creating boot directories...
Setting up IP spoofing protection: rp_filter.
Configuring network interfaces...eth0: link down
done.
Starting portmap daemon: portmap.
Initializing random number generator...done.
INIT: Entering runlevel: 3
Starting system log daemon: syslogd.
Starting kernel log daemon: klogd.
Starting NFS common utilities: statd.
Loading /etc/console/keymap.gz
Starting internet superserver: inetd.
Starting http server: /etc/rc3.d/S50thttpd: line 61:   577 Segmentation fault  S
Starting OpenBSD Secure Shell Server: sshd/etc/rc3.d/S55sshd: line 105:   579 Sd
.
Starting periodic command scheduler: cron.

Arcom Embedded Linux v4i2b (ttyS0)
viper login: root
Password: 
root at viper root# /etc/rc3.d/S50
S50inetd   S50thttpd  
root at viper root# /etc/rc3.d/S50thttpd start
Starting http server: thttpd.
root at viper root# /etc/rc3.d/S55sshd start  
Starting OpenBSD Secure Shell Server: sshd/etc/rc3.d/S55sshd: line 105:   658 Sd
.
root at viper root# /etc/rc3.d/S55sshd start
Starting OpenBSD Secure Shell Server: sshd/etc/rc3.d/S55sshd: line 105:   660 Sd
.
root at viper root# /etc/rc3.d/S55sshd start
Starting OpenBSD Secure Shell Server: sshd/etc/rc3.d/S55sshd: line 105:   662 Sd
.
root at viper root# /etc/rc3.d/S55sshd start
Starting OpenBSD Secure Shell Server: sshd/etc/rc3.d/S55sshd: line 105:   664 Sd
.
root at viper root# /etc/rc3.d/S55sshd start
Starting OpenBSD Secure Shell Server: sshd.
root at viper root# cd /usr/bin
root at viper bin# pwd
/usr/bin
root at viper bin# ./scp
Segmentation fault
root at viper bin# ./scp
usage: scp [-1246BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file]
           [-l limit] [-o ssh_option] [-P port] [-S program]
           [[user@]host1:]file1 [...] [[user@]host2:]file2
root at viper bin# 
-----









      ____________________________________________________________________________________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ




      ____________________________________________________________________________________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ



More information about the linux-pcmcia mailing list