Bug 1087

Summary: Segfault in sh
Product: Busybox Reporter: Krisztian Kocsis <kocsis>
Component: OtherAssignee: unassigned
Status: RESOLVED FIXED    
Severity: major CC: busybox-cvs, curaga
Priority: P5    
Version: 1.16.x   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Host: i686-unknown-linux-gnu Target:
Build:
Attachments: Proposed patch

Description Krisztian Kocsis 2010-02-15 12:18:41 UTC
The following shell script causes a segfault in sh!

#!/bin/sh

F="/sys/devices/system/cpu/cpu0/online"
echo "$(< $F)"

Output:
sh[517]: segfault at 8 ip 08069dd4 sp bffbdeb4 error 4 in busybox[8048000+6f000]
Segmentation fault

Kernel: 2.6.32.8 on ULV Celeron (Pentium-M)
Comment 1 Lauri Kasanen 2010-02-17 17:32:17 UTC
*** Bug 1099 has been marked as a duplicate of this bug. ***
Comment 2 Lauri Kasanen 2010-02-17 18:00:56 UTC
I bisected this to commit e56f22ac6072a6279782951fe7aaf633d4d6052a - ash: make "jobs" work even in subshells
Comment 3 Leonid 2010-02-20 08:49:44 UTC
Created attachment 1159 [details]
Proposed patch

I observe same behavior with bb 1.15.3 & 1.16.0 on both MIPS & i686 platforms.

Unfortunately, no progress on this bug yet, so I propose my own patch. It fixes problem for me.
Comment 4 Denys Vlasenko 2010-02-21 00:28:04 UTC
Applied to git, thanks!
Comment 5 Denys Vlasenko 2010-02-21 01:01:37 UTC
Fix is at
http://busybox.net/downloads/fixes-1.16.0/busybox-1.16.0-ash.patch