From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Helmut Eller Newsgroups: gmane.emacs.devel Subject: Re: MPS: a random backtrace while toying with gdb Date: Mon, 01 Jul 2024 08:05:13 +0200 Message-ID: <87le2lprza.fsf@gmail.com> References: <87bk3jh8bt.fsf@localhost> <87wmm6rcv1.fsf@gmail.com> <86le2mhhsj.fsf@gnu.org> <875xtqramd.fsf@gmail.com> <86cynyhfsn.fsf@gnu.org> <87v81qp91g.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40134"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , gerd.moellmann@gmail.com, yantar92@posteo.net, emacs-devel@gnu.org To: Pip Cet Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Jul 01 08:06:27 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sOABG-000AFE-Mm for ged-emacs-devel@m.gmane-mx.org; Mon, 01 Jul 2024 08:06:26 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sOAAG-00054T-RS; Mon, 01 Jul 2024 02:05:24 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sOAAE-00053z-Cj for emacs-devel@gnu.org; Mon, 01 Jul 2024 02:05:22 -0400 Original-Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sOAAB-0003ph-FX; Mon, 01 Jul 2024 02:05:22 -0400 Original-Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-4256f102e89so17375145e9.0; Sun, 30 Jun 2024 23:05:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719813914; x=1720418714; darn=gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=8oN/ALO8xcEjtvA5Lecfsqw0UHGoYtWhqOIayFJ98Sk=; b=WAdM10R1zwIkUh4jE0lFUSEdC0JMyOsvXu0P/N0BRzS6JVA01x+PfxBTtPm2vn13sJ QvdwCTFsZjrQMy7sLCTZ8iOGDoxgBXRcD9W1Lb//MGDCcWSU5oelNdrfxausr/WFbi24 wTNTw9wwtaLDNIdhZ26Rf9XOC8HbjG6lCKGN0Q1T/ltyKy4JKaiRBpEc5V8pwaUINQjt uXoMb2l0I9wgqP69ScoJeCIgKYh7sRfsDiMIGH83PPduN13ZH+Afs1OPK3EDlWc4IXSD ChDzzAeC8y5ZMPF0dFeDqgei/pfRErEl95IlM/k6dyjSGNmsMvqxhXkBadf2oNFkLXGH NeVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719813914; x=1720418714; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=8oN/ALO8xcEjtvA5Lecfsqw0UHGoYtWhqOIayFJ98Sk=; b=dXoSuQnYxoRGLvKiGkh0m6jm9mxKhnC4+Rw/H8q2hcLKy6w0i6TPp47UUXYlaiOudA jwNtSfX/sweehpdPDuREpV5yT8yTMaz66V1l/8wOeCFTKXDcgZQNQe8WGN0JllvFM3TN x7bxMZUtfL0TNeNqYJTa0e25XiBUnHMjMX+8Y3/ny82N1kWRWCD22FPPIn7tz0Tdo/Cl IASEYJykTDj8J9Hc9dEv8dwSJJ7Vpfo8bYXFvpFk1hbRNe4TZh7rAdZ5GfWOu9JqSmM5 Xl4EwF9hN9DqCgmBDGGZ1gQkmWRO7W0LSIjzNP/LsD+ElDxehu8JqH8OOlid1Vl0Bg15 GN4A== X-Forwarded-Encrypted: i=1; AJvYcCW42TPlP1ERE97eSYsNT89LpEDfGN/U2LwNzG9HKrO0FsveCThQSzF2Y9I7+j4LHAJ9gw5mC6JRM3Jl1cvjRjpxQuuX X-Gm-Message-State: AOJu0YzadRvBv2pVVg0zTCFHsZrjdsHyQ7tn+W3k41kdfcztJDmTwhvD V55wMRm47lyNSDpYJocWSM+9gOo2LYAgZIkI+jvTtAFmjdUkTpMkFmY4GQ== X-Google-Smtp-Source: AGHT+IErYoOPrcUNR22BggRCNeXROoreOuk7+bzbZgY3yOSydyjQn4IikZz5VF56OwWMwJZ2T6cgoA== X-Received: by 2002:a05:600c:54e7:b0:424:aa41:4c15 with SMTP id 5b1f17b1804b1-4257a0111b5mr30708425e9.22.1719813914290; Sun, 30 Jun 2024 23:05:14 -0700 (PDT) Original-Received: from caladan (dial-187254.pool.broadband44.net. [212.46.187.254]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4256b09a073sm136032025e9.32.2024.06.30.23.05.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 30 Jun 2024 23:05:13 -0700 (PDT) In-Reply-To: (Pip Cet's message of "Sun, 30 Jun 2024 19:25:36 +0000") Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=eller.helmut@gmail.com; helo=mail-wm1-x332.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:320998 Archived-At: On Sun, Jun 30 2024, Pip Cet wrote: > On Sunday, June 30th, 2024 at 18:42, Helmut Eller >> This patch below implements the idea I was thinking about. > > I don't think it's sufficiently careful about modifying C structures > from signal handlers, though. The signal can occur between any two CPU > instructions, and that opens up (rare, but possible) race > conditions. IIUC the consensus is you can set an "int" or "bool" to > true, or write to a self-pipe, but that's about as much as you should > ever do in a signal handler... Hm, indeed that's a problem. Though, probably not as long as enqueue_async_work is used only for SIGCHLD. > As Eli points out, most of our signals don't have arguments, so how > about simply having one flag per signal? Even a global signal flag > would require us to block signals while we clear it. Maybe the safest would be to use a pipe to implement the queue. That would also work from different threads.