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 prstack Date: Mon, 20 May 2024 20:21:02 +0200 Message-ID: References: <87o790qsgm.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="33431"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , Emacs Devel To: Helmut Eller Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon May 20 20:22:09 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 1s97eC-0008Sc-Vj for ged-emacs-devel@m.gmane-mx.org; Mon, 20 May 2024 20:22:08 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s97dN-0004dK-9z; Mon, 20 May 2024 14:21:17 -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 1s97dG-0004bz-IH for emacs-devel@gnu.org; Mon, 20 May 2024 14:21:11 -0400 Original-Received: from mail-lf1-x132.google.com ([2a00:1450:4864:20::132]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s97dD-0001b0-Vd; Mon, 20 May 2024 14:21:09 -0400 Original-Received: by mail-lf1-x132.google.com with SMTP id 2adb3069b0e04-51f72a29f13so4351408e87.3; Mon, 20 May 2024 11:21:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716229264; x=1716834064; 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=68PpWW2RYwiFh99FY8Y4qNbXIsSKSUsb6ASihZYyKoY=; b=UJ7fOf/6mk58LU6kpLV6Zlui0hjWywaFADiT5aP42MpVu4/rzLUC/mdsokSDAbDnad iANEjq+2D1xmyJhc3I/VSxW/De/PshW6TW2BLCwtKROQqOvUoAeKnHNvHDuMcH1cCx9j VbUY6uZcaMwnBmubkH3Na11q8E+bLyEVoHvuhW8GKQZ8LavuHTEnNidPJAFEIZAOs0+q jI6pFxeDe37LXI0yw7EXZDZ5JpKh7lJjSii7Lkn9Va5d4ARvMp29j5KE7YGwh+so9atC LDs/EbN4EynU/hV/Xkj7exaD5l5EPedgqn09sCdgWCHI4TYQUma6xa/t5N7SDl1AblSi KHzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716229264; x=1716834064; 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=68PpWW2RYwiFh99FY8Y4qNbXIsSKSUsb6ASihZYyKoY=; b=JG7eldC4z10ua2ZE6do/CbaXf9tP9Yh6FwOVdnojgEDi/QWSU3SFu3CjquAWeyP30r LrbqG2eCjDLofBsLlCujRhTTdJBXFW6oDl52E6Ynvxy+Rl0qApTm6dSs4u+P/BGA0/a/ Lo5/fC74IRkoX02oNqx35HYFDlnoZGVCKxSalFONj0QLwfpsAeKTfF+PaF/vOtyJlAAC PuGt5EpmBR4SmRXN573oaUYj7lkLGDMuiBjsJplEXnDkrIzMd0bBHlEY9aMJU7vL+ekb SoZ/1/trrJLr3MX4XY8l9iZJGM+vVWmaa1RVKpwgCriecw072vjLMy/fTSriygPjzrL5 JJTA== X-Forwarded-Encrypted: i=1; AJvYcCXBZNeNyhZw9L0WwhNTig30HDOHGUXqxvpGScySDote3PMIkOI16ICiegi70MJMNanQtUB6ooSERT4vrTbFY7LlNOrI X-Gm-Message-State: AOJu0YzYW6HocEWECkq6Vfa7/ftKx834rbHgM+aRQc/u+NY1F580g1bq nc7ofJjBku3hNR6XO+HkQlWyQ6jQdNPf9bXgbZxaKodal/+XF3FFg7Y8Dw== X-Google-Smtp-Source: AGHT+IHyM5znGCAJBqGlg+s5YNpCTivEZYlAaduKcrQfxDyM4qJkwPLxYuHddUHUjYFRV87i4jxjRg== X-Received: by 2002:a05:6512:234a:b0:523:b261:3dde with SMTP id 2adb3069b0e04-523b2613eb1mr10859176e87.41.1716229263401; Mon, 20 May 2024 11:21:03 -0700 (PDT) Original-Received: from pro2.fritz.box (pd9e36556.dip0.t-ipconnect.de. [217.227.101.86]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a5a5ecd37a3sm1108890666b.79.2024.05.20.11.21.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 May 2024 11:21:03 -0700 (PDT) In-Reply-To: <87o790qsgm.fsf@gmail.com> (Helmut Eller's message of "Mon, 20 May 2024 19:54:49 +0200") Received-SPF: pass client-ip=2a00:1450:4864:20::132; envelope-from=gerd.moellmann@gmail.com; helo=mail-lf1-x132.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:319431 Archived-At: Helmut Eller writes: > In print.c, there is a global variable prstack that is not yet scanned. > This causes a crash for comp-tests but this example triggers the same > problem: > > (progn > (defun make-tree (i) > (cond ((= i 0) nil) > (t (list (make-string 10000 i) > (make-tree (1- i)) (make-tree (1- i)))))) > (prin1-to-string (make-tree 13))) > > We could create an ambiguous root for this but I thought it would be an > interesting exercise to scan it exactly. It's interesting because this is > a static variable and the type is only declared in print.c. So I added > a new function igc_xpalloc_exact to igc.h. That uses a callback that > calls another callback. I'm not sure if this allowed by the MPS rules > but it seems to work or at least doesn't seem to crash. > > WDYT? LGTM and pushed. Thanks! AFAICT, taking the reference literally, it is permissible to pass the mps_ss_t around. It merely says this type mps_ss_t The type of scan states. A scan state represents the state of the current scan. The MPS passes a scan state to the scan method of an object format when it needs to scan for references within a region of memory. The scan method must pass the scan state to MPS_SCAN_BEGIN and MPS_SCAN_END to delimit a sequence of fix operations, and to the functions MPS_FIX1(), MPS_FIX2() and MPS_FIX12() when fixing a reference. And that we do... And it doesn't crash :-) I've BTW also protected all the user-defined hash test functions in some commit today, which are malloc'd in fns.c. Reason is that these persist beyond the lifetime of hash tables using them, IIUC. Strange thing, somewhat. Whatever :-).