From: Aurelien Jarno <aurelien@aurel32.net>
To: Blue Swirl <blueswir1@hotmail.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [SPARC] Branch condition problems
Date: Thu, 22 Mar 2007 21:56:29 +0100 [thread overview]
Message-ID: <4602ED7D.2000503@aurel32.net> (raw)
In-Reply-To: <BAY143-F24FD3D3E8DBD227F453719FF6B0@phx.gbl>
Blue Swirl a écrit :
> Hi,
>
> I can't reproduce the problem with attached test program. Also the generated
> ops look just fine:
>
[snip]
>
> Can you describe how to reproduce the bug?
>
Well I also have difficulties to reproduce it with a simple program. I
have detected it while trying to build binutils on a Debian unstable
distribution running in QEMU.
The problem occurs when running the configure script of libiberty as a
normal user using fakeroot, using bash as /bin/sh. The last character of
some of the $LINENO variables is wrongly computed. It is computed using
the modulo function from gcc (moddi3) called from fmtumax() called from
itos(). In some very rare conditions (I don't know all of them) a branch
is falsely taken which result in a wrong sign. When added to 0x30, it
results in a wrong character. Some of them like ) or ( are triggering an
error message. I have been able to track the bug up to the branch
instruction followed by a std instruction by directly editing the
assembly code of bash to cancel some tests.
Note that you need to use fakeroot to see the problem, and also that
using gdb workaround the bug. Rebuilding bash with -O0 or -O1
workarounds the problem. Using -g helps to get the function names along
with the assembly code when using objdump
To reproduce it, the best way is to use a Debian unstable distribution
running in QEMU, at run (I can provide an image if you need one):
apt-get install binutils
cd binutils-2.17-3/libiberty
fakeroot ./configure
You will see that some tests fail with a strange error message from
bash. This error is fixed by the patch I posted or by the one you posted.
--
.''`. Aurelien Jarno | GPG: 1024D/F1BCDB73
: :' : Debian developer | Electrical Engineer
`. `' aurel32@debian.org | aurelien@aurel32.net
`- people.debian.org/~aurel32 | www.aurel32.net
next prev parent reply other threads:[~2007-03-22 20:58 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-22 19:29 [Qemu-devel] [SPARC] Branch condition problems Blue Swirl
2007-03-22 20:56 ` Aurelien Jarno [this message]
-- strict thread matches above, loose matches on Subject: below --
2007-03-21 20:06 Blue Swirl
2007-03-21 20:34 ` Aurelien Jarno
2007-03-21 21:31 ` Aurelien Jarno
2007-03-21 12:49 Aurelien Jarno
2007-03-21 18:42 ` Blue Swirl
2007-03-21 19:43 ` Aurelien Jarno
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4602ED7D.2000503@aurel32.net \
--to=aurelien@aurel32.net \
--cc=blueswir1@hotmail.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).