From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?Gerd_M=C3=B6llmann?= Newsgroups: gmane.emacs.devel Subject: Re: MPS: a random backtrace while toying with gdb Date: Mon, 01 Jul 2024 21:34:18 +0200 Message-ID: References: <87bk3jh8bt.fsf@localhost> <87wmm6rcv1.fsf@gmail.com> <86le2mhhsj.fsf@gnu.org> <875xtqramd.fsf@gmail.com> <86cynyhfsn.fsf@gnu.org> <87v81qp91g.fsf@gmail.com> <86tthafbix.fsf@gnu.org> <87plry6sv3.fsf@localhost> <86le2lfjqv.fsf@gnu.org> <87jzi5ibbe.fsf@localhost> <864j99fg0a.fsf@gnu.org> <87msn18225.fsf@localhost> <86le2ldn2t.fsf@gnu.org> <87h6d97zzm.fsf@localhost> <86frstdlla.fsf@gnu.org> <87ed8d7yy3.fsf@localhost> <86bk3hdkv5.fsf@gnu.org> <87a5j17xpa.fsf@localhost> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23268"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , eller.helmut@gmail.com, pipcet@protonmail.com, emacs-devel@gnu.org To: Ihor Radchenko Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Jul 01 21:35:19 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 1sOMo3-0005pZ-01 for ged-emacs-devel@m.gmane-mx.org; Mon, 01 Jul 2024 21:35:19 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sOMnI-0006KS-Tj; Mon, 01 Jul 2024 15:34:32 -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 1sOMnH-0006Jw-J0 for emacs-devel@gnu.org; Mon, 01 Jul 2024 15:34:31 -0400 Original-Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sOMn9-0007rD-5K; Mon, 01 Jul 2024 15:34:31 -0400 Original-Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-4257d5fc9b7so14389415e9.2; Mon, 01 Jul 2024 12:34:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719862460; x=1720467260; 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=n9yTL1BDdVNZxElrGvV7sOKi5TGRKKpW5gXQovHdSYM=; b=NvldD6z6Q5bjbM7Q51X3DO29AbX3owo94m+QqgDRJy1cfVS2XNKs6Tzzq231JoB4ae AfFU+nyPBIlHabBQXbsKw0EBbYNVdnNK3/UoJEBJFiU8oSjlAP06o7yQFx5Uu/mJNZJk E497FeaLrexlpqsceusBZwWhqxwuME7G2cH1r2HpSMGnX5+O8r/XMTBXMg7QFpFAKmeO 8GCWAG/We4vmoxwV3DCGUbPCJvUj7WQPMrS+vG21VZxeZ6t5w1bkqj7zLhwfDpbjhrzq GzwRlcCJTBl6rnaiU1eJ3K8kRpOFXhXyhOC5XL1fZrMisluDnUGVZXhcKiRwJ5hmAGBU vy3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719862460; x=1720467260; 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=n9yTL1BDdVNZxElrGvV7sOKi5TGRKKpW5gXQovHdSYM=; b=gS/KmsQ7sXUgW4NKW1ry2d7W277FrgsCVdPWA6NiacPdM9VMMFcWpDJr9W2BwV7+Qc C1ekQvnzsISXdSKw+RH8PP8hitemgTR3GLMu/Va4ICS2VnYdIOef8WbulhhaHSnug4Px w5NJs2+dAvrOHTFSWB92BIBB3NNIJ/m4SsPJiv6JjE1g//SmIA+oEhdnX5qw8CRQ8stb X4YJuLMc2t+VBQ2dY+8zY0uDfob+pTGIUKBZFy3yWEueJk7pu24pOW5TThK+Kh8tHP9Q OPUZOgGfzfJ7+pxjYqUXbIpuKmwqpVdtuZbjgUKqD1zu0unRSNSVtGwhtp2G7zxmgMWE S0Ag== X-Forwarded-Encrypted: i=1; AJvYcCUBmJQL7A5nEeoPCttbZ3tIbnA3YKj9X43CT+Xkc/8mkjs1m3LAQRYllac/lhXOHSrRlpTIixBMH5WzbLPdOWOZSqKw X-Gm-Message-State: AOJu0YwTaUq5L19S6G8J7hOeqVceAP51o8/BgnCynCK0zlfVZqXQ2RYM uswgCOEo6aB4D90OtwhImFsT4Q3aTQtr5l2XpnX/xTBJ2MPp9Nr3kN9rvA== X-Google-Smtp-Source: AGHT+IFUhWd8HNWu5IdLH469QKF/wEsndPxKRBfaUCYt9X3aX/LfY4thPxrEKQhvOkKsXahU1jx9TA== X-Received: by 2002:a05:600c:47c7:b0:425:5f73:e2e1 with SMTP id 5b1f17b1804b1-4257a00c088mr57111005e9.22.1719862459941; Mon, 01 Jul 2024 12:34:19 -0700 (PDT) Original-Received: from pro2.fritz.box (p4fe3a7fc.dip0.t-ipconnect.de. [79.227.167.252]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4256b098426sm165069465e9.32.2024.07.01.12.34.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jul 2024 12:34:19 -0700 (PDT) In-Reply-To: <87a5j17xpa.fsf@localhost> (Ihor Radchenko's message of "Mon, 01 Jul 2024 18:51:13 +0000") Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=gerd.moellmann@gmail.com; helo=mail-wm1-x329.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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:321065 Archived-At: Ihor Radchenko writes: > Note that our SIGCHLD signal handler itself does not re-enter malloc > (igc_malloc in our case). It just tries to access the memory arena that > is in transient state (in process of allocation). I think you are missing the read/write barriers that MPS puts on its memory. Consider a single object O. At some point in time, MPS copies O to a new address O', as part of the copying GC algorithm. In O it leaves a "tombstone" which tells where O' is now found. Then it puts a barrier on O, so that any access to O let's MPS fix the reference. (All via functions in igc.c. See dflt_fwd which creates the tombstone.) > I do not see why the same cannot happen with vanilla malloc, unless, of > course, it blocks memory much more granularly, guaranteeing that live > objects are always reachable. I can't follow, but I guess you missed that/why MPS puts barriers on memory, and why it gets invoked because of that, necessarily.