From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id BD7CC3857433 for ; Fri, 27 Aug 2021 07:31:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BD7CC3857433 Received: from imap1.suse-dmz.suse.de (imap1.suse-dmz.suse.de [192.168.254.73]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id EC98722131; Fri, 27 Aug 2021 07:31:21 +0000 (UTC) Received: from imap1.suse-dmz.suse.de (imap1.suse-dmz.suse.de [192.168.254.73]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap1.suse-dmz.suse.de (Postfix) with ESMTPS id D52A1136DE; Fri, 27 Aug 2021 07:31:21 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap1.suse-dmz.suse.de with ESMTPSA id BqvkMsmUKGGMDgAAGKfGzw (envelope-from ); Fri, 27 Aug 2021 07:31:21 +0000 Subject: Re: [PATCH 00/30] Rewrite the DWARF "partial" reader To: Tom Tromey Cc: gdb-patches@sourceware.org References: <20210826021937.1490292-1-tom@tromey.com> <554345a9-ad2c-845e-9179-320a6967b07d@suse.de> <87lf4nlws2.fsf@tromey.com> From: Tom de Vries Message-ID: Date: Fri, 27 Aug 2021 09:31:21 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: <87lf4nlws2.fsf@tromey.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, SPF_HELO_NONE, 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-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-List-Received-Date: Fri, 27 Aug 2021 07:31:33 -0000 On 8/26/21 11:29 PM, Tom Tromey wrote: > These all pass for me: > > Tom> ERROR: Couldn't load cpexprs-debug-types into GDB (eof). > > # of expected passes 393 > This fails intermittently for me, so that could indeed be a thread-safety bug (using worker_threads=1/unlimited): ... $ total=100; worker_threads=1; pass=0; for n in $(seq 1 $total); do gdb -q -batch -iex "maint set worker-threads $worker_threads" ./outputs/gdb.cp/cpexprs-debug-types/cpexprs-debug-types >LOG 2>ERR; if [ $? -eq 0 ]; then pass=$(($pass + 1)); fi; done; echo "PASS: $pass/$total" PASS: 100/100 $ total=100; worker_threads=unlimited; pass=0; for n in $(seq 1 $total); do gdb -q -batch -iex "maint set worker-threads $worker_threads" ./outputs/gdb.cp/cpexprs-debug-types/cpexprs-debug-types >LOG 2>ERR; if [ $? -eq 0 ]; then pass=$(($pass + 1)); fi; done; echo "PASS: $pass/$total" PASS: 62/100 ... The run above is with gcc-7, using gcc-11 I ran twice and got "PASS: 96/100" and "PASS: 100/100". So, perhaps less likely to fail with newer gcc? > Tom> FAIL: gdb.dwarf2/dw2-using-debug-str.exp: file dw2-using-debug-str > > # of expected passes 3 > This fails reliably for me, with gcc-7 - gcc-11. I think basically the problem is that we get: ... (gdb) file /home/vries/gdb_versions/devel/build/gdb/testsuite/outputs/gdb.dwarf2/dw2-using-debug-str/dw2-using-debug-str-no-debug-str^M Reading symbols from /home/vries/gdb_versions/devel/build/gdb/testsuite/outputs/gdb.dwarf2/dw2-using-debug-str/dw2-using-debug-str-no-debug-str...^M Dwarf Error: DW_FORM_strp used without required section^M Dwarf Error: DW_FORM_strp used without required section^M Dwarf Error: DW_FORM_strp used without required section^M Dwarf Error: DW_FORM_strp used without required section^M Dwarf Error: DW_FORM_strp used without required section^M Dwarf Error: DW_FORM_strp used without required section^M (gdb) FAIL: gdb.dwarf2/dw2-using-debug-str.exp: file dw2-using-debug-str ... while the test-case expects just one dwarf error. I don't know whether that should be solved by only emitting one dwarf error, or updating the test-case. I don't understand though why you don't see this. Is the threading somehow not activated in that test-case? Or is this some timing issue where the first dwarf error cancels the other threads before they get to emit the other dwarf errors? > Tom> FAIL: gdb.dwarf2/fission-multi-cu.exp: ptype func > Tom> FAIL: gdb.dwarf2/fission-multi-cu.exp: break func > Tom> FAIL: gdb.dwarf2/fission-multi-cu.exp: continue to func > Tom> FAIL: gdb.dwarf2/fission-multi-cu.exp: frame in func > > # of expected passes 6 This fails intermittently for me, so that could indeed be a thread-safety bug (using worker_threads=1/unlimited): ... $ total=100; worker_threads=1; pass=0; for n in $(seq 1 $total); do gdb -q -batch -iex "maint set worker-threads $worker_threads" outputs/gdb.dwarf2/fission-multi-cu/fission-multi-cu -ex "ptype func" >LOG 2>ERR; if grep -q 'type = int (int)' LOG; then pass=$(($pass + 1)); fi; done; echo "PASS: $pass/$total" PASS: 100/100 $ total=100; worker_threads=unlimited; pass=0; for n in $(seq 1 $total); do gdb -q -batch -iex "maint set worker-threads $worker_threads" outputs/gdb.dwarf2/fission-multi-cu/fission-multi-cu -ex "ptype func" >LOG 2>ERR; if grep -q 'type = int (int)' LOG; then pass=$(($pass + 1)); fi; done; echo "PASS: $pass/$total" *** Error in `/home/vries/gdb_versions/devel/gdb': malloc(): memory corruption: 0x00007fe544009790 *** *** Error in `/home/vries/gdb_versions/devel/gdb': free(): invalid pointer: 0x00007fe544000994 *** PASS: 95/100 ... The run above is with gcc-7, with gcc-11 I got: "PASS: 97/100" and "PASS: 95/100", so that's pretty similar. Thanks, - Tom > > > Maybe it's compiler dependent? > Or perhaps some kind of thread-safety bug. > > Tom >