Re: ngircd test suite failure on mips64el

Christoph Biedl <[email protected]>
Newsgroups gmane.linux.debian.ports.mips
Message-ID <[email protected]>
affects 871514 + ngircd
found 871514 7.2.0-1
thanks

James Cowgill wrote...

> On 22/08/17 17:51, Christoph Biedl wrote:

> > Ultimately, after rebuilding on mips64el using -O0 the test suite
> > passes. Although it's usually premature to assume it: This smells like
> > a compiler bug.
>
> This is very likely #871514 in gcc-7. Unfortunately it is affecting a
> lot of packages in the archive at the moment causing incorrect code to
> be generated.

Ouch, I see a huge binNMU job approaching.

> The bug happens if a "small" variable is spilled to the stack. GCC may
> emit a store of the smaller size to the stack, but then load it back as
> a 64-bit integer. The top bits of the register will then contain some
> garbage on the stack and cause comparisons like in your example to fail
> (the bottom bits will be 0 but the top bits won't be).

Thanks for sharing, this seems to be the case indeed:

| ./src/ngircd/irc-mode.c:725
|                         if(!is_oper && !is_machine && !is_owner && !is_admin) {
|    29aa8:       16c00141        bnez    s6,29fb0 <Channel_Mode+0xd58>
|    29aac:       0257102a        slt     v0,s2,s7
| ./src/ngircd/irc-mode.c:725 (discriminator 1)
!    29ab0:       dfa20000        ld      v0,0(sp)
|    29ab4:       1440013e        bnez    v0,29fb0 <Channel_Mode+0xd58>
|    29ab8:       0257102a        slt     v0,s2,s7
| ./src/ngircd/irc-mode.c:725 (discriminator 2)
!    29abc:       dfa20018        ld      v0,24(sp)
|    29ac0:       144000c5        bnez    v0,29dd8 <Channel_Mode+0xb80>
|    29ac4:       0257102a        slt     v0,s2,s7
| ./src/ngircd/irc-mode.c:725 (discriminator 3)
!    29ac8:       dfa20020        ld      v0,32(sp)
|    29acc:       10400465        beqz    v0,2ac64 <Channel_Mode+0x1a0c>

The type of the four variables is "bool", so it's certainly something
smaller.

    Christoph
signature.asc (application/pgp-signature, 819 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBCgAGBQJZnHYxAAoJEMQsWOtZFJL9KjMP/3447x66ogWozbUZrWnUQi5E
KjnfxmCdCkY6Nzxb+tqAGfzKIKLMM31LgmArbh9yM44oxwilGUDtLEkFzxP/k4tY
BMwtsPF1U2xLSSPzv7FOeJKNw1n0oJ3XMQfvveUVx7Vgzoaou+9OM6wNenL9FUr2
v6aoEl2x4WbVG76XAHhZ1dL0zsJyLoAoRZTMbO6qEcWqhgKe4WzC2QZZg8pKl6Jb
8tY59bxhZs33+zxkOcqrFW1gjM07iagah31BYt9Ip37UVQQl0aYVHnhHiFCieRc2
zG4o3Amy6X1SbWJg8r7GsBpRPb0JRTKqSyBMyciQxUFYjqhZ9If7UXuOk6AfOUNX
llGsmHofgxognW/MUyOLbFcVeIWuSoNL/CuUjbgFpM2hLesG25Xhb4STpZ8ERqdZ
AtVwYbwJ1hvRMX+yIgrp/LQ0bRWFC+A/r0LBBDMFlnyNjQQAVlgMtfeEXR6l9/L6
ocn8w1YPiRLORp44h6Biqo5jgw3P2IXUVeS3XSb88dWFFnfpFgAGn5qn09vDDNqE
BIqPfx4VC+qqrM531ScqXMHk3PrdYVBlay9AOqaQxjBVWGr0S+idllrOd6nOvbrC
Mjuo2yevriAt/kCETk8qsg5xuJNPLAZeb5x0lVLrye3QSWl86pRd6UyVywZEip22
BJ1b9X/KuNrlGUO2XP8p
=xCEI
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.