busybox sed core dump
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
eglibc (Fedora) |
Fix Released
|
High
|
|||
eglibc (Ubuntu) |
Fix Released
|
Low
|
Matthias Klose | ||
Lucid |
Fix Released
|
Undecided
|
Unassigned | ||
Maverick |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: busybox-static
$ echo "a" | busybox sed -e 's,a,b,'
Illegal instruction (core dumped)
$ busybox --help | grep ^Busy
BusyBox v1.15.3 (Ubuntu 1:1.15.3-1ubuntu1) multi-call binary
$ dpkg -S `which busybox`
busybox-static: /bin/busybox
$ dpkg-query --show busybox-static
busybox-static 1:1.15.3-1ubuntu1
I believe this is a problem due to running in xen on ec2. Below is the backtrace from gdb.
#0 0x0806db7d in __strspn_sse42 ()
#1 0x0813a2bb in add_cmd (cmdstr=0x81926c8 "s/a/B/") at editors/sed.c:511
#2 0x0813a71a in add_cmd_block (cmdstr=0x81926c8 "s/a/B/")
at editors/sed.c:1241
#3 0x0813b249 in sed_main (argc=4, argv=0xbffff214) at editors/sed.c:1298
#4 0x080e7297 in run_applet_
at libbb/appletlib
#5 0x080e72b8 in run_applet_and_exit (name=0xbffff36a "sed", argv=0xbffff208)
at libbb/appletlib
#6 0x080e749b in busybox_main (name=<value optimized out>, argv=0xbffff208)
at libbb/appletlib
#7 run_applet_and_exit (name=<value optimized out>, argv=0xbffff208)
at libbb/appletlib
#8 0x080e7504 in main (argc=5, argv=0xbffff204) at libbb/appletlib
It is moderately annoying, because there is noclean way to really replace busybox-static with busybox , because ubuntu-standard depends on busybox. 'busybox' does not have this problem.
ProblemType: Bug
DistroRelease: Ubuntu 10.10
Package: busybox-static 1:1.15.3-1ubuntu1
ProcVersionSign
Uname: Linux 2.6.35-14-virtual i686
Architecture: i386
Date: Tue Aug 10 16:59:00 2010
Ec2AMI: ami-eaa64c83
Ec2AMIManifest: ubuntu-
Ec2Availability
Ec2InstanceType: m1.small
Ec2Kernel: aki-407d9529
Ec2Ramdisk: unavailable
ProcEnviron:
PATH=(custom, user)
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: busybox
description: | updated |
Changed in eglibc (Ubuntu): | |
importance: | Undecided → Low |
status: | New → Triaged |
Changed in eglibc (Ubuntu Lucid): | |
status: | New → In Progress |
Changed in eglibc (Ubuntu Maverick): | |
status: | New → In Progress |
Changed in eglibc (Ubuntu): | |
assignee: | nobody → Matthias Klose (doko) |
Changed in eglibc (Fedora): | |
importance: | Unknown → High |
status: | Unknown → Fix Released |
Description of problem:
compiling a minimal test application statically using gcc, the call strspn() causes a SIGILL. Prints "Illegal instruction" on the command line.
Changing "char var[]" to "char *var" for strtext and cset causes the problem to decrease from always occuring despite optimization level to occuring only during -O0.
Does not occur for dynamically linked application.
Version-Release number of selected component (if applicable):
glibc-static-2.12-3
How reproducible:
Every time.
Steps to Reproduce:
1. Compile main.c below (strspn test) with "gcc main.c -g -static -O0 -o testapp.bin"
2. Run ./testapp.bin
3. Run gdb ./testapp.bin
Actual results:
When ran from the command line, output is "Illegal instruction"
When ran from the debugger, output is
Program received signal SIGILL, Illegal instruction.
0x08052f5d in __strspn_sse42 ()
Expected results:
Prints-"The length of initial number is 3."
Additional info: main.c# ####### ####
#######
#include <stdio.h>
#include <string.h>
int main (int argc, char *argv[]){
char strtext[] = "129th";
char cset[] = "1234567890";
int i;
i = strspn( strtext, cset );
printf ( "The length of initial number is %d.\n", i );
return 0; ####### ####### ####
}
#######