From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: --with-cairo Emacs server crash and fix Date: Tue, 13 Aug 2019 18:00:13 +0300 Message-ID: <83mugdrtz6.fsf@gnu.org> References: <83pnld8imb.fsf@gnu.org> <83v9v2s4kf.fsf@gnu.org> Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="220753"; mail-complaints-to="usenet@blaine.gmane.org" Cc: emacs-devel@gnu.org To: Liam Quinlan Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Aug 13 17:01:24 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hxYId-000vHT-3w for ged-emacs-devel@m.gmane.org; Tue, 13 Aug 2019 17:01:23 +0200 Original-Received: from localhost ([::1]:53134 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hxYIc-0001Ga-4e for ged-emacs-devel@m.gmane.org; Tue, 13 Aug 2019 11:01:22 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44583) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hxYHj-0001D1-Mp for emacs-devel@gnu.org; Tue, 13 Aug 2019 11:00:29 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:39705) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hxYHj-0003gj-A3; Tue, 13 Aug 2019 11:00:27 -0400 Original-Received: from [176.228.60.248] (port=3023 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hxYHi-00044p-8u; Tue, 13 Aug 2019 11:00:27 -0400 In-reply-to: (message from Liam Quinlan on Mon, 12 Aug 2019 22:52:31 -0400) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:239344 Archived-At: > From: Liam Quinlan > Date: Mon, 12 Aug 2019 22:52:31 -0400 > Cc: emacs-devel@gnu.org > > Update: i think I've found the actual proper solution. Alternative patch on offer below; this time by checking for > dynamic bitmaps already in place after finishing the static ones in x_cr_init_fringe. Note that that function also > defines w32_init_fringe if HAVE_NTGUI, so windows is covered. Yes, the idea is correct, but the implementation needed some tweaking, in particular due to w32 doing things a bit differently during startup. See commit c90975f on the master branch. > Trying to be minimal so this example doesn't iterate to over fringe_bitmaps looking for sparse elements, just > begin checking fringe_bitmaps for existing elements at the index following the standard bitmaps leaves off and > continue until the first null. I'm not sure if it's too bold to trust that holes haven't had a chance to arise though. > (perhaps if the server is initially used in console mode and packages get unloaded before a gui client > connects...?). No, we cannot assume there are no holes, you can clearly see in destroy_fringe_bitmap that it leaves holes if the destroyed bitmap is not the last one in the array. So we need to initialize all the user-defined bitmaps whose pointer is not NULL. Btw, there's a simple way of reproducing the problem without any init files and extra packages: emacs -Q -daemon emacsclient SOME-VERSIONED-FILE-UNDER-GIT M-x set variable RET diff-font-lock-prettify RET t RET [modify the file and then save it] C-x v = Before the change I pushed the above would fail to display the vc-diff bitmaps on the fringe (I presume the Cairo build will crash). After the change, the bitmaps are displayed correctly. This happens because diff-mode is loaded before the GUI frame is created, and thus the fringe bitmaps defined by diff-mode during loading are not completely initialized. Thanks.