BusyBox Bug and Patch Tracking
BusyBox
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0001345 [uClibc] Shared Library Support major always 05-13-07 17:40 10-08-08 04:28
Reporter redhatter View Status public  
Assigned To uClibc
Priority normal Resolution open  
Status assigned   Product Version 0.9.27
Summary 0001345: [MIPS,powerpc] uClibc fails to mmap shared libraries with CONFIG_PAGE_SIZE_16KB set in kernel
Description Hi...

Recently I started building some uClibc userland environments for a mipsel target. My build host is a Lemote Fulong miniPC running a Loongson2E processor (subset MIPS-3), and I've also been doing testing with a Cobalt Qube2 (MIPS-4).

Everything builds fine, however, when I try to chroot in on the Loongson, I get told uClibc "can't map" the libraries. However, when I rsync this chroot across to the Qube2, everything works fine.

It would appear that uClibc's ld.so assumes the kernel uses a page size of 4KB (0x1000). When it specifies an offset of 0x3000, this works fine on a kernel with a 4KB page size, since 3
Additional Information An strace reveals what's happening behind the scenes:

execve("bin/busybox.dynamic", ["bin/busybox.dynamic"], [/* 57 vars */]) = 0
svr4_syscall() = -1 ERRNO_4090 (Unknown error 4090)
stat("/etc/ld.so.cache", {st_mode=S_IFREG|0644, st_size=1728, ...}) = 0
open("/etc/ld.so.cache", O_RDONLY) = 3
old_mmap(NULL, 1728, PROT_READ, MAP_SHARED, 3, 0) = 0x2aab4000
close(3) = 0
open("/lib/libcrypt.so.0", O_RDONLY) = 3
old_mmap(NULL, 16384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2aab8000
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\10\0\1\0\0\0`\5\0\000"..., 16384) = 13584
old_mmap(NULL, 348160, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2aaf0000
old_mmap(0x2aaf0000, 10692, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0x2aaf0000
old_mmap(0x2ab33000, 68, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x3000) = -1 EINVAL (Invalid argument)
old_mmap(NULL, 16384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2aabc000
write(2, "", 0) = 0
write(2, "bin/busybox.dynamic", 19) = 19
write(2, ": can\'t map \'", 13) = 13
write(2, "/lib/libcrypt.so.0", 18) = 18
write(2, "\'\n", 2) = 2
munmap(0x2aabc000, 16384) = 0
munmap(0x2aaf0000, 348160) = 0
close(3) = 0

The Loongson's kernel was compiled with a page size of 16KB, whereas the Qube2 uses 4KB. Presently, I'm recompiling my kernel with 4KB pages to see if this fixes the problem. At minimum though, people should be made aware of this limitation in uClibc.
Attached Files

- Relationships

- Notes
(0002354)
redhatter
05-13-07 17:42

Whoops, this was _meant_ for the uClibc project, not buildroot. Can this be reassigned please?
 
(0002355)
bernhardf
05-14-07 00:44

reassigning upon request.
If this report is really about 0.9.27, then i suggest you retry with 0.9.29 or trunk and follow up.
 
(0002356)
redhatter
05-14-07 04:36

It's about 0.9.28, I'm yet to try 0.9.29 (I've been using the ebuilds in the Gentoo portage tree).

I've also just discovered that the Loongson machines won't run with a page size of 4KB, they require a 16KB page size, thus the linker will need to be fixed.

I notice in ldso/ldso/mips/dl-sysdep.h, the following #defines are present:
/* 4096 bytes alignment */
#define PAGE_ALIGN 0xfffff000
#define ADDR_ALIGN 0xfff
#define OFFS_ALIGN 0x7ffff000

I presume these are what need to be tweaked? Has this part changed wildly since 0.9.28?
 
(0003584)
falek
01-29-08 15:15

The buildroot-20080125 kit, which has uClibc 0.9.29, gives the same error with our 64K Linux kernel. So it looks like the problem is still with us in 0.9.29.

RAMDISK: Loading 3960KiB [1 disk] into ram disk... done.
VFS: Mounted root (ext2 filesystem) readonly.
Freeing unused kernel memory: 384k freed
/sbin/initKernel panic - not syncing: Attempted to kill init!
:500: can't map Rebooting in 180 seconds..'/lib/libcrypt.so.0'
/sbin/init:500: can't map '/lib/libcrypt.so.0'
/sbin/init:500: can't map '/lib/libcrypt.so.0'
/sbin/init: can't load library 'libcrypt.so.0'
 

- Issue History
Date Modified Username Field Change
05-13-07 17:40 redhatter New Issue
05-13-07 17:40 redhatter Status new => assigned
05-13-07 17:40 redhatter Assigned To  => buildroot
05-13-07 17:42 redhatter Note Added: 0002354
05-14-07 00:15 jacmet Project buildroot => uClibc
05-14-07 00:44 bernhardf Note Added: 0002355
05-14-07 00:44 bernhardf Assigned To buildroot => uClibc
05-14-07 04:36 redhatter Note Added: 0002356
12-19-07 13:19 alonbl Issue Monitored: alonbl
01-29-08 15:15 falek Note Added: 0003584
01-29-08 15:23 falek Issue Monitored: falek
10-08-08 04:25 bernhardf Summary uClibc fails to mmap shared libraries with CONFIG_PAGE_SIZE_16KB set in kernel => [MIPS] uClibc fails to mmap shared libraries with CONFIG_PAGE_SIZE_16KB set in kernel
10-08-08 04:28 bernhardf Category Architecture Specific => Shared Library Support
10-08-08 04:28 bernhardf Summary [MIPS] uClibc fails to mmap shared libraries with CONFIG_PAGE_SIZE_16KB set in kernel => [MIPS,powerpc] uClibc fails to mmap shared libraries with CONFIG_PAGE_SIZE_16KB set in kernel


Copyright © 2000 - 2006 Mantis Group
Powered by Mantis Bugtracker