Bug 1087 - Segfault in sh
Summary: Segfault in sh
Status: RESOLVED FIXED
Alias: None
Product: Busybox
Classification: Unclassified
Component: Other (show other bugs)
Version: 1.16.x
Hardware: PC Linux
: P5 major
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
: 1099 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-02-15 12:18 UTC by Krisztian Kocsis
Modified: 2010-02-21 01:01 UTC (History)
2 users (show)

See Also:
Host: i686-unknown-linux-gnu
Target:
Build:


Attachments
Proposed patch (931 bytes, patch)
2010-02-20 08:49 UTC, Leonid
Details

Note You need to log in before you can comment on or make changes to this bug.
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