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: unable to build due to assertion violation in igc_dump_check_object_starts Date: Tue, 23 Jul 2024 18:29:56 +0200 Message-ID: References: <861q3k9sfb.fsf@gnu.org> <86zfq889re.fsf@gnu.org> <86y15s893y.fsf@gnu.org> <86ttgg867k.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="22268"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: pipcet@protonmail.com, eller.helmut@gmail.com, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Jul 23 18:30:37 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 1sWIPN-0005fi-6y for ged-emacs-devel@m.gmane-mx.org; Tue, 23 Jul 2024 18:30:37 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sWIOu-0002Wj-BJ; Tue, 23 Jul 2024 12:30:08 -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 1sWIOq-0002Tb-6M for emacs-devel@gnu.org; Tue, 23 Jul 2024 12:30:04 -0400 Original-Received: from mail-lj1-x22c.google.com ([2a00:1450:4864:20::22c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sWIOn-0007uh-UO; Tue, 23 Jul 2024 12:30:03 -0400 Original-Received: by mail-lj1-x22c.google.com with SMTP id 38308e7fff4ca-2ef27bfd15bso35162731fa.2; Tue, 23 Jul 2024 09:30:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721752198; x=1722356998; 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=Ed2rUszQayjdHBdh2QltQb7HVXs5tdtte8alAi9UhD4=; b=AjPY+koFv2fqhYm7Mjhfgp9jYyk36CGX8bnvwFV3lnfvOjcbD43tHzGASzxvTElerO LkCuygfGDpCHlawJP+nDtqY35Y/e7WkkYFhuNTVPyTFf+z9eZmKEsVfPKuTOLaRZ5oZP JGByIl4sb1cl1d3vnQj8vrv16hSAs1KzDixY+oUzV/zhehEQWrUxjx/ZTG/bQQ1GQirc BWgb53czeal4ozYkOAKe2lPbkD9pG8aZ6kFidHg26V/3sluo/mzw17190z64d5Lb/I2W 6J0giRRAlFgic2Kvc8Nzrz3vWNgofOuqIotGu5kSSjnvNH0s08NGEeUjcpMwYedUgZEl bTqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721752198; x=1722356998; 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=Ed2rUszQayjdHBdh2QltQb7HVXs5tdtte8alAi9UhD4=; b=WP+phYwBvIcOEyyq31mXm4IoizucE8SpxQOeDUFwoZpiTu9HSX61bpklbBZkNuSAE7 vH/bNpHlKb8dtdu57Inm2FvkDcrrABeD4NXmcId5HzHsO5kHbyG7XyQaz2RKKfyw+9e+ ZeFy8U6sLiBbUskmC1Mtgl595bs16e//QbCQ8Chu222eMcL2heWS92g+KkfDS4dc2v6B JblC2zJ+H/JW5npwxou0fQCEK+dtRK1p7fozqx59QaC6CEIIbGzL4MsjkWZr375Yg9Bf 2xGbqAB8THL8lBP9Li9wUcciD7MGAVRHPaC5f92UfQzyGjz+FxhQLGb06iWHsblfEOlJ C/tQ== X-Forwarded-Encrypted: i=1; AJvYcCXhKeaLqFdnoHaDw4WPcS6iURJm4IPXtqWZ1aA5Xo+5pTJbqUHJSBevT37yfjN1sFQvk3xrQ3zsjwYwTideFWD065j5 X-Gm-Message-State: AOJu0YyY3+/HRST5vgxV1UFXrR168n3RJpmyln+IiRKSF2Mr8GPf0Oz+ kqBPY47aTZbIwgy2X3BjDasPcuw7KcI/adoVHI9wHguFux2egWJT6Ajbmw== X-Google-Smtp-Source: AGHT+IFIXDBIh+uQg3idBe23KjKNnCwcAcHikOK9ohvZ6ycLTHF/BwpdSttBwqkp3xN4uGL+RsKoLA== X-Received: by 2002:a2e:8182:0:b0:2ef:2b44:9977 with SMTP id 38308e7fff4ca-2ef2b449a3bmr51104821fa.18.1721752197797; Tue, 23 Jul 2024 09:29:57 -0700 (PDT) Original-Received: from pro2.fritz.box (pd9e3603f.dip0.t-ipconnect.de. [217.227.96.63]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5a30af837e5sm7753367a12.43.2024.07.23.09.29.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jul 2024 09:29:57 -0700 (PDT) In-Reply-To: <86ttgg867k.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 23 Jul 2024 18:43:11 +0300") Received-SPF: pass client-ip=2a00:1450:4864:20::22c; envelope-from=gerd.moellmann@gmail.com; helo=mail-lj1-x22c.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.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, FREEMAIL_REPLY=1, 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:321998 Archived-At: Eli Zaretskii writes: >> From: Gerd M=C3=B6llmann >> Cc: pipcet@protonmail.com, eller.helmut@gmail.com, emacs-devel@gnu.org >> Date: Tue, 23 Jul 2024 16:52:42 +0200 >>=20 >> Could you do >>=20 >> p header_type(start) >>=20 >> please, that should show the IGC_OBJ_xy type of the offending header >>=20 >> p header_nwords(start) >>=20 >> is the, presumably wrong, size in words, but I think we have already >> seen it's too large. > > Compliance! > > (gdb) p header_type(start) > $7 =3D 58 > (gdb) p (enum igc_obj_type)header_type(start) > $8 =3D 58 > (gdb) p IGC_OBJ_NUM_TYPES+0 > $9 =3D 31 > (gdb) p header_nwords(start) > $10 =3D 200437507 So the igc_header is completely kaputt. But we can try to use the value of start_off at the time the assertion is triggered. The list containing the start/end offsets should be created here: static void dump_igc_finish_obj (struct dump_context *ctx) { if (ctx->flags.dump_object_contents) { char *base =3D (char *) ctx->buf + ctx->igc_base_offset; char *end =3D (char *) ctx->buf + ctx->offset; eassert (end > base); char *should_end =3D igc_dump_finish_obj (ctx->igc_obj_dumped, ctx-= >igc_type, base, end); eassert (should_end >=3D end); dump_write_zero (ctx, should_end - end); if (ctx->flags.record_object_starts) dump_push (&ctx->igc_object_starts, list2 (dump_off_to_lisp (ctx->igc_base_offset), dump_off_to_lisp (ctx->offset))); Here ^^^^^^ } ctx->igc_obj_dumped =3D NULL; ctx->igc_type =3D IGC_OBJ_INVALID; ctx->igc_base_offset =3D -1; } # endif // HAVE_MPS If I'm not completely mistaken, start_off when asserting should =3D=3D ctx->igc_base_offset at some point whle dumping. Could you perhaps put a conditional breakpoint there? We could then go up the stack and see which dump_xy function that is. Maybe a short overview what's happening here, as an orientation. In pdumper object dumping happens by first calling dump_start_object, then dumping the fields or whatever that object contains, and finally calling dump_finish_object. For MPS, dump_start_object writes an empty igc_header, and dump_finish_object fills out the igc_header, since we then know the size of the object and so on. It also records the object start/end in ctx->igc_object_starts, which is sort of a remnant from the itmes that the dump was a root, and not in MPS. But the object starts are apparently still helpful.