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 6281A3858434 for ; Fri, 27 Aug 2021 06:20:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6281A3858434 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 8AA7222326; Fri, 27 Aug 2021 06:20:56 +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 6328913689; Fri, 27 Aug 2021 06:20:56 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap1.suse-dmz.suse.de with ESMTPSA id kRswFkiEKGGJAQAAGKfGzw (envelope-from ); Fri, 27 Aug 2021 06:20:56 +0000 Subject: Re: [PATCH 11/30] Return vector of results from parallel_for_each To: Tom Tromey , gdb-patches@sourceware.org References: <20210826021937.1490292-1-tom@tromey.com> <20210826021937.1490292-12-tom@tromey.com> From: Tom de Vries Message-ID: <8037d3f0-bec2-b55c-e3e0-f4ceea79527c@suse.de> Date: Fri, 27 Aug 2021 08:20:55 +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: <20210826021937.1490292-12-tom@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 06:21:07 -0000 On 8/26/21 4:19 AM, Tom Tromey wrote: > - /* Process all the remaining elements in the main thread. */ > - callback (first, last); > + gdb::detail::par_for_accumulator results (n_threads - 1); This breaks set worker-threads 0: ... $ gcc hello.c -g $ gdb -q -batch -iex "maint set worker-threads 0" a.out -ex "b main" terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc Fatal signal: Aborted ----- Backtrace ----- /home/vries/gdb_versions/devel/gdb[0x6edf36] /lib64/libc.so.6(+0x394a0)[0x7f8522b704a0] /lib64/libc.so.6(gsignal+0x110)[0x7f8522b70420] /lib64/libc.so.6(abort+0x151)[0x7f8522b71a01] /usr/lib64/libstdc++.so.6(+0xa5016)[0x7f85231b0016] /usr/lib64/libstdc++.so.6(+0xb08dc)[0x7f85231bb8dc] /usr/lib64/libstdc++.so.6(+0xb0947)[0x7f85231bb947] /usr/lib64/libstdc++.so.6(+0xb0be9)[0x7f85231bbbe9] /usr/lib64/libstdc++.so.6(_ZSt28__throw_bad_array_new_lengthv+0x0)[0x7f85231b27c7] /home/vries/gdb_versions/devel/gdb[0x878392] /home/vries/gdb_versions/devel/gdb[0x877d69] /home/vries/gdb_versions/devel/gdb[0x8778da] /home/vries/gdb_versions/devel/gdb[0x8774bb] /home/vries/gdb_versions/devel/gdb[0x876d07] /home/vries/gdb_versions/devel/gdb[0x876386] /home/vries/gdb_versions/devel/gdb[0x875c64] /home/vries/gdb_versions/devel/gdb[0x874c6e] /home/vries/gdb_versions/devel/gdb[0x8744a2] /home/vries/gdb_versions/devel/gdb[0x6e1228] /home/vries/gdb_versions/devel/gdb[0x6e13d9] /home/vries/gdb_versions/devel/gdb[0xa528a5] /home/vries/gdb_versions/devel/gdb[0xa52ec2] /home/vries/gdb_versions/devel/gdb[0xa52f8a] /home/vries/gdb_versions/devel/gdb[0xa5345d] /home/vries/gdb_versions/devel/gdb[0xa537d7] Backtrace might be incomplete. --------------------- A fatal error internal to GDB has been detected, further debugging is not possible. GDB will now terminate. ... The abort happens because: ... (gdb) up #14 0x0000000000874c6e in gdb::parallel_for_each >(unsigned int, minimal_symbol *, minimal_symbol *, minimal_symbol_reader::) (n=10, first=0x2493ad0, last=0x2494388, callback=...) at /home/vries/gdb_versions/devel/src/gdb/../gdbsupport/parallel-for.h:159 159 gdb::detail::par_for_accumulator results (n_threads - 1); (gdb) p n_threads $3 = 0 (gdb) p n_threads - 1 $1 = 18446744073709551615 ... I guess this hints at the fact that we don't exercise different values for worker-threads in the testsuite. Thanks, - Tom