Bug 820097 - s390x: wc: : No such file or directory
s390x: wc: : No such file or directory
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: busybox (Show other bugs)
6.3
s390x Linux
high Severity high
: beta
: ---
Assigned To: Denys Vlasenko
qe-baseos-daemons
:
: 1010929 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-05-09 03:18 EDT by Jan Stancek
Modified: 2013-11-21 19:17 EST (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-11-21 19:17:08 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jan Stancek 2012-05-09 03:18:37 EDT
Description of problem:
busybox command 'wc' fails on s390x when redirecting stdin:
# echo "asdf" | busybox wc -l
wc: : No such file or directory

The code from wc_main (wc.c) does:
    *--argv = (char *) bb_msg_standard_input;

which after disassembly (objdump or gdb) gives:
0000000080099f58 <wc_main>:
...
    80099fd4:   e3 a0 af f8 ff 71       lay     %r10,-8(%r10)
    80099fda:   c0 20 00 02 35 87       larl    %r2,800e0ae8 <bb_msg_invalid_arg+0x1d>

The address of "bb_msg_standard_input" is not even:
800e0ae9: <bb_msg_standard_input>

The problems appears to be in alignment of "bb_msg_standard_input". 
# define ALIGN1 __attribute__((aligned(1)))
const char bb_msg_standard_input[] ALIGN1 = "standard input";

larl instruction can generate only even addresses. The address, which is used (800e0ae8) is the end of bb_msg_invalid_arg, which is "\0".

Version-Release number of selected component (if applicable):
RHEL6.3-20120507.n.1
busybox-1.15.1-15.el6.s390x

How reproducible:
100%

Steps to Reproduce:
1. echo "asdf" > test
2a. busybox wc -l < test
or
2b. echo "asdf" | busybox wc -l
  
Actual results:
wc: : No such file or directory

Expected results:
1

Additional info:
Bug 812816 - network dump on s390x got failure

From z/Architecture Principles of Operation SA22-7832-07:
"Only even addresses (halfword addresses) can
be generated. If an odd address is desired,
LOAD ADDRESS can be used to add one to an
address formed by LOAD ADDRESS RELATIVE
LONG."
Comment 2 Denys Vlasenko 2012-08-15 09:23:41 EDT
I know how to fix this. I need ACKs.
Comment 4 RHEL Product and Program Management 2012-09-07 01:36:25 EDT
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated
in the current release, Red Hat is unable to address this
request at this time.

Red Hat invites you to ask your support representative to
propose this request, if appropriate, in the next release of
Red Hat Enterprise Linux.
Comment 9 Denys Vlasenko 2013-09-09 14:03:50 EDT
New build, with the fix included:

https://brewweb.devel.redhat.com/buildinfo?buildID=293887
Comment 12 Hendrik Brueckner 2013-10-22 04:28:53 EDT
*** Bug 1010929 has been marked as a duplicate of this bug. ***
Comment 13 errata-xmlrpc 2013-11-21 19:17:08 EST
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHSA-2013-1732.html

Note You need to log in before you can comment on or make changes to this bug.