From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Pip Cet Newsgroups: gmane.emacs.bugs Subject: bug#41627: 28.0.50; Emacs with cairo build segfault in HELLO file Date: Mon, 1 Jun 2020 18:02:12 +0000 Message-ID: References: <83a71okvdl.fsf@gnu.org> <0ac5574a-3e61-182c-406a-94500b66cca6@163.com> <83v9kcj9uu.fsf@gnu.org> <83sgfeeoc9.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="102489"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 41627@debbugs.gnu.org, all_but_last@163.com To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jun 01 20:03:20 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1jfomJ-000QHd-GL for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 01 Jun 2020 20:03:15 +0200 Original-Received: from localhost ([::1]:40998 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jfomI-0001xH-Ie for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 01 Jun 2020 14:03:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36624) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jfom7-0001x0-8A for bug-gnu-emacs@gnu.org; Mon, 01 Jun 2020 14:03:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53658) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jfom6-0000cK-C0 for bug-gnu-emacs@gnu.org; Mon, 01 Jun 2020 14:03:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jfom6-0003RQ-8h for bug-gnu-emacs@gnu.org; Mon, 01 Jun 2020 14:03:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Pip Cet Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 01 Jun 2020 18:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41627 X-GNU-PR-Package: emacs Original-Received: via spool by 41627-submit@debbugs.gnu.org id=B41627.159103457613216 (code B ref 41627); Mon, 01 Jun 2020 18:03:02 +0000 Original-Received: (at 41627) by debbugs.gnu.org; 1 Jun 2020 18:02:56 +0000 Original-Received: from localhost ([127.0.0.1]:36971 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jfom0-0003R3-0c for submit@debbugs.gnu.org; Mon, 01 Jun 2020 14:02:56 -0400 Original-Received: from mail-oo1-f46.google.com ([209.85.161.46]:34139) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jfoly-0003Qr-D0 for 41627@debbugs.gnu.org; Mon, 01 Jun 2020 14:02:54 -0400 Original-Received: by mail-oo1-f46.google.com with SMTP id v3so1610584oot.1 for <41627@debbugs.gnu.org>; Mon, 01 Jun 2020 11:02:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=xu3KM0kLJTQgG2N4IU92JHUzTMH0C7J51tTlzJI75fg=; b=iZ+3Ee+IFaBuxYHt+JWyq0k1iqYGwaYPs3mhQ59XY0jO3oLvq4op0A8sqaonCMdvsc 3FOGezswyiozy3q59QOViid/CuY1wLVyvZi4XUY5EVGtSdaBODdzYInH1hEQIsvX7hhh SwY3UEsqtbAGzPeiYWH3qWPkr0as3ApRWOgygwey8XrhF/+ehK6AjrDztzzORnyLrT7h s3oWgAduFraGfBxFALkzY42AunTuUwVFqJqSB7tphIfLvWulUC6LX4iPAv2G/F4yDzje uRsBMAcTbWVXPLcQxXQ9ZhMN8a02Z+VNhg+hUISS2mHolEETKFRQwnM84kYUQ7rOTTp4 c7/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=xu3KM0kLJTQgG2N4IU92JHUzTMH0C7J51tTlzJI75fg=; b=lDOlPoqU+jsIwqKwJxPk+vhKJL5IUpiILmNJ0i0ioU3SiQYbcuL/rEK4IA6+cgK9Lc fpevWM6iyjaRmX/fJUNXHZFC6rLg3jkSr98T7RhcMnBcthB1Rsmq6Udib9fzKndcnUZc s1jvxjvMXquoZnpsR2xj5yZ4NHmt6Yz09jx6RP2r0f5fy2SoGlmXASw+J/R7NlMUmmde Vy3oW/IUsq4CwpVIE2B0J4s5RFF0tDUJ5cOz/wD/5p8EMyzOnpqvZ21aQ4SIOzHqdudI u1oNlL5bNTsw/bSDUOD84mUUywDShb3n1mX3ruEq9aXgRTJu/WrcIq81cEXAyYtqihC6 90gQ== X-Gm-Message-State: AOAM533wH6EP0wJYz3TYzuy1e8TSh6DqmJkXroCNFOwpimXmc0Vk5iY7 3Ktjmp/tFuZWngPxUhz4Kg3qeIpjj83kNk++9PM= X-Google-Smtp-Source: ABdhPJxH3I/nr8TY9Qabup7NHDtXJEFFt+dIdJAB4AJ460LDLYhGAlFuXhL15lfRbU7/IQMLyxiENjV4WtI2zS0gC3A= X-Received: by 2002:a4a:94d1:: with SMTP id l17mr2044568ooi.88.1591034568556; Mon, 01 Jun 2020 11:02:48 -0700 (PDT) In-Reply-To: <83sgfeeoc9.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:181360 Archived-At: On Mon, Jun 1, 2020 at 4:35 PM Eli Zaretskii wrote: > > From: Pip Cet > > Date: Sun, 31 May 2020 20:45:56 +0000 > > Cc: Zihao Zhu , 41627@debbugs.gnu.org > > > > > Can someone please propose a patch along these lines? I cannot easily > > > test a Cairo build, so I won't try showing a patch. > > > > How about this? > > LGTM, thanks. I gather that you tested this bail-out, and saw that it > does TRT (probably skipping the problematic font)? Yes, I did, but I'd really like to corrupt some font files and test further. I think there might be more resource leaks there. > > (I'm not sure how and whether `match' is supposed to be freed in the > > success case, or whether it's simply leaked). > > From some code fragments I see on the net, I think you are right, and > we should free it before returning. I tried doing that in the debugger, and there was no immediate segfault, for all that's worth. By now I've downloaded fontconfig... > Btw, there are more calls to cairo_ft_scaled_font_lock_face in our > code followed by unconditional dereference of the result... As I said, "I suspect the attached patch will work, but if this is something Cairo does in other places it needs to be checked." Some initial investigation reveals that yes, Cairo does it all over the place.