From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lug-owl.de (lug-owl.de [188.68.32.151]) by sourceware.org (Postfix) with ESMTP id 0EEC23858D34 for ; Sun, 5 Sep 2021 06:40:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0EEC23858D34 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=lug-owl.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=lug-owl.de Received: by lug-owl.de (Postfix, from userid 1001) id A0A1441F0F; Sun, 5 Sep 2021 08:40:35 +0200 (CEST) Date: Sun, 5 Sep 2021 08:40:35 +0200 From: Jan-Benedict Glaw To: gdb@sourceware.org Subject: Array out of bounds Message-ID: <20210905064035.azigz657cpfjonoo@lug-owl.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="mkmhgrux5b3ubfml" Content-Disposition: inline X-Operating-System: Linux chamaeleon 5.8.0-0.bpo.2-amd64 X-gpg-fingerprint: 250D 3BCF 7127 0D8C A444 A961 1DBD 5E75 8399 E1BB X-gpg-key: wwwkeys.de.pgp.net X-Echelon-Enable: howto poison arsenous mail psychological biological nuclear warfare test the bombastical terror of flooding the spy listeners explosion sex drugs and rock'n'roll X-TKUeV: howto poison arsenous mail psychological biological nuclear warfare test the bombastical terror of flooding the spy listeners explosion sex drugs and rock'n'roll X-message-flag: Please send plain text messages only. Do not send HTML emails. Thank you. User-Agent: NeoMutt/20170113 (1.7.2) X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Sep 2021 06:40:37 -0000 --mkmhgrux5b3ubfml Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! As I started with automated building/testing the GNU Toolchain again, I found this when building GDB (make all-gdb) with a fairly recent GCC on a Linux system (PC) when GDB is configured for --target=3Daarch64-linux: [all 2021-09-05 06:26:42] /usr/lib/gcc-snapshot/bin/g++ -x c++ -I. -I. -= I./config -DLOCALEDIR=3D"\"/tmp/gdb-aarch64-linux/share/locale\"" -DHAVE_CO= NFIG_H -I./../include/opcode -I./../readline/readline/.. -I./../zlib -I../b= fd -I./../bfd -I./../include -I../libdecnumber -I./../libdecnumber -I./../= gnulib/import -I../gnulib/import -I./.. -I.. -DTUI=3D1 -I./.. -pthread = -Wall -Wpointer-arith -Wno-unused -Wunused-value -Wunused-variable -Wunuse= d-function -Wno-switch -Wno-char-subscripts -Wempty-body -Wunused-but-set-p= arameter -Wunused-but-set-variable -Wno-sign-compare -Wno-error=3Dmaybe-uni= nitialized -Wno-mismatched-tags -Wsuggest-override -Wimplicit-fallthrough= =3D3 -Wduplicated-cond -Wshadow=3Dlocal -Wdeprecated-copy -Wdeprecated-copy= -dtor -Wredundant-move -Wmissing-declarations -Wstrict-null-sentinel -Wform= at -Wformat-nonliteral -Werror -g -O2 -c -o jit.o -MT jit.o -MMD -MP -MF = =2E/.deps/jit.Tpo jit.c [all 2021-09-05 06:26:53] /usr/lib/gcc-snapshot/bin/g++ -x c++ -I. -I. -= I./config -DLOCALEDIR=3D"\"/tmp/gdb-aarch64-linux/share/locale\"" -DHAVE_CO= NFIG_H -I./../include/opcode -I./../readline/readline/.. -I./../zlib -I../b= fd -I./../bfd -I./../include -I../libdecnumber -I./../libdecnumber -I./../= gnulib/import -I../gnulib/import -I./.. -I.. -DTUI=3D1 -I./.. -pthread = -Wall -Wpointer-arith -Wno-unused -Wunused-value -Wunused-variable -Wunuse= d-function -Wno-switch -Wno-char-subscripts -Wempty-body -Wunused-but-set-p= arameter -Wunused-but-set-variable -Wno-sign-compare -Wno-error=3Dmaybe-uni= nitialized -Wno-mismatched-tags -Wsuggest-override -Wimplicit-fallthrough= =3D3 -Wduplicated-cond -Wshadow=3Dlocal -Wdeprecated-copy -Wdeprecated-copy= -dtor -Wredundant-move -Wmissing-declarations -Wstrict-null-sentinel -Wform= at -Wformat-nonliteral -Werror -g -O2 -c -o language.o -MT language.o -MM= D -MP -MF ./.deps/language.Tpo language.c [all 2021-09-05 06:27:00] In file included from /usr/lib/gcc-snapshot/inclu= de/c++/12/functional:64, [all 2021-09-05 06:27:00] from ./../gdbsupport/ptid.h:35, [all 2021-09-05 06:27:00] from ./../gdbsupport/common-defs= =2Eh:198, [all 2021-09-05 06:27:00] from defs.h:28, [all 2021-09-05 06:27:00] from language.c:31: [all 2021-09-05 06:27:00] In function 'void std::__final_insertion_sort(_Ra= ndomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIte= rator =3D const char**; _Compare =3D __gnu_cxx::__ops::_Iter_comp_iter]', [all 2021-09-05 06:27:00] inlined from 'void std::__sort(_RandomAccessI= terator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator =3D c= onst char**; _Compare =3D __gnu_cxx::__ops::_Iter_comp_iter]' at /usr/lib/gcc-snapshot/include/c++/12/bits/stl_alg= o.h:1960:31, [all 2021-09-05 06:27:00] inlined from 'void std::sort(_RAIter, _RAIter= , _Compare) [with _RAIter =3D const char**; _Compare =3D bool (*)(const cha= r*, const char*)]' at /usr/lib/gcc-snapshot/include/c++/12/bits/stl_algo.h:= 4868:18, [all 2021-09-05 06:27:00] inlined from 'void add_set_language_command()= ' at language.c:517:13, [all 2021-09-05 06:27:00] inlined from 'void _initialize_language()' at= language.c:1203:28: [all 2021-09-05 06:27:00] /usr/lib/gcc-snapshot/include/c++/12/bits/stl_alg= o.h:1869:32: error: array subscript 19 is outside array bounds of 'void [13= 6]' [-Werror=3Darray-bounds] [all 2021-09-05 06:27:00] 1869 | std::__insertion_sort(__first, = __first + int(_S_threshold), __comp); [all 2021-09-05 06:27:00] | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~= ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [all 2021-09-05 06:27:00] In function 'void add_set_language_command()', [all 2021-09-05 06:27:00] inlined from 'void _initialize_language()' at= language.c:1203:28: [all 2021-09-05 06:27:00] language.c:499:78: note: at offset 152 into objec= t of size 136 allocated by 'operator new []' [all 2021-09-05 06:27:00] 499 | language_names =3D new const char *[ARR= AY_SIZE (language_defn::languages) + 2]; [all 2021-09-05 06:27:00] | = ^ [all 2021-09-05 06:27:00] cc1plus: all warnings being treated as errors [all 2021-09-05 06:27:00] make[1]: *** [Makefile:1643: language.o] Error 1 [all 2021-09-05 06:27:00] make[1]: Leaving directory '/var/lib/laminar/run/= gdb-aarch64-linux/8/binutils-gdb/gdb' Thanks, Jan-Benedict --=20 --mkmhgrux5b3ubfml Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQQlDTvPcScNjKREqWEdvV51g5nhuwUCYTRmYAAKCRAdvV51g5nh u+jNAJwLGrf4Rv0iuJEzb6kVsD1LMvTHxgCbBTcSZzwrPVpqlYfbHGBGYZ0wiag= =fLIz -----END PGP SIGNATURE----- --mkmhgrux5b3ubfml--