From patchwork Sat Nov 26 12:23:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philippe Waroquiers X-Patchwork-Id: 61121 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B0EB538157FB for ; Sat, 26 Nov 2022 12:24:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B0EB538157FB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1669465475; bh=pZNP08B9zPT4BoHimNIsaQ+rk9Uo27CK8pz1UvJJDiM=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=g7f/l5Mu93qEX8pxGhi/tNuKKPW9zU4MHYB/D9Up6siYWrzXW2jtK2vqJPL1kjw/+ Vc2FlS3bstV02n1FeFHudCsjpBTRR2lc/8BjO0k8HdYVnU40y+fEQXSJJwDh69Hf2r woKW6DqqT3m2L2HhpVrIfG8teRFMpwav22eGcCOs= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from mailsec109.isp.belgacom.be (mailsec109.isp.belgacom.be [195.238.20.105]) by sourceware.org (Postfix) with ESMTPS id 1C1D83899435 for ; Sat, 26 Nov 2022 12:24:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1C1D83899435 X-ExtLoop: 1 X-IPAS-Result: A2BeBAA+BIJj/1uGgG1aHgEBCxIMSYE7C7JPh1YPAQEBAQEBAQEBCUQEAQGFBQKFCCY3Bg4BAgQBAQEBAwIDAQEBAQEBAwEBBgEBAQEBAQYEAYEchS9GgjUig30CAQMyAUYQUVeDFoMjsFOBAYRwmmaBZ4FAAYtThUI3gVVEj38EmRIDCQMHBUlAAwsYDRYyChMyG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dJe4mQJTCW73Ho8BRxjApm8FDB+32f MkIbzdzKh7NC/FKEg5KUMhkzL722xETdRV4hGqMofE7+FTc5xEo6KO2Gubke82VEJA9ckGw4 ziuE37CKh4WPpmHwCaO8n+3rvTIgDnwVZ0bDrD+8eRl6HWLxm0XCQUOWB2kqOO+k1O/VshEA 1cX6ywjse44+SSWosLVDkT++SXY+0dGC58JS7x84Q2Wzu/Y8gDfB3McCDRMbNMvv8gzAzYnv rOUo+7U6fVUmOX9YRqgGn2891te5QB9waQ+iePogOfLDxQPYG3+s/4XcuteLQ== IronPort-HdrOrdr: A9a23:mChgrapybZD84NN/a6Lw5ikaV5r3eYIsimQD101hICG9E/bo7P xG+c5x6faaslgssR0b9Oxoe5PwJU80jKQV3WBJB9eftWrdyQmVxeNZnPPfKlTbckWVygc679 YET0EUMrLN5DZB4foSrzPIdOrIbeP3lpyAlKP19V8oZwdvcqRh5wByBkKgFFFsTgUuP+tbKH PZ3Ls/mwad X-IronPort-Anti-Spam-Filtered: true X-ProximusIPWarmup: true Received: from 91.134-128-109.adsl-dyn.isp.belgacom.be (HELO md.home) ([109.128.134.91]) by relay.proximus.be with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Nov 2022 13:24:08 +0100 To: gdb-patches@sourceware.org Cc: Philippe Waroquiers Subject: [PUSHED 2/2] Fix jump on uninit producer_is_clang bit of cu.h dwarf2_cu struct. Date: Sat, 26 Nov 2022 13:23:58 +0100 Message-Id: <20221126122358.1168620-2-philippe.waroquiers@skynet.be> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221126122358.1168620-1-philippe.waroquiers@skynet.be> References: <20221126122358.1168620-1-philippe.waroquiers@skynet.be> MIME-Version: 1.0 X-Spam-Status: No, score=-12.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Philippe Waroquiers via Gdb-patches From: Philippe Waroquiers Reply-To: Philippe Waroquiers Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" Valgrind reports a "jump on unitialised bit error" when running e.g. gdb.base/macro-source-path.exp (see details below). Fix this by initializing producer_is_clang member variable of dwarf2_cu. Tested on amd64/debian11 and re-running gdb.base/macro-source-path.exp under valgrind. ==2140965== Conditional jump or move depends on uninitialised value(s) ==2140965== at 0x5211F7: dwarf_decode_macro_bytes(dwarf2_per_objfile*, buildsym_compunit*, bfd*, unsigned char const*, unsigned char const*, macro_source_file*, line_header const*, dwarf2_section_info const*, int, int, unsigned int, dwarf2_section_info*, dwarf2_section_info*, gdb::optional, htab*, dwarf2_cu*) (macro.c:676) ==2140965== by 0x52158A: dwarf_decode_macros(dwarf2_per_objfile*, buildsym_compunit*, dwarf2_section_info const*, line_header const*, unsigned int, unsigned int, dwarf2_section_info*, dwarf2_section_info*, gdb::optional, int, dwarf2_cu*) (macro.c:967) ==2140965== by 0x523BC4: dwarf_decode_macros(dwarf2_cu*, unsigned int, int) (read.c:23379) ==2140965== by 0x552AB5: read_file_scope(die_info*, dwarf2_cu*) (read.c:9687) ==2140965== by 0x54F7B2: process_die(die_info*, dwarf2_cu*) (read.c:8660) ==2140965== by 0x5569C7: process_full_comp_unit (read.c:8429) ==2140965== by 0x5569C7: process_queue (read.c:7675) ==2140965== by 0x5569C7: dw2_do_instantiate_symtab (read.c:2063) ==2140965== by 0x5569C7: dw2_instantiate_symtab(dwarf2_per_cu_data*, dwarf2_per_objfile*, bool) (read.c:2085) ==2140965== by 0x55700B: dw2_expand_symtabs_matching_one(dwarf2_per_cu_data*, dwarf2_per_objfile*, gdb::function_view, gdb::function_view) (read.c:3984) ==2140965== by 0x557EA3: cooked_index_functions::expand_symtabs_matching(objfile*, gdb::function_view, lookup_name_info const*, gdb::function_view, gdb::function_view, enum_flags, domain_enum, search_domain) (read.c:18781) ==2140965== by 0x778977: objfile::lookup_symbol(block_enum, char const*, domain_enum) (symfile-debug.c:276) .... ==2140965== Uninitialised value was created by a heap allocation ==2140965== at 0x4839F01: operator new(unsigned long) (vg_replace_malloc.c:434) ==2140965== by 0x533A64: cutu_reader::cutu_reader(dwarf2_per_cu_data*, dwarf2_per_objfile*, abbrev_table*, dwarf2_cu*, bool, abbrev_cache*) (read.c:6264) ==2140965== by 0x5340C2: load_full_comp_unit(dwarf2_per_cu_data*, dwarf2_per_objfile*, dwarf2_cu*, bool, language) (read.c:7729) ==2140965== by 0x548338: load_cu(dwarf2_per_cu_data*, dwarf2_per_objfile*, bool) (read.c:2021) ==2140965== by 0x55634C: dw2_do_instantiate_symtab (read.c:2048) ==2140965== by 0x55634C: dw2_instantiate_symtab(dwarf2_per_cu_data*, dwarf2_per_objfile*, bool) (read.c:2085) ==2140965== by 0x55700B: dw2_expand_symtabs_matching_one(dwarf2_per_cu_data*, dwarf2_per_objfile*, gdb::function_view, gdb::function_view) (read.c:3984) ==2140965== by 0x557EA3: cooked_index_functions::expand_symtabs_matching(objfile*, gdb::function_view, lookup_name_info const*, gdb::function_view, gdb::function_view, enum_flags, domain_enum, search_domain) (read.c:18781) ==2140965== by 0x778977: objfile::lookup_symbol(block_enum, char const*, domain_enum) (symfile-debug.c:276) .... --- gdb/dwarf2/cu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/gdb/dwarf2/cu.c b/gdb/dwarf2/cu.c index e95208e2e75..af95725ebcf 100644 --- a/gdb/dwarf2/cu.c +++ b/gdb/dwarf2/cu.c @@ -39,6 +39,7 @@ dwarf2_cu::dwarf2_cu (dwarf2_per_cu_data *per_cu, producer_is_icc (false), producer_is_icc_lt_14 (false), producer_is_codewarrior (false), + producer_is_clang (false), processing_has_namespace_info (false), load_all_dies (false) {