From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Pip Cet Newsgroups: gmane.emacs.devel Subject: Re: scratch/igc 90e80a9a53e 6/6: Adjust igc.c code to header changes Date: Sun, 21 Jul 2024 16:20:57 +0000 Message-ID: <5p8jkXALtW4p4ny5SDaTELHeMcDhmaymtiNVusLIQJBqUE9Vpsbyp4Bg_bc19PgWGxP5U3iBgVDnZeYptqz4BrBTcuZgmSwVq_PMiY1Evzg=@protonmail.com> References: <8634o3c98h.fsf@gnu.org> <861q3nc5j7.fsf@gnu.org> <86zfqabz5c.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="b1_hwUsizL0T3mnqx60lWkfG9cn4yLuAk8jMzoSQEehk" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28467"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Jul 21 18:28: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 1sVZPm-0007GV-Q5 for ged-emacs-devel@m.gmane-mx.org; Sun, 21 Jul 2024 18:28:02 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sVZPS-0002kh-8U; Sun, 21 Jul 2024 12:27:45 -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 1sVZJ5-0007M7-3B for emacs-devel@gnu.org; Sun, 21 Jul 2024 12:21:07 -0400 Original-Received: from mail-4316.protonmail.ch ([185.70.43.16]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sVZJ1-0002GU-Fx for emacs-devel@gnu.org; Sun, 21 Jul 2024 12:21:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1721578860; x=1721838060; bh=5JQKPTtYSbcVOV5oq8i0TnUVOTkmREYm9rK8ZGjwvxU=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=MUUovZjOYkaalY7PbO6IN+XrrJj3JQYIS0LI1x9/exvkzfXBkaP9otqtDJEUr0d7J Myn6aXfPz6/BZw7z5gH9fM66Eajt9aILsKk7wjoSVshuLKnBpRHawKpXyOjg1Sh/rs x10BMLlKMz02YeXapQbXFNuNpC+GIpAv8fPHOi6+OMSizsAZ8if3T1uYLLxTkkpreO mM0Ghl1NMW8soNXt0uU0SneEm+NqinE56I+Ur3lIF0J1YPBDlJiMylWWVNaUMAg2Zz huTeegXbzoM0nI7BKwBDbgX6N4aN52nZhgbT1QON7cNN5X0GIW377IF9iSus2u8tBW rU5kQU28Nrp0g== In-Reply-To: <86zfqabz5c.fsf@gnu.org> Feedback-ID: 112775352:user:proton X-Pm-Message-ID: 4cafc9a003ddde1141ad0633f6693c47b105ede2 Received-SPF: pass client-ip=185.70.43.16; envelope-from=pipcet@protonmail.com; helo=mail-4316.protonmail.ch X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sun, 21 Jul 2024 12:27:39 -0400 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:321909 Archived-At: This is a multi-part message in MIME format. --b1_hwUsizL0T3mnqx60lWkfG9cn4yLuAk8jMzoSQEehk Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Sunday, July 21st, 2024 at 14:25, Eli Zaretskii wrote: > > Date: Sun, 21 Jul 2024 14:11:56 +0000 >=20 > > From: Pip Cet pipcet@protonmail.com > > Cc: emacs-devel@gnu.org > >=20 > > > Does the below help? > > >=20 > > > #4 dump_write (ctx=3D0x71ceb38, buf=3D0x71ce848, nbyte=3D8) at pdumpe= r.c:792 > > > 792 dump_write (struct dump_context *ctx, const void *buf, dump_off n= byte) > > > (gdb) p ctx->igc_obj_dumped > > >=20 > > > $1 =3D (void *) 0xc3f000 > >=20 > > Thanks, that helps a lot! It's an internal subr, and those don't store = their proper size in the pseudovector header, so we don't dump them properl= y as we trust the pseudovector header. > >=20 > > I've managed to reproduce something similar here, and the attached patc= h helps, but it probably breaks GC in the !HAVE_MPS case. >=20 >=20 > Why cannot you identify this kind of object during dumping, and avoid > applying whatever igc_dump_finish_obj does? You mean you'd prefer to leave the pseudovector header for builtin subrs at= its current value? We can do that, but I think the MPS header should still= be valid. (It's not with the patch I had attached: that makes it claim an = object size of 112 bytes when it's actually just 96 bytes, and that causes = us to overwrite the first 16 bytes after the last subr; in my case, stdout.= .. Anyway, next patch attached, which duplicates a bit of code unnecessaril= y.) > There's the PVEC_SUBR in the struct, no? Yes, there is. Pip --b1_hwUsizL0T3mnqx60lWkfG9cn4yLuAk8jMzoSQEehk Content-Type: text/x-patch; name=0002-mps-subr.patch Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename=0002-mps-subr.patch ZGlmZiAtLWdpdCBhL3NyYy9pZ2MuYyBiL3NyYy9pZ2MuYwppbmRleCA2OTYwZTUyNjdkMi4uN2Rk MjcxNTIwNGEgMTAwNjQ0Ci0tLSBhL3NyYy9pZ2MuYworKysgYi9zcmMvaWdjLmMKQEAgLTYxOSw2 ICs2MTksMjcgQEAgc2V0X2hlYWRlciAoc3RydWN0IGlnY19oZWFkZXIgKmgsIGVudW0gaWdjX29i al90eXBlIHR5cGUsCiBzdGF0aWMgdW5zaWduZWQgYWxsb2NfaGFzaCAodm9pZCk7CiBzdGF0aWMg c2l6ZV90IGlnY19yb3VuZCAoc2l6ZV90IG5ieXRlcywgc2l6ZV90IGFsaWduKTsKIAorI2RlZmlu ZSBDT01NT05fTVVMVElQTEUoYSwgYikgXAorICAoKGEpICUgKGIpID09IDAgPyAoYSkgOiAoYikg JSAoYSkgPT0gMCA/IChiKSA6IChhKSAqIChiKSkKK2VudW0geyBMSVNQX0FMSUdOTUVOVCA9IGFs aWdub2YgKHVuaW9uIHsgR0NBTElHTkVEX1VOSU9OX01FTUJFUiB9KSB9OworLyogVmVjdG9yIHNp emUgcmVxdWVzdHMgYXJlIGEgbXVsdGlwbGUgb2YgdGhpcy4gICovCitlbnVtIHsgcm91bmR1cF9z aXplID0gQ09NTU9OX01VTFRJUExFIChMSVNQX0FMSUdOTUVOVCwgd29yZF9zaXplKSB9OworLyog Um91bmQgdXAgWCB0byBuZWFyZXN0IG11bHQtb2YtUk9VTkRVUF9TSVpFIC0tLSB1c2UgYXQgY29t cGlsZSB0aW1lLiAgKi8KKyNkZWZpbmUgdnJvdW5kdXBfY3QoeCkgUk9VTkRVUCAoeCwgcm91bmR1 cF9zaXplKQorLyogUm91bmQgdXAgWCB0byBuZWFyZXN0IG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