From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2a07:de40:b251:101:10:150:64:2]) by sourceware.org (Postfix) with ESMTPS id 25E493858295 for ; Wed, 29 Nov 2023 21:33:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 25E493858295 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 25E493858295 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a07:de40:b251:101:10:150:64:2 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701293635; cv=none; b=qJzxJwSymlAIAO+NrlQQJbiqX0pcJiIo0nLR3hTd9vKBiyHv1MATQMF4vBQ+YK0vsG0yc2ovVEpvVBmjOd/1/0REdvJhqdjOO80FHOpXVNeTzwXq6JaHGh+4SjtMM+97p0ZWoS+ODzoEU/I54z/9l3FUuuomPFEQjSzx8IGBciE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701293635; c=relaxed/simple; bh=Hw6qbH9ONBfuIgi+c0NcKKwfABrdLuguQG/DFfI0T0Y=; h=DKIM-Signature:DKIM-Signature:Message-ID:Date:MIME-Version: Subject:To:From; b=IK8vTLMMofUCU5Ze3vOT0j/Rg+QAihDo7I0EsMRuyFYclbPPNts7OpZhLouMfcrZAEIzYtwQ7niehCoqPU7pM3JhMf7ulU/Drqpmb+lQGqzLyTdCFtcVikU6jm8VT89rJw9L7dIxnUL7JUsA+hYY9pZIDbzqEoYA9UC+T/ZSSQo= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id F3EA61F892; Wed, 29 Nov 2023 21:33:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1701293633; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HlwAaDd+0fKXazyTftYc+gRCjqJRSMvxLQriP0QiEnE=; b=Ov6KYysJCg4xDnLs7Ah0SulmBYjNtV5JueJuiLSvM8BLs1+0PqFTCTFGmYk0Oz3xtacCzP 5cZ0JrIScIVWHG8EbB/fMVaR3+y8TD5FlZYzb/Iw+Z6OylsYgdGq11aaHxG44KkV62WEqq HG6qPqn94lpleTheMkaUm7XE5i+dpDY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1701293633; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HlwAaDd+0fKXazyTftYc+gRCjqJRSMvxLQriP0QiEnE=; b=s9q15lMdY8S2mork+UYxGEPvezoKsAlOX1PxQBCVFXrgQS5QAnKrApETltvuFh+mHlkx4f 7MrIE5jy/MTUuYBA== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id D24AE13637; Wed, 29 Nov 2023 21:33:52 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id vrQ+MUCuZ2UgTwAAD6G6ig (envelope-from ); Wed, 29 Nov 2023 21:33:52 +0000 Message-ID: <19719c3b-c617-4da6-b270-ea1757931a96@suse.de> Date: Wed, 29 Nov 2023 22:33:50 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] [gdb] Fix assert in delete_breakpoint Content-Language: en-US To: Tom Tromey , Simon Marchi Cc: gdb-patches@sourceware.org References: <20231113152609.32726-1-tdevries@suse.de> <601592c1-4e19-42c8-bfd7-5671ef951ab3@simark.ca> <114c9994-ed81-4a14-bcc3-bd8086e46340@simark.ca> <7794354b-0b08-48f2-8cde-499787b5850c@suse.de> <4f0b3108-0601-421a-9c6b-9c1a79ae1c17@suse.de> <8653ed15-aaf7-4734-b673-5ec6f15cd4c1@simark.ca> <87v89ldhec.fsf@tromey.com> From: Tom de Vries In-Reply-To: <87v89ldhec.fsf@tromey.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Authentication-Results: smtp-out2.suse.de; none X-Spam-Level: X-Spam-Score: -1.10 X-Spamd-Result: default: False [-1.10 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; XM_UA_NO_VERSION(0.01)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; NEURAL_HAM_LONG(-1.00)[-1.000]; BAYES_HAM(-0.01)[50.15%]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[] X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 11/28/23 16:30, Tom Tromey wrote: >>>>>> "Simon" == Simon Marchi writes: > > Simon> On the other hand, I suspect that any memory read / write used to > Simon> implement GDB's internal logic should be considered by default unsafe to > Simon> interrupt. Otherwise, that code should be written in a way that ensures > Simon> that should exceptions get thrown, the internal state is left in a > Simon> coherent... state, either by rolling back changes or otherwise. That > Simon> sounds difficult, if not impossible. > > Maybe I don't understand the context or something, because this seems > like a pretty big departure from historical practice. In gdb, > exceptions can happen nearly anywhere and code must ordinarily be > exception-safe. > > In this situation I think the issue is that some code was not, in a > subtle way. > The problem is that the function delete_breakpoint is first interrupted by a forced_quit (triggered by a SIGTERM), and then called again during the cleanup that happens while handling the forced_quit. So, should we: - suppress the force_quit during delete_breakpoint, to make sure it finishes and won't be called again? - make delete_breakpoint handle being called twice? This seems to be the current strategy, which is broken but can be fixed using is_linked. - make sure delete_breakpoint bails out early if it's called the second time, by adding a SCOPE_EXIT { bpt->type = bp_none }? I'm not sure which approach is better. Thanks, - Tom > Simon> The question is, how to decide where QUITs should be suppressed. Here's > Simon> a random backtrace I just grabbed from a maybe_quit call under an > Simon> update_global_location_list call: > > The danger with suppressing these quits is that then gdb can enter > uninterruptible states if something bad happens to the remote. That > seems unfortunate. At least assuming I understand correctly. > > Tom