From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Po Lu Newsgroups: gmane.emacs.devel Subject: Re: Help with new Windows 98 crash Date: Tue, 06 Dec 2022 20:53:53 +0800 Message-ID: <87r0xcn15q.fsf@yahoo.com> References: <87o7sindcl.fsf.ref@yahoo.com> <87o7sindcl.fsf@yahoo.com> <83ilip9a37.fsf@gnu.org> <838rjl9477.fsf@gnu.org> <87k035nwv3.fsf@yahoo.com> <83wn747mt5.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="939"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Dec 06 13:54:34 2022 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 1p2XT0-000Acc-22 for ged-emacs-devel@m.gmane-mx.org; Tue, 06 Dec 2022 13:54:34 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p2XSi-0006hQ-VB; Tue, 06 Dec 2022 07:54:16 -0500 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 1p2XSh-0006fw-W9 for emacs-devel@gnu.org; Tue, 06 Dec 2022 07:54:16 -0500 Original-Received: from sonic303-21.consmr.mail.ne1.yahoo.com ([66.163.188.147]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p2XSg-0005mP-G7 for emacs-devel@gnu.org; Tue, 06 Dec 2022 07:54:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1670331252; bh=n9m3+tV5S3pA6UlHd4qgMvzvqczmSo2vf0Qs9SeyxUk=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject:Reply-To; b=OsbNwXPDMD9Js0Rlwfrw7Vukqqv8KRJi5nGtxsiMW2bW4sP5QUPz1h4Q+Dy0S205qmJmyj9ji9qPWDtss60+hibVArqsmYNxVxwTU/x5hgEFGAoY27bqX5mZktl5RZxgxKNa2WhbFu0LwFtgMkX/aBseI7PDmZKG228hmgmac1aRPugPE9vffWu3TtgXrDPQ/HjOQwR8hBjKVFLfQm9KJX5bxLossRAC36uU3uqe00/4S7trobEruArgkEwu384BhOcl/v73ngzxlDjTOo1FgbKXS8FBYjgpstfDFwfHSjLtqyVCDuunvuNVP6HmZdmob9PCVtJRcTh9S8DrfS+Fgg== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1670331252; bh=gD9Gwizv5te1lA00TU27KCib0SPPnWW03do43v9/H4s=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=fY6v0OimOUz0FibF49NPYkdzxMCewKwooA2Xa+ryiYliYx9erTfKFvR0OjSugjgKNpW+hFCpmCqBclu6e7dMyrf3OGfgYdL6dHxtIHSshb+QjZzeknmjRaIEJuVMUU2hhpUcayEuce3g0Yu3OvjRqaavb5adFePMR6m1gOeD8GCNwrDOScPh3ZCYChqo2QO+2bdmWStOk+dJLau2vjllUiAFHiACRZMgQb6k9Y6JD66gZDbDkYiqniW18Nhnq3Y9eizQpMPthg8mM/VOvkbGXcqU7ArkJcrj1aHMUPDwCCiayX1ZK+JYNwHo7Zhi++EpKa2Jh7kQxO6it/XUAZKFkA== X-YMail-OSG: oWR8cxkVM1mfspVc4BKUvFanqivkVvAOEs9WJyPV.XdukQgMyqt3O0GG3BfAhQ2 Hh4o9wzms6rkh7RAZ3VGZlx5onqig4aBG7X8nv.hsIXdr9lQOb4AaX_JAHZUwTmk18XMece34SbY zLCg57vH2aintuphFjFEGK7K0zH73FzdD7OZaQcMeCV6LWwz.OI5YoRyOI.eiPYhfpgxa0ejfxrX lrycxq59nHN0cn7qAA1wBXmNwPLykIyUz62atEgMmktSkzyb9mQD7POl2eFYK0.TCUfUomk7Xi2c g8FogVFtvgZDvjkmiwLLXY9VV72WUHmsm5ejKWjdAIT.pj2lmAp0bXmgzSN.8fp59pmBEShW9es7 8jSzuemEmhFkzhptXjxMex1nsaRfpqwqkbblUx3ciIG0YOS1LvRVmVPCMKdtBBTc6sc2rgtycbIX kNAMh4i0hCjTn2UNIndT_ffTIkojilC9yFTQbR0BofLDNXG1LhbkfRYrIPQJY0Xtdb7iuuZMkOrL CRDQtiEi8OcO9PT73Zs9POYNX6433ogptc6WAZHOmjEmqyTwBv8qf.aFe0rCB3QWoGBBgQXeBZzW EZXtL2DdizDl0TrYkWzBoxWKpcH.wPhG4cbZf.6GK5SRVi2OSe30Sde2lFJ9H1GOFTORSbdofxTh V5FJ0pveimnxovWfX0SW1mV85EwVqf8nDlbt0E8TUTHzXSJwUiJGYlOHTOQe7SPnkLbTO7snQhjg gon225H0u6R_O5cgv48BO04YXyay1NM2akOlEcPwC.QrySS0jG52XymeX44xtQlWttZUeY9lfAGd 1.w7DjcxDObd9FEUR55GYpRM6yjd3ljw4W351n062D X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic303.consmr.mail.ne1.yahoo.com with HTTP; Tue, 6 Dec 2022 12:54:12 +0000 Original-Received: by hermes--production-sg3-b666c6484-fp465 (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID cfe18f84b4f454402a9deb5703034f99; Tue, 06 Dec 2022 12:54:07 +0000 (UTC) In-Reply-To: <83wn747mt5.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 06 Dec 2022 14:12:54 +0200") X-Mailer: WebService/1.1.20926 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Received-SPF: pass client-ip=66.163.188.147; envelope-from=luangruo@yahoo.com; helo=sonic303-21.consmr.mail.ne1.yahoo.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=unavailable 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:300964 Archived-At: Eli Zaretskii writes: >> From: Po Lu >> Cc: emacs-devel@gnu.org >> Date: Tue, 06 Dec 2022 09:29:04 +0800 >> >> init_bignum must be called before make_initial_frame, because that >> allocates a bignum in temacs (as set_window_buffer calls >> bset_display_time and Fcurrent_time, which go through the time >> arithmetic stuff), before our own allocator has been set up, which ends >> up in the dumped Emacs, leading to a free of a pointer from the wrong >> heap once the bignum is garbage collected. >> >> I have installed the change on the Emacs 30 branch because I am not sure >> it is safe for Emacs 29. Can you think of a safer fix? > > There's nothing unsafe in what you did, but: > > . the call to init_bignum inside the !initialized block should be > conditioned on HAVE_UNEXEC But doesn't it have to come before init_window_once in any case? Otherwise, the wrong malloc will be used even on pdumper builds. > . the call to init_bignum that is a few lines below that, and outside of > the !initialized condition should be conditioned using HAVE_UNEXEC and > initialized such that we don't invoke this function twice in any case, > whether this is during dumping or not and whether this is a pdumper > build or not Okay, that's fine by me.