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
0002454 [uClibc] Architecture Specific major always 03-06-08 04:12 10-16-08 07:47
Reporter Joe Lin View Status public  
Assigned To uClibc
Priority normal Resolution unable to reproduce  
Status closed   Product Version 0.9.28.1
Summary 0002454: Fixing ARM EABI support bug in syscall()
Description When making an EABI syscall() system call, the library does not correctly pass requesting system number to the Linux kernel.

For example, the ping facility in Busybox will issue a syscall() to get monotonic time (see monotonic_us() in libbb/time.c). The syscall() in syscall-eabi.S passes R7 value verbatim. But the kernel (see linux's vector_swi routine in arch/arm/kernel/entry-common.S) expects R7 a number without __NR_SYSCALL_BASE.

This bug caused a Segmentation Fault.

Below is the patch.

--------------------------------------------------------------
diff -Naurd uClibc-0.9.29/libc/sysdeps/linux/arm/syscall-eabi.S uClibc-0.9.29-p1/libc/sysdeps/linux/arm/syscall-eabi.S
--- uClibc-0.9.29/libc/sysdeps/linux/arm/syscall-eabi.S 2006-02-11 12:29:52.000000000 +0800
+++ uClibc-0.9.29-p1/libc/sysdeps/linux/arm/syscall-eabi.S 2008-03-06 19:53:15.000000000 +0800
@@ -29,7 +29,7 @@
 syscall:
        mov ip, sp
        stmfd sp!, {r4, r5, r6, r7}
- mov r7, r0
+ sub r7, r0, #SYS_SYSCALL_BASE
        mov r0, r1
        mov r1, r2
        mov r2, r3
--------------------------------------------------------------
Additional Information
Attached Files

- Relationships

- Notes
(0006484)
khem
04-09-08 00:07

is your kernel compiled with AEABI ?
Are you compiling uclibc also with EABI turned on in toolchain ?
 
(0006504)
Joe Lin
04-09-08 19:22

Yes, I compiled both kernel and uClibc with EABI turned on. If uClibc was compiled in OABI, it would go through different path in kernel, which got no problem. If kernel was not compiled to process EABI executables, EABI programs would not work.
 
(0006554)
khem
04-10-08 19:12

I do not get segmentation fault on using busybox applet ping.
 
(0006604)
Joe Lin
04-13-08 18:39

No segmentation fault? My code runs with the patch ok, which means it should get the fault if without the patch.

I'll take a time to review the exact point of problem using my hardware ICE. For now I just can't remember where the instruction is in the arch/arm/kernel/entry-common.S. Will report the point then.
 
(0012664)
bernhardf
10-03-08 08:04

Any update?
 
(0013234)
khem
10-11-08 02:33

ping works fine on EABI system running kernel 2.6.25 and latest uClibc SVN. So I am closing this issue as we can not reproduce it. If there is more information to reproduce this problem feel free to reopen it.
 
(0013714)
bernhardf
10-16-08 07:47

This is closed, so close it.
 

- Issue History
Date Modified Username Field Change
03-06-08 04:12 Joe Lin New Issue
03-06-08 04:12 Joe Lin Status new => assigned
03-06-08 04:12 Joe Lin Assigned To  => uClibc
04-09-08 00:07 khem Note Added: 0006484
04-09-08 19:22 Joe Lin Note Added: 0006504
04-10-08 19:12 khem Note Added: 0006554
04-13-08 18:39 Joe Lin Note Added: 0006604
10-03-08 08:04 bernhardf Note Added: 0012664
10-11-08 02:33 khem Status assigned => resolved
10-11-08 02:33 khem Fixed in Version  => 0.9.30
10-11-08 02:33 khem Resolution open => unable to reproduce
10-11-08 02:33 khem Note Added: 0013234
10-16-08 07:47 bernhardf Status resolved => closed
10-16-08 07:47 bernhardf Note Added: 0013714


Copyright © 2000 - 2006 Mantis Group
Powered by Mantis Bugtracker