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: SIGPROF + SIGCHLD and igc Date: Tue, 24 Dec 2024 09:23:11 +0100 Message-ID: <87ldw55w28.fsf@gmail.com> References: <87o713wwsi.fsf@telefonica.net> <87ldw7fwet.fsf@protonmail.com> <87a5cnfj8t.fsf@protonmail.com> <86seqe4j4f.fsf@gnu.org> <87ttaucub8.fsf@protonmail.com> <87pllicrpi.fsf@protonmail.com> <864j2u442i.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10609"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , pipcet@protonmail.com, ofv@wanadoo.es, emacs-devel@gnu.org, acorallo@gnu.org To: Gerd =?utf-8?Q?M=C3=B6llmann?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Dec 24 09:24:03 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 1tQ0Cx-0002ex-1m for ged-emacs-devel@m.gmane-mx.org; Tue, 24 Dec 2024 09:24:03 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tQ0CI-0005QH-7h; Tue, 24 Dec 2024 03:23:22 -0500 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 1tQ0CD-0005PE-Sy for emacs-devel@gnu.org; Tue, 24 Dec 2024 03:23:19 -0500 Original-Received: from mail-ed1-x52c.google.com ([2a00:1450:4864:20::52c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQ0CC-0007ye-9I; Tue, 24 Dec 2024 03:23:17 -0500 Original-Received: by mail-ed1-x52c.google.com with SMTP id 4fb4d7f45d1cf-5d27243ba8bso9388525a12.2; Tue, 24 Dec 2024 00:23:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1735028593; x=1735633393; darn=gnu.org; h=content-transfer-encoding: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=vi2DVw2rw0yNE0AX8wxrnL9PYDRVmJMzU4HiSdcpWe0=; b=azZkfWeUyz7y6BA94glWEMRh7BbqQcnbaP4QKJnSRB8zsFo6FLRmsk43qJ0GDblsy8 Xjf16nEohTmJGJkcvhlQ3aDoUDEuVSjVFCyP3ppOF+u1TqVRixg8ffxz2I0/588WZdfc lMaTahIAwCxLcMSFxtb+ORdJN6ZJnvEtnmeNUOAX/YdnHxYhL4qjrVepbbPByPDcMzJk A5UlFbSXXQ66ESBWpvWMrq/l9IUUCXInInCebdHlM5R/NFlVlR8Ai8qZzr6UoGPpJfHm WQcp7AVAbCHZrEfkCyrVdetFBvxzYtd0eet4KrppKeG5sasXqK+jgy6r6slIjAEF2CW/ WzRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735028593; x=1735633393; h=content-transfer-encoding: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=vi2DVw2rw0yNE0AX8wxrnL9PYDRVmJMzU4HiSdcpWe0=; b=Qyn/jyS2EcQ4nBD06ciEvO2g8xM/aoxfbQTd846cGhHUxE2VcPNZzGgt9n9in1WuMO sO+4QUfWvlqEUv923o7UfKNhpkkYTg+US1lsRlE/gPclJ9JG/pdbPx1w+KVgCpDboP9F 5SCVyfycN5PjeJpmnJgh/r1t0yqM6f91NSLPs5Tr2kfiXTaeo0hGSvYBoDK5rmSdUs2T g/io+T8+DGktuXwox1XqZEuZ8GQwyUYY1vGIDvleqP35h0pd5HnNtQw0hhGUB+sZdNic eJMkqHXKilnZUwNv9ioO92ruzZ5frauc9LciY3rKGHhl3DDjqxQJ5qLF5kDxgNts8X6f 9ENg== X-Forwarded-Encrypted: i=1; AJvYcCVhxmNmz9UJhrAeW8tHbcolXOW9pWSZf6xlCEXjcznKKwfCIuKliYXxVjPazerlvdzNsT6TXfNL3Q==@gnu.org, AJvYcCXn9QxZ0gMJjQNPNID+g+3IR1Iql+A1b4wb0OYGvs0mZfRRdpWrL70GVaeDk7mBJDh5oQuZ6HX0CtgO/nk=@gnu.org X-Gm-Message-State: AOJu0YzCJDaF3XjavQK2+NqbvyoRbOLp7BcLcVzZ2xZ1ZVjDhmvggRNK X/kuyE5jYgsBVJUb84VgZHvO9K8evA9WNMlEiPOio2p97Sr0Ag9W7YF7tBUn X-Gm-Gg: ASbGnctMNq91udt1+wAd50zJ1aFlDGHthU6F3Ia6fNXWP2tBjthdqHS3b9mEiylqnHC 6tpn+vqG1wJt25meX8+2AokS+JJSM76bQ33G1sCi2GSspH52KZfzsWX0PDnEZ4DXqq95xPrAdqt gdlVGV34X8zomd80FhaVK532XisPbumpCsSgOZG4FPAEcyuauXj5cJAPz/jJ/jB+dpsB/r67PzP BwixWjkxLrowC2wSoziKTOD89TyCjsibyq1AoKECw5wGHme9zzO+Cw= X-Google-Smtp-Source: AGHT+IHTGrby2dMahQLnYF3yvkCT41R2uBm/hP0SESgqEydEdKaz/Dq89hYCl0nAI8ZIwvdLeDtEtQ== X-Received: by 2002:a05:6402:5255:b0:5d4:75b:8ced with SMTP id 4fb4d7f45d1cf-5d81de39845mr13202954a12.32.1735028593216; Tue, 24 Dec 2024 00:23:13 -0800 (PST) Original-Received: from caladan ([31.177.115.143]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5d806fedaf9sm6104830a12.56.2024.12.24.00.23.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 00:23:12 -0800 (PST) In-Reply-To: ("Gerd =?utf-8?Q?M=C3=B6llmann?= =?utf-8?Q?=22's?= message of "Tue, 24 Dec 2024 07:03:53 +0100") Received-SPF: pass client-ip=2a00:1450:4864:20::52c; envelope-from=eller.helmut@gmail.com; helo=mail-ed1-x52c.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:326974 Archived-At: On Tue, Dec 24 2024, Gerd M=C3=B6llmann wrote: [...] > Anyway, what I see here: SIGCHLD doesn't do anything dangerous in the > signal handler. Instead, the occurrence of SIGCHLD is added to a queue > with enqueue_async_work and that's basically it. Wrong branch! enqueue_async_work doesn't exist in master. ISTR that in master it iterates through process-list. Also, Pip said something that the queue is not signal safe, because signals can nest or something like that. Also, Eli didn't like enqueue_async_work much. > My personal summary for SIGPROF + SIGCHLD at this point: > > - I recommend rewriting SIGPROF handling in the way I tried to describe, > possibly using the existing work queue mechanism. Everything else looks > too complicated to me. >=20=20=20 > - Lisp allocation in signal handlers cannot exist because alloc.c is not > reentrant which means we would crash with the old GC. We don't need > anything extra for that in igc. > > - No longer wondering why macOS does not show any problems in that whole > area. The only problem is SIGPROF accessing Lisp objects, and the > memory barrier is not a problem on macOS because it doesn't use > signals. > > Please double-check! I think, SIGIO might cause trouble. But that async IO code in process.c is sooo hard to read. I wonder if it would be simpler with threads, e.g. one thread per Lisp_Process. Helmut