From: Nylund, M. <Mar...@em...> - 2007-03-20 07:17:32
|
I'm having problems to start dynamically linked applications in userspace. The bootlog below should give enough information of the system. Here are some symptoms: - The kernel seems to boot just fine (I've also tried 2.6.19). - Trying to start a dynamically linked /sbin/init results an "unaligned userspace access error" (see bootlog in Listing 1) '/sbin/init' is a simple dynamically linked "hello world" program here. =20 - Starting a statically linked /sbin/init works. I know that the linker uses mmap somehow to map the libc into the processes address space and apparently here something goes wrong, but I'm not=20 enough of a memory management hacker to figure out what. Is mm for sh3 somehow broken? Could it be the toolchain which is causing this (taken from www.sh-linux.org rpm repository)? Listing 2 shows another trace message which comes in an enless loop when I try to run my initialisation scripts, (only on 2.6.21-rc4 -never happened on 2.6.19) Thanks for any help, martin ---- Listing 1--------------------------------------------------------------- Linux version 2.6.21-rc4 (hico@emdistvm-xubuntu) (gcc version 3.4.4) #12 Mon Mar 19 16:58:19 CET 2007 On node 0 totalpages: 8192 Normal zone: 64 pages used for memmap Normal zone: 0 pages reserved Normal zone: 8128 pages, LIFO batch:0 Built 1 zonelists. Total pages: 8128 Kernel command line: disptype=3D0 mem=3D32M console=3DttySC0,115200 ip=3D192.168.105.52:192.168.105.50:192.168.105.254:255.255.255.0:abc::off= debug root=3D/dev/nfs ro nfsroot=3D/home/hico/uspc/rootfs,rsize=3D1024,wsize=3D1024 = earlyprintk=3Dserial PID hash table entries: 128 (order: 7, 512 bytes) Interval =3D 83325 = Using tmu for system timer disabling early console Console: colour dummy device 80x25 Dentry cache hash table entries: 4096 (order: 2, 16384 bytes) Inode-cache hash table entries: 2048 (order: 1, 8192 bytes) Memory: 30300k/32768k available (1852k kernel code, 2468k reserved, 81k data, 72k init) Calibrating delay loop... 66.35 BogoMIPS (lpj=3D331776) Mount-cache hash table entries: 512 CPU: SH7727 NET: Registered protocol family 16 NET: Registered protocol family 2 IP route cache hash table entries: 1024 (order: 0, 4096 bytes) TCP established hash table entries: 1024 (order: 1, 8192 bytes) TCP bind hash table entries: 1024 (order: 0, 4096 bytes) TCP: Hash tables configured (established 1024 bind 1024) TCP reno registered JFFS2 version 2.2. (NAND) (C) 2001-2006 Red Hat, Inc. JFS: nTxBlock =3D 236, nTxLock =3D 1893 io scheduler noop registered io scheduler anticipatory registered (default) io scheduler deadline registered io scheduler cfq registered SuperH SCI(F) driver initialized sh-sci: ttySC0 at MMIO 0xfffffe80 (irq =3D 25) is a sci sh-sci: ttySC1 at MMIO 0xa4000150 (irq =3D 59) is a scif RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize loop: loaded (max 8 devices) cs89x0:cs89x0_probe(0x0) PP_addr at b4000000[a]: 0x3128 cs89x0.c: v2.4.3-pre1 Russell Nelson <ne...@cr...>, Andrew Morton <an...@uo...> eth0: cs8900 rev K found at 0xb4000000 cs89x0: No EEPROM cs89x0 media RJ-45, IRQ 34, programmed I/O, MAC 11:22:33:44:55:66 cs89x0_probe1() successful cs89x0:cs89x0_probe(0x0) cs89x0: request_region(0xb4000003, 0x10) failed cs89x0: no cs8900 or cs8920 detected. Be sure to disable PnP with SETUP physmap platform flash device: 01000000 at a0000000 physmap-flash.0: Found 2 x16 devices at 0x0 in 32-bit bank Intel/Sharp Extended Query Table at 0x0031 Using buffer write method cfi_cmdset_0001: Erase suspend on write enabled erase region 0: offset=3D0x0,size=3D0x40000,blocks=3D64 cmdlinepart partition parsing not available Searching for RedBoot partition table in physmap-flash.0 at offset 0xfc0000 7 RedBoot partitions found on MTD device physmap-flash.0 mice: PS/2 mouse device common for all mice TCP cubic registered NET: Registered protocol family 1 drivers/rtc/hctosys.c: unable to open rtc device (rtc0) eth0: using half-duplex 10Base-T (RJ-45) IP-Config: Complete: device=3Deth0, addr=3D192.168.105.52, mask=3D255.255.255.0, gw=3D192.168.105.254, host=3Dabc, domain=3D, nis-domain=3D(none), bootserver=3D192.168.105.50, rootserver=3D192.168.105.50, = rootpath=3D Looking up port of RPC 100003/2 on 192.168.105.50 Looking up port of RPC 100005/1 on 192.168.105.50 VFS: Mounted root (nfs filesystem) readonly. Freeing unused kernel memory: 72k freed Fixing up unaligned userspace access in "init" pid=3D1 pc=3D0x00000a0e ins=3D0x5f73=20 Fixing up unaligned userspace access in "init" pid=3D1 pc=3D0x00000a10 ins=3D0x6966 ------------------------------------------------------------------------ ----- ---- Listing 2--------------------------------------------------------------- VM: killing process rcS Bad pte =3D ffffffff, process =3D ???, vm_flags =3D 1875, vaddr =3D = 40b000 Stack: (0x8c581dd8 to 0x8c582000) 1dc0: 8c237838 0040b000 1de0: 0040b000 8c237cb8 8e01a02c 003f4000 8c581e5c 8c3ed17c 00000000 ffffffff 1e00: 00000001 00000000 00000001 00518000 8e0d6004 8e0d6004 8e0d6004 00000000 1e20: 00000000 8c3fb544 8c5df9f0 00517fff 8c23c0ce 8c3d4850 00000001 0000000b 1e40: 8c5df9b0 8c3ed17c 00000000 ffffffff 8c581e58 00000000 00000000 8c3fb544 1e60: 8c20d25c 8c580000 8c5a99c0 0000023c 8c5df9b0 8c2119d6 8c5a9bfc 8c3d5630 1e80: 00000000 00000000 8c5a9a3c 8c211fea ffffff0f 8c580000 8c581ee0 8c580000 1ea0: 0000023c 8c580000 0000000b 8c21a70a 0000000b 8c581f60 8c581f9c 8c5a9c18 1ec0: 8c203bf4 7bc5159c 8c581f60 8c5a9c18 8c581fdc 8c581f9c 8c581ff4 00485570 1ee0: 0000000b 00000000 00000000 000000aa 00000000 00000000 00000093 00000001 1f00: 0001ffec 00000000 8c49c000 00000fec 00000010 8e0d8fec 00000010 8c2496d0 1f20: 00000000 8c3f9202 8c2496d0 8c3f9200 fffffff8 8c3f92fc 8c3d5614 8c3f92fc 1f40: 8c3f92fc 8c249870 8c581f9c 7bc515b0 00000000 8c24990e 8c3f9200 8c3f9300 1f60: 00000000 8c2034f0 7bc5159c 7bc51f24 8c49c000 8c20350c 0055ced8 8c20706c 1f80: 7bc5159c 7bc51f24 00485570 ffffff0f 00000001 8c581ff4 8c580000 fffffff2 1fa0: 00000000 00000002 0000000b 7bc519b0 7bc515b0 0055ced8 00000400 7bc519b0 1fc0: 7bc515b0 0055ced8 0055d068 00485420 7bc51f24 7bc5159c 7bc5159c 00485536 1fe0: 00417386 00000001 0055c3e0 00000003 00000000 0000004c 00000160 00000000 Call trace: [<8c3ed17c>] pidhash_init+0x4c/0x100 [<8c237cb8>] unmap_vmas+0x1a8/0x430 [<8c3ed17c>] pidhash_init+0x4c/0x100 [<8c23c0ce>] exit_mmap+0x3e/0xf0 [<8c3ed17c>] pidhash_init+0x4c/0x100 [<8c20d25c>] mmput+0x3c/0xb0 [<8c2119d6>] do_exit+0x1c6/0x730 [<8c211fea>] do_group_exit+0x7a/0x90 [<8c21a70a>] get_signal_to_deliver+0x2da/0x330 [<8c203bf4>] do_notify_resume+0x64/0x5c0 [<8c2496d0>] search_binary_handler+0x40/0x110 [<8c2496d0>] search_binary_handler+0x40/0x110 [<8c249870>] do_execve+0xd0/0x1e0 [<8c24990e>] do_execve+0x16e/0x1e0 [<8c2034f0>] sys_execve+0x30/0x70 [<8c20350c>] sys_execve+0x4c/0x70 [<8c20706c>] restore_all+0x0/0x68 ------------------------------------------------------------------------ ------- |