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

Ajay Pal S Grewal ajay_grewal at yahoo.com
Mon Apr 28 09:07:59 EDT 2008


Peter,

Thanks for your guidance.


>Have you verified using a separate system that the source file you
>copied and the new file on CF are identical?

>(Please boot the system only using old files on MTD to get checksum
>on the system. Put the CF in a CF reader on another, trusted, system
>to get checksum of the copies.)

good advice. however, seems like this is not the issue.

CF card (in linux host):

[ajay at localhost bin]$ pwd
/media/disk/bin
[ajay at localhost bin]$ cksum scp
635934266 37864 scp


MTD:
root at viper bin# pwd
/usr/bin
root at viper
 bin# cksum scp
635934266 37864 scp


>If it was reliably a single failure maybe dynamic linking could be
>blamed. I am not sure since you say that it sometimes takes more
>retries before the binary work.

Recently however i have been seeing single failure followed by success.

>Another matter is the CF - maybe there is a bit error and sometimes
>internal error
>correction in the CF will fix it, sometimes it gets
>the bit wrong. Are your flash cards new? Could you try more than two
>easily?

Flash card is brand new.

>It would be interesting to see ldd and strace for some binaries that
>you try to execute.

haven't been able to locate an ldd binary for arm linux on the web. will search more. 

Observations:

1. installed strace debian package. strace itself crashed first


root at viper root# strace
Segmentation fault
root at viper root#
 strace
usage: strace [-dffhiqrtttTvVxx] [-a column] [-e expr] ... [-o file]
              [-p pid] ... [-s strsize] [-u username] [-E var=val] ...
              [command [arg ...]]
   or: strace -c [-e expr] ... [-O overhead] [-S sortby] [-E var=val] ...
              [command [arg ...]]


2. Ist RUN:

root at viper bin# strace ./scp
execve("./scp", ["./scp"], [/* 11 vars */]) = 0
uname({sys="Linux", node="viper", ...}) = 0
brk(0)                                  = 0x1a000
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++
Process 770 detached


2nd RUN:

root at viper bin# strace ./scp
execve("./scp", ["./scp"], [/* 11 vars */])
 = 0
uname({sys="Linux", node="viper", ...}) = 0
brk(0)                                  = 0x1a000
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=3740, ...}) = 0
mmap2(NULL, 3740, PROT_READ, MAP_PRIVATE, 3, 0) = 0x40016000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/libresolv.so.2", O_RDONLY)   = 3
read(3, "\177ELF\1\1\1a\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0$$\0\0004"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=63172, ...}) = 0
mmap2(NULL, 104476, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYW
....
bunch of other regular
 stuff
....


could it be a memory mapping issue ? block size issue etc ? (although i did try smaller partitions
as well on CF card with block size=1024 with same result)

3. Also, installation of debian perl base package fails. this fails always.

root at viper tmp# dpkg -i perl-base_5.8.8-7etch1_arm.deb 
Segmentation fault
root at viper tmp# 


4. root at viper tmp# ldconfig

ldconfig: /usr/lib/libcpufreq.so.0 is not an ELF file - it has the wrong magic bytes at th.

ldconfig: /usr/lib/libfontenc.so.1.0.0 is not an ELF file - it has the wrong magic bytes a.

ldconfig: /usr/lib/libXmuu.so.1 is not an ELF file - it has the wrong magic bytes at the s.

ldconfig: file /usr/lib/libpopt.so.0 is truncated

ldconfig: file /usr/lib/libXext.so.6.4.0 is truncated

ldconfig: /usr/lib/libXdmcp.so.6.0.0 is not an ELF file - it has the wrong magic bytes at .

ldconfig: /usr/lib/libts-0.0.so.0
 is not an ELF file - it has the wrong magic bytes at the.

ldconfig: /usr/lib/libaim104.so.0 is not an ELF file - it has the wrong magic bytes at the.

ldconfig: /usr/lib/libXau.so.6.0.0 is not an ELF file - it has the wrong magic bytes at th.


However, cksums for above files are same as those on MTD !

5. A bit more history: my initial intent was to use CF card as execlusive storage with root
file system mounted on it. went down that path to only find that kernel used to hang after 
printing "freeing init memory". After putting some debugs found that /sbin/init was crashing ! 
iam pretty sure that was because of the same reason as above binary crashes.

any other ideas ?


      ____________________________________________________________________________________
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