qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [SPARC] Branch condition problems


From: Aurelien Jarno
Subject: Re: [Qemu-devel] [SPARC] Branch condition problems
Date: Thu, 22 Mar 2007 21:56:29 +0100
User-agent: IceDove 1.5.0.9 (X11/20061220)

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
 `. `'   address@hidden         | address@hidden
   `-    people.debian.org/~aurel32 | www.aurel32.net




reply via email to

[Prev in Thread] Current Thread [Next in Thread]