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

Bug#782391: marked as done (g++-4.9: false-positive -Warray-bounds apprently due to wrong integer-range inference)



Your message dated Tue, 20 Sep 2016 22:15:11 +0000
with message-id <[🔎] E1bmTJn-0005QY-0D@franck.debian.org>
and subject line Bug#838316: Removed package(s) from unstable
has caused the Debian Bug report #782391,
regarding g++-4.9: false-positive -Warray-bounds apprently due to wrong integer-range inference
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
782391: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=782391
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: g++-4.9
Version: 4.9.2-10
Severity: normal

This warning can be seen while compiling skaakii-1.0.0 on several
architectures (looks like it includes some 64bit archs, plus sparc).
It does not appear with g++-4.8.

https://qa.debian.org/bls/packages/s/sjaakii.html
http://buildd.debian.org/status/fetch.php?pkg=sjaakii&arch=arm64&ver=1.0.0-1&stamp=1427152943

| SjaakII-1.0.0$ g++-4.8    -g -O2 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2  -O3 -finline -Wall -Wextra -Wno-unused -DSJAAKIIVERSION=\""1.0.0"\" -DDATADIR=\"/usr/share/games/sjaakii/\" -DHAVE_READLINE -I/work/yann/deb/sjaak/SjaakII-1.0.0/include -I/work/yann/deb/sjaak/SjaakII-1.0.0/obj-x86_64-linux-gnu/include    -o obj-x86_64-linux-gnu/CMakeFiles/sjaakii.dir/src/xboard.o -c /work/yann/deb/sjaak/SjaakII-1.0.0/src/xboard.cc
| 
| SjaakII-1.0.0$ g++-4.9    -g -O2 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2  -O3 -finline -Wall -Wextra -Wno-unused -DSJAAKIIVERSION=\""1.0.0"\" -DDATADIR=\"/usr/share/games/sjaakii/\" -DHAVE_READLINE -I/work/yann/deb/sjaak/SjaakII-1.0.0/include -I/work/yann/deb/sjaak/SjaakII-1.0.0/obj-x86_64-linux-gnu/include    -o obj-x86_64-linux-gnu/CMakeFiles/sjaakii.dir/src/xboard.o -c /work/yann/deb/sjaak/SjaakII-1.0.0/src/xboard.cc
| In file included from /work/yann/deb/sjaak/SjaakII-1.0.0/include/sjaak.h:4:0,
|                  from /work/yann/deb/sjaak/SjaakII-1.0.0/src/xboard.cc:27:
| /work/yann/deb/sjaak/SjaakII-1.0.0/include/bitboard.h: In function ‘game_t* create_capablanca_game(const char*)’:
| /work/yann/deb/sjaak/SjaakII-1.0.0/include/bitboard.h:478:65: warning: array subscript is above array bounds [-Warray-bounds]
|                 board_between[square][attack] |= square_bitboards[pack_rank_file(n, file)];
|                                                                  ^
| /work/yann/deb/sjaak/SjaakII-1.0.0/include/bitboard.h:478:65: warning: array subscript is above array bounds [-Warray-bounds]
| /work/yann/deb/sjaak/SjaakII-1.0.0/include/bitboard.h:478:65: warning: array subscript is above array bounds [-Warray-bounds]
| 
| SjaakII-1.0.0$


Sorry for the lack of a minimal testcase.  What I've been able to
gather till now, is that we have 2 similar cases, with only one
triggering the warning:

473: for (int n=file;n<=unpack_file(attack);n++)
474:  board_between[square][attack] |= square_bitboards[pack_rank_file(rank, n)];

477: for (int n=rank;n<=unpack_rank(attack);n++)
478:  board_between[square][attack] |= square_bitboards[pack_rank_file(n, file)];

... and that the above-bound alert is linked to the infered values for
the loop range.  Whereas this ensures there is no warning:

| static inline int unpack_file(int packed)
| {
|    return packed_file_rank[packed] & 0xf;
| }

... this does not:

| static inline int unpack_rank(int packed)
| {
|    return packed_file_rank[packed] >> 4;
| }

Changing the latter to "return (packed_file_rank[packed] >> 4) &
0xf;", which should show no difference because packed_file_rank is an
uint8_t[], does indeed silence the warning, which seems to show that
the range of that return value was wrongly infered.


-- System Information:
Debian Release: 8.0
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (500, 'stable'), (101, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.16.0-4-amd64 (SMP w/4 CPU cores)
Locale: LANG=C, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Init: systemd (via /run/systemd/system)

Versions of packages g++-4.9 depends on:
ii  gcc-4.9            4.9.2-10
ii  gcc-4.9-base       4.9.2-10
ii  libc6              2.19-17
ii  libcloog-isl4      0.18.2-1+b2
ii  libgmp10           2:6.0.0+dfsg-6
ii  libisl10           0.12.2-2
ii  libmpc3            1.0.2-1
ii  libmpfr4           3.1.2-2
ii  libstdc++-4.9-dev  4.9.2-10
ii  zlib1g             1:1.2.8.dfsg-2+b1

g++-4.9 recommends no packages.

Versions of packages g++-4.9 suggests:
ii  g++-4.9-multilib    4.9.2-10
ii  gcc-4.9-doc         4.9.1-3
pn  libstdc++6-4.9-dbg  <none>

-- no debconf information

--- End Message ---
--- Begin Message ---
Version: 4.9.4-2+rm

Dear submitter,

as the package gcc-4.9 has just been removed from the Debian archive
unstable we hereby close the associated bug reports.  We are sorry
that we couldn't deal with your issue properly.

For details on the removal, please see https://bugs.debian.org/838316

The version of this package that was in Debian prior to this removal
can still be found using http://snapshot.debian.org/.

This message was generated automatically; if you believe that there is
a problem with it please contact the archive administrators by mailing
ftpmaster@ftp-master.debian.org.

Debian distribution maintenance software
pp.
Chris Lamb (the ftpmaster behind the curtain)

--- End Message ---

Reply to: