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: 31.0.50; Emacs scratch/igc 6682d0e6c96 Crash on Linux, wayland Date: Wed, 04 Sep 2024 17:15:26 +0200 Message-ID: <871q1z4fht.fsf@gmail.com> References: <87y148h7of.fsf@gmail.com> <87ed5z7d1v.fsf@protonmail.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="40915"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eval EXEC , emacs-devel@gnu.org To: Pip Cet Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Sep 04 17:16:18 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 1slrk2-000AWL-DG for ged-emacs-devel@m.gmane-mx.org; Wed, 04 Sep 2024 17:16:18 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1slrjj-0007dR-20; Wed, 04 Sep 2024 11:15:59 -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 1slrjM-0007YK-H8 for emacs-devel@gnu.org; Wed, 04 Sep 2024 11:15:45 -0400 Original-Received: from mail-ej1-x632.google.com ([2a00:1450:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1slrjK-0001MN-Gq for emacs-devel@gnu.org; Wed, 04 Sep 2024 11:15:36 -0400 Original-Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-a86e9db75b9so750024266b.1 for ; Wed, 04 Sep 2024 08:15:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725462928; x=1726067728; 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=1jSN24f4Aas+zAq4oQoFfsvc6qWtBCb0Tw3U6XKTv7s=; b=QhmsbaKo57YaljqdPqBmW/h6ul/Lb14sP1KhKnlO7ubOrXpL+JH3KkmN7glvs+ck9S y/yElAHCcnetpKoPC+ey3X4Y+97c2F03C5vN1aNUw9eAKAhUgQ3JVMw+UyiOPKOzeaFA Ih2aWjieadCZWb0cwnnvU6w7w07RV1HMKrhsnKoBbhbofnRrfgX9SYIgRdoJpPjGge8N 4cFVGMfT3QPATp3BTYk7E0PorOP9Bg69IvIx9ikLamXR3giYobIIlqKqkxHjuVFa5lJI ZicM2DagbxC77j04GR53euCwC6Z344pGyNCPQ1bC/211ULU4KUjvWDrAMHrTNpU56u/u 0IEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725462928; x=1726067728; 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=1jSN24f4Aas+zAq4oQoFfsvc6qWtBCb0Tw3U6XKTv7s=; b=SmfTfuokExsX0PSR9uLncDT9QGQvktWZBFiM6n1muVWfwDglcndRBZ1LFBLo0LthKt WQF8xOJjHR9X+BBdOs+zxYgppx8uUcUC2z5vA6pFaXtkYknqMHDJQKi+1WIC8CVL4Nf3 cGagP7fdzmKmdo/KwujZh7Z2djZJY82abWY4AZScPbqVWX66yMlncgfS+aLpERZIjNuL O6e6JRZrmIPpCicDU06yhyaeq09GBqngkgGctoj4W37Uyt76OmitCeTk8l2uB3gWgZT7 2GZYqlb8+fXzD/FH4o4pJJPFQPHvz0nsymlfhyaf2XA+I2U/gGROH0b9hK5p88k8SnTh V22A== X-Forwarded-Encrypted: i=1; AJvYcCWNbVgxR24heWgahysrce5CUqAe4+VG+bn5A9/1DnUHN8pS0/hQKCoOrDPS3Pdavxfh/kRIo/ji+49Djw==@gnu.org X-Gm-Message-State: AOJu0Ywn5SG+HCHB9HBP53WsGXs9Y+sFhsGvLrqcrtaj4ct/fKv5Vn+V PU/Dj66ie3df0z6s3P/f5NbzUXUUpO7YReLuN0OONZDQtB+fuhazDk6pvA== X-Google-Smtp-Source: AGHT+IFn6pWVkg2FN7UtlzeCiV75tLYAvXHKvbT8fiQ9pZ3t4P3lerAS5vyiIS6hs6+mivVnc1C9xQ== X-Received: by 2002:a17:907:944c:b0:a89:d1cd:1936 with SMTP id a640c23a62f3a-a8a1d29ba5emr718340466b.3.1725462928218; Wed, 04 Sep 2024 08:15:28 -0700 (PDT) Original-Received: from caladan ([31.177.117.133]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a8a623c393asm3385166b.187.2024.09.04.08.15.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Sep 2024 08:15:27 -0700 (PDT) In-Reply-To: <87ed5z7d1v.fsf@protonmail.com> (Pip Cet's message of "Wed, 04 Sep 2024 13:40:02 +0000") Received-SPF: pass client-ip=2a00:1450:4864:20::632; envelope-from=eller.helmut@gmail.com; helo=mail-ej1-x632.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, T_SCC_BODY_TEXT_LINE=-0.01 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:323367 Archived-At: On Wed, Sep 04 2024, Pip Cet wrote: >> #0 0x00000000006dfe09 in record_backtrace.lto_priv () >> #1 0x00000000006e03df in deliver_profiler_signal () >> #2 >> #3 0x00000000007dea30 in sigHandle () >> #4 > > That looks like the SIGPROF hit at a very bad time, after sigHandle was > called but before it had time to lock the arena, which would have > stopped the profiler handler from accessing memory. If sigHandle hasn't acquired the lock, then accessing memory by the profiler should trigger another SIGSEGV and a nested call to sigHandle should then be able to acquire the lock. Looking at the code of ArenaAccess, it seems that there are two locks involved: a global lock and an arena lock. And igc_busy_p only checks the arena lock. Hmm. > Helmut, do you have any ideas? I think it would work, if we could check the global lock instead for the arena lock. Unfortunately, MPS offers no public function for that. > Maybe we'll have to add SIGPROF to the > SIGSEGV sa_mask after all and explicitly unblock it in the handler after > setting a "just count this" flag? That would probably also work.