From unknown Mon Aug 18 11:27:42 2025 X-Loop: help-debbugs@gnu.org Subject: bug#38774: crash in image_pix_context_get_pixel Resent-From: Madhu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 28 Dec 2019 14:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 38774 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 38774@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.15775445847391 (code B ref -1); Sat, 28 Dec 2019 14:50:02 +0000 Received: (at submit) by debbugs.gnu.org; 28 Dec 2019 14:49:44 +0000 Received: from localhost ([127.0.0.1]:58052 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ilDPT-0001v8-M6 for submit@debbugs.gnu.org; Sat, 28 Dec 2019 09:49:44 -0500 Received: from lists.gnu.org ([209.51.188.17]:33114) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ilDPR-0001v0-M9 for submit@debbugs.gnu.org; Sat, 28 Dec 2019 09:49:42 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:50564) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ilDPQ-0005tc-6G for bug-gnu-emacs@gnu.org; Sat, 28 Dec 2019 09:49:41 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: **** X-Spam-Status: No, score=4.9 required=5.0 tests=BAYES_50, RCVD_IN_PBL, RDNS_NONE, URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ilDPO-000855-Kr for bug-gnu-emacs@gnu.org; Sat, 28 Dec 2019 09:49:39 -0500 Received: from [117.208.207.175] (port=40870 helo=localhost.localdomain) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ilDPN-0007mv-QA for bug-gnu-emacs@gnu.org; Sat, 28 Dec 2019 09:49:38 -0500 Received: (qmail 8669 invoked by uid 500); 28 Dec 2019 14:27:06 -0000 From: Madhu Date: Sat, 28 Dec 2019 19:57:06 +0530 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] [fuzzy] X-Received-From: 117.208.207.175 X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) Recent emacs configured with configure -C --without-all --with-xml2 --with-dbus --with-m17n-flt --with-libotf --with-xft --with-x-toolkit=athena --with-toolkit-scroll-bars --with-xaw3d --with-cairo --with-harfbuzz --with-png crashes on startup. The backtrace is Starting program: /7/gtk/emacs/build-xt-debug/src/emacs -Q [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". delete terminal 0xa4b720 called Program received signal SIGSEGV, Segmentation fault. 0x00000000005bf574 in image_pix_context_get_pixel (y=, x=0, image=0xb3a210) at /7/gtk/emacs/src/image.c:183 (gdb) back #0 0x00000000005bf574 in image_pix_context_get_pixel (y=, x=0, image=0xb3a210) at /7/gtk/emacs/src/image.c:183 #1 image_pix_context_get_pixel (image=0xb3a210, x=0, y=) at /7/gtk/emacs/src/image.c:180 #2 0x00000000005bf65c in four_corners_best (pimg=0xb3a210, corners=corners@entry=0xde108c, width=2, height=24) at /7/gtk/emacs/src/image.c:1334 #3 0x00000000005c2dfc in image_background (img=0xde1020, f=0xb0e9c0, pimg=, pimg@entry=0x0) at /7/gtk/emacs/src/image.c:1374 #4 0x00000000004c8c9b in x_setup_relief_colors (s=s@entry=0x7fffffffbaa0) at /7/gtk/emacs/src/xterm.c:2746 #5 0x00000000004c8e09 in x_draw_glyph_string_box (s=s@entry=0x7fffffffbaa0) at /7/gtk/emacs/src/xterm.c:3029 #6 0x00000000004c9c98 in x_draw_glyph_string (s=0x7fffffffbaa0) at /7/gtk/emacs/src/xterm.c:3970 #7 0x000000000045d045 in draw_glyphs (w=0xbfd670, x=, row=0xc9d960, area=TEXT_AREA, start=, end=, hl=, overlaps=) at /7/gtk/emacs/src/xdisp.c:28490 #8 0x0000000000462731 in gui_write_glyphs (w=0xbfd670, updated_row=, start=, updated_area=TEXT_AREA, len=13) at /7/gtk/emacs/src/xdisp.c:30517 #9 0x000000000041d843 in update_text_area (vpos=0, updated_row=0xc9d960, w=0xbfd670) at /7/gtk/emacs/src/dispnew.c:3832 #10 update_window_line (w=w@entry=0xbfd670, vpos=vpos@entry=0, mouse_face_overwritten_p=mouse_face_overwritten_p@entry=0x7fffffffc33f) at /7/gtk/emacs/src/dispnew.c:4075 #11 0x0000000000422099 in update_window (w=w@entry=0xbfd670, force_p=, force_p@entry=true) at /7/gtk/emacs/src/dispnew.c:3604 #12 0x00000000004238ae in update_frame (f=f@entry=0xb0e9c0, force_p=, force_p@entry=false, inhibit_hairy_id_p=inhibit_hairy_id_p@entry=false) at /7/gtk/emacs/src/dispnew.c:3206 #13 0x0000000000457f65 in redisplay_internal () at /7/gtk/emacs/src/xdisp.c:15702 #14 0x00000000004f45d7 in read_char (commandflag=1, map=XIL(0xad0d63), prev_event=XIL(0), used_mouse_menu=0x7fffffffdd8b, end_time=0x0) at /7/gtk/emacs/src/keyboard.c:2488 #15 0x00000000004f6eee in read_key_sequence (keybuf=, prompt=XIL(0), dont_downcase_last=, can_return_switch_frame=true, fix_current_buffer=true, prevent_redisplay=) at /7/gtk/emacs/src/keyboard.c:9538 #16 0x00000000004f856e in command_loop_1 () at /7/gtk/emacs/src/lisp.h:1047 #17 0x000000000055bf57 in internal_condition_case ( bfun=bfun@entry=0x4f8390 , handlers=handlers@entry=XIL(0x90), hfun=hfun@entry=0x4ef690 ) at /7/gtk/emacs/src/eval.c:1355 #18 0x00000000004ea44c in command_loop_2 (ignore=ignore@entry=XIL(0)) at /7/gtk/emacs/src/lisp.h:1047 #19 0x000000000055beb1 in internal_catch (tag=tag@entry=XIL(0xcc60), func=func@entry=0x4ea430 , arg=arg@entry=XIL(0)) at /7/gtk/emacs/src/eval.c:1116 #20 0x00000000004ea3f4 in command_loop () at /7/gtk/emacs/src/lisp.h:1047 #21 0x00000000004ef2a6 in recursive_edit_1 () at /7/gtk/emacs/src/keyboard.c:714 #22 0x00000000004ef5d0 in Frecursive_edit () at /7/gtk/emacs/src/keyboard.c:786 #23 0x000000000041aa71 in main (argc=2, argv=) at /7/gtk/emacs/src/emacs.c:2078 Lisp Backtrace: "redisplay_internal (C function)" (0x0) (gdb) p image->data 0x0 With emacs -nw (which doesn't crash) the following details are printed: In GNU Emacs 28.0.50 (build 2, x86_64-pc-linux-gnu, X toolkit, cairo version 1.\ 16.0, Xaw3d scroll bars) of 2019-12-28 built on leonis4 [BTW Composing main Info directory...done user-error: Info file emacs does not exist ;; What nonsense! Of course it exists! in /7/gtk/emacs/info/emacs.info ] Configured features: XAW3D PNG CAIRO DBUS LIBXML2 FREETYPE HARFBUZZ M17N_FLT LIBOTF TOOLKIT_SCROLL_BARS LUCID X11 XDBE XIM PDUMPER GMP Now I had this same crash on master a few weeks ago even before the emacs-28 branch (when compiled with gtk instead of xt - the crash happened on a emacs -Q -f gnus in that case) The information in this bug report may not be enough as it may depend on the versions of the graphics libraries. I will be glad to supply the info if it is needed. From unknown Mon Aug 18 11:27:42 2025 X-Loop: help-debbugs@gnu.org Subject: bug#38774: crash in image_pix_context_get_pixel Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 28 Dec 2019 17:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 38774 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Madhu Cc: 38774@debbugs.gnu.org Received: via spool by 38774-submit@debbugs.gnu.org id=B38774.157755364121844 (code B ref 38774); Sat, 28 Dec 2019 17:21:02 +0000 Received: (at 38774) by debbugs.gnu.org; 28 Dec 2019 17:20:41 +0000 Received: from localhost ([127.0.0.1]:58851 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ilFlY-0005gG-VJ for submit@debbugs.gnu.org; Sat, 28 Dec 2019 12:20:41 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35944) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ilFlW-0005g3-VF for 38774@debbugs.gnu.org; Sat, 28 Dec 2019 12:20:39 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:36062) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ilFlR-0006wf-H8; Sat, 28 Dec 2019 12:20:33 -0500 Received: from [176.228.60.248] (port=2768 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ilFlH-0000ij-RY; Sat, 28 Dec 2019 12:20:31 -0500 Date: Sat, 28 Dec 2019 19:20:21 +0200 Message-Id: <83o8vsnz8q.fsf@gnu.org> From: Eli Zaretskii In-reply-to: (message from Madhu on Sat, 28 Dec 2019 19:57:06 +0530) References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Madhu > Date: Sat, 28 Dec 2019 19:57:06 +0530 > > Recent emacs configured with > > configure -C --without-all --with-xml2 --with-dbus --with-m17n-flt > --with-libotf --with-xft --with-x-toolkit=athena > --with-toolkit-scroll-bars --with-xaw3d --with-cairo --with-harfbuzz > --with-png > > crashes on startup. Thanks. Assuming that you sync with the Git repository from time to time, what was the last development version that worked for you? Was that version configured the same? Did you update your system's libraries since the last time Emacs worked? > Program received signal SIGSEGV, Segmentation fault. > 0x00000000005bf574 in image_pix_context_get_pixel (y=, x=0, > image=0xb3a210) at /7/gtk/emacs/src/image.c:183 Please show the contents of the 'image' argument, like this: (gdb) p *image And btw, why are the arguments shown in reverse order? The signature of image_pix_context_get_pixel is this: image_pix_context_get_pixel (Emacs_Pix_Context image, int x, int y) And also: #0 0x00000000005bf574 in image_pix_context_get_pixel (y=, x=0, image=0xb3a210) at /7/gtk/emacs/src/image.c:183 #1 image_pix_context_get_pixel (image=0xb3a210, x=0, y=) at /7/gtk/emacs/src/image.c:180 This claims that image_pix_context_get_pixel calls itself on line 180 of image.c, which is false. I guess the optimized build makes the backtrace corrupted. Can you build Emacs without optimizations and show the backtrace in that build? (Assuming the crash doesn't disappear if you do that.) > [BTW > Composing main Info directory...done > user-error: Info file emacs does not exist > ;; What nonsense! Of course it exists! in /7/gtk/emacs/info/emacs.info > ] Why did you assume Emacs will know to look in that directory? From unknown Mon Aug 18 11:27:42 2025 X-Loop: help-debbugs@gnu.org Subject: bug#38774: crash in image_pix_context_get_pixel Resent-From: mituharu@math.s.chiba-u.ac.jp Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 29 Dec 2019 12:53:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 38774 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: "Madhu" Cc: 38774@debbugs.gnu.org Received: via spool by 38774-submit@debbugs.gnu.org id=B38774.157762394410791 (code B ref 38774); Sun, 29 Dec 2019 12:53:01 +0000 Received: (at 38774) by debbugs.gnu.org; 29 Dec 2019 12:52:24 +0000 Received: from localhost ([127.0.0.1]:59341 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ilY3U-0002nz-4G for submit@debbugs.gnu.org; Sun, 29 Dec 2019 07:52:24 -0500 Received: from mathmail.math.s.chiba-u.ac.jp ([133.82.132.2]:50718) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ilY3R-0002no-92 for 38774@debbugs.gnu.org; Sun, 29 Dec 2019 07:52:23 -0500 Received: from weber.math.s.chiba-u.ac.jp (weber [192.168.32.4]) by mathmail.math.s.chiba-u.ac.jp (Postfix) with ESMTP id 29DCBF08D5; Sun, 29 Dec 2019 21:52:19 +0900 (JST) (envelope-from mituharu@math.s.chiba-u.ac.jp) Received: from 153.216.236.73 (SquirrelMail authenticated user mituharu) by weber.math.s.chiba-u.ac.jp with HTTP; Sun, 29 Dec 2019 21:52:19 +0900 Message-ID: In-Reply-To: References: Date: Sun, 29 Dec 2019 21:52:19 +0900 From: mituharu@math.s.chiba-u.ac.jp User-Agent: SquirrelMail/1.4.22-5.el6 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-2022-jp Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > > Recent emacs configured with > > configure -C --without-all --with-xml2 --with-dbus --with-m17n-flt > --with-libotf --with-xft --with-x-toolkit=athena > --with-toolkit-scroll-bars --with-xaw3d --with-cairo --with-harfbuzz > --with-png > > crashes on startup Could you try the patch below? YAMAMOTO Mitsuharu mituharu@math.s.chiba-u.ac.jp diff --git a/src/image.c b/src/image.c index fc90c5ea74..7172bfc810 100644 --- a/src/image.c +++ b/src/image.c @@ -1242,6 +1242,10 @@ prepare_image_for_display (struct frame *f, struct image *img) if (img->cr_data == NULL || (cairo_pattern_get_type (img->cr_data) != CAIRO_PATTERN_TYPE_SURFACE)) { + /* Fill in the background/background_transparent field while + we have img->pixmap->data/img->mask->data. */ + IMAGE_BACKGROUND (img, f, img->pixmap); + IMAGE_BACKGROUND_TRANSPARENT (img, f, img->mask); cr_put_image_to_cr_data (img); if (img->cr_data == NULL) { From unknown Mon Aug 18 11:27:42 2025 X-Loop: help-debbugs@gnu.org Subject: bug#38774: crash in image_pix_context_get_pixel Resent-From: mituharu@math.s.chiba-u.ac.jp Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 30 Dec 2019 06:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 38774 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: "Madhu" , 38774@debbugs.gnu.org Received: via spool by 38774-submit@debbugs.gnu.org id=B38774.15776862479242 (code B ref 38774); Mon, 30 Dec 2019 06:11:02 +0000 Received: (at 38774) by debbugs.gnu.org; 30 Dec 2019 06:10:47 +0000 Received: from localhost ([127.0.0.1]:60459 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iloGM-0002P0-SR for submit@debbugs.gnu.org; Mon, 30 Dec 2019 01:10:47 -0500 Received: from mathmail.math.s.chiba-u.ac.jp ([133.82.132.2]:50454) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iloGK-0002N2-9e for 38774@debbugs.gnu.org; Mon, 30 Dec 2019 01:10:45 -0500 Received: from weber.math.s.chiba-u.ac.jp (weber [192.168.32.4]) by mathmail.math.s.chiba-u.ac.jp (Postfix) with ESMTP id 3D7F5F08D5; Mon, 30 Dec 2019 15:10:40 +0900 (JST) (envelope-from mituharu@math.s.chiba-u.ac.jp) Received: from 153.216.236.73 (SquirrelMail authenticated user mituharu) by weber.math.s.chiba-u.ac.jp with HTTP; Mon, 30 Dec 2019 15:10:40 +0900 Message-ID: <393824cdb46651a2b3b9128ca3683c1e.squirrel@weber.math.s.chiba-u.ac.jp> In-Reply-To: References: Date: Mon, 30 Dec 2019 15:10:40 +0900 From: mituharu@math.s.chiba-u.ac.jp User-Agent: SquirrelMail/1.4.22-5.el6 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-2022-jp Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >> >> Recent emacs configured with >> >> configure -C --without-all --with-xml2 --with-dbus --with-m17n-flt >> --with-libotf --with-xft --with-x-toolkit=athena >> --with-toolkit-scroll-bars --with-xaw3d --with-cairo --with-harfbuzz >> --with-png >> >> crashes on startup > > Could you try the patch below? > > YAMAMOTO Mitsuharu > mituharu@math.s.chiba-u.ac.jp > > diff --git a/src/image.c b/src/image.c > index fc90c5ea74..7172bfc810 100644 > --- a/src/image.c > +++ b/src/image.c > @@ -1242,6 +1242,10 @@ prepare_image_for_display (struct frame *f, struct > image *img) > if (img->cr_data == NULL || (cairo_pattern_get_type (img->cr_data) > != CAIRO_PATTERN_TYPE_SURFACE)) > { > + /* Fill in the background/background_transparent field while > + we have img->pixmap->data/img->mask->data. */ > + IMAGE_BACKGROUND (img, f, img->pixmap); > + IMAGE_BACKGROUND_TRANSPARENT (img, f, img->mask); > cr_put_image_to_cr_data (img); > if (img->cr_data == NULL) > { Also, could you try if the following patch gives some output in the terminal from which you invoke Emacs? I suspect find-image failed to get a proper tool bar icon image file because file-readable-p erroneously returned nil. YAMAMOTO Mitsuharu mituharu@math.s.chiba-u.ac.jp diff --git a/src/fileio.c b/src/fileio.c index 01f8a04e5d..997faa9820 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -162,6 +162,12 @@ file_access_p (char const *file, int amode) if (faccessat (AT_FDCWD, file, amode, AT_EACCESS) == 0) return true; + if (errno == EINTR) + { + perror ("faccessat"); + fprintf (stderr, "file = %s, amode = %d\n", file, amode); + } + #ifdef CYGWIN /* Return success if faccessat failed because Cygwin couldn't determine the file's UID or GID. */ From unknown Mon Aug 18 11:27:42 2025 X-Loop: help-debbugs@gnu.org Subject: bug#38774: crash in image_pix_context_get_pixel Resent-From: mituharu@math.s.chiba-u.ac.jp Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 01 Jan 2020 06:09:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 38774 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: "Madhu" Cc: 38774@debbugs.gnu.org Received: via spool by 38774-submit@debbugs.gnu.org id=B38774.15778589258104 (code B ref 38774); Wed, 01 Jan 2020 06:09:01 +0000 Received: (at 38774) by debbugs.gnu.org; 1 Jan 2020 06:08:45 +0000 Received: from localhost ([127.0.0.1]:35492 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1imXBV-00026d-16 for submit@debbugs.gnu.org; Wed, 01 Jan 2020 01:08:45 -0500 Received: from mathmail.math.s.chiba-u.ac.jp ([133.82.132.2]:49716) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1imXBT-00026U-BO for 38774@debbugs.gnu.org; Wed, 01 Jan 2020 01:08:44 -0500 Received: from weber.math.s.chiba-u.ac.jp (weber [192.168.32.4]) by mathmail.math.s.chiba-u.ac.jp (Postfix) with ESMTP id 8972AF08C6; Wed, 1 Jan 2020 15:08:40 +0900 (JST) (envelope-from mituharu@math.s.chiba-u.ac.jp) Received: from 153.216.236.73 (SquirrelMail authenticated user mituharu) by weber.math.s.chiba-u.ac.jp with HTTP; Wed, 1 Jan 2020 15:08:40 +0900 Message-ID: In-Reply-To: References: <393824cdb46651a2b3b9128ca3683c1e.squirrel@weber.math.s.chiba-u.ac.jp> Date: Wed, 1 Jan 2020 15:08:40 +0900 From: mituharu@math.s.chiba-u.ac.jp User-Agent: SquirrelMail/1.4.22-5.el6 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-2022-jp Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >>> Could you try the patch below? >>> diff --git a/src/image.c b/src/image.c >>> index fc90c5ea74..7172bfc810 100644 > > Thanks. With that patch I do not get the crash. Thanks for testing. I'll install the patch later. >> Also, could you try if the following patch gives some output in >> the terminal from which you invoke Emacs? I suspect find-image >> failed to get a proper tool bar icon image file because >> file-readable-p erroneously returned nil. > >> diff --git a/src/fileio.c b/src/fileio.c >> index 01f8a04e5d..997faa9820 100644 > > I did not get any output from this code branch. I had the previous > version of emacs (which did crash) lying around and doing an strace -e > faccessat emacs, the last image files that are accessed are calls to > accessat(AT_FDCWD, "/7/gtk/emacs/etc/images/separator.pbm", R_OK) = 0 > before it crashed. Actually it is strange to access the PBM version because we only use the XPM one. Is the XPM version in the same directory accessed before the PBM one? If so, can you get the errno in the strace output? I could observe spontaneous interrupted faccessat calls on Linux 4.13.0 with a network-mounted source tree on Parallels Desktop 12. faccessat(AT_FDCWD, "/home/mituharu/src/git/emacs/trunk/etc/images/separator.xpm", R_OK) = ? ERESTARTSYS (To be restarted if SA_RESTART is set) The man page of faccessat does not say it may fail with EINTR, but it actually does on some environments (probably with NFS, see also Bug#9256). Maybe we should retry faccessat when it fails with EINTR so file-readable-p and the like may not return false results. YAMAMOTO Mitsuharu mituharu@math.s.chiba-u.ac.jp From unknown Mon Aug 18 11:27:42 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Madhu Subject: bug#38774: closed (Re: bug#38774: crash in image_pix_context_get_pixel) Message-ID: References: X-Gnu-PR-Message: they-closed 38774 X-Gnu-PR-Package: emacs Reply-To: 38774@debbugs.gnu.org Date: Tue, 07 Jan 2020 03:55:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1578369302-16494-1" This is a multi-part message in MIME format... ------------=_1578369302-16494-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #38774: crash in image_pix_context_get_pixel which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 38774@debbugs.gnu.org. --=20 38774: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D38774 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1578369302-16494-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 38774-done) by debbugs.gnu.org; 7 Jan 2020 03:54:35 +0000 Received: from localhost ([127.0.0.1]:47142 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iofww-0004HJ-R5 for submit@debbugs.gnu.org; Mon, 06 Jan 2020 22:54:35 -0500 Received: from mathmail.math.s.chiba-u.ac.jp ([133.82.132.2]:63254) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iofwu-0004H7-Lh for 38774-done@debbugs.gnu.org; Mon, 06 Jan 2020 22:54:33 -0500 Received: from mathent.math.s.chiba-u.ac.jp (mathent [192.168.32.5]) by mathmail.math.s.chiba-u.ac.jp (Postfix) with ESMTP id 91A90F08D5; Tue, 7 Jan 2020 12:54:31 +0900 (JST) (envelope-from mituharu@math.s.chiba-u.ac.jp) Date: Tue, 07 Jan 2020 12:54:31 +0900 Message-ID: From: YAMAMOTO Mitsuharu To: "Madhu" Subject: Re: bug#38774: crash in image_pix_context_get_pixel In-Reply-To: References: <393824cdb46651a2b3b9128ca3683c1e.squirrel@weber.math.s.chiba-u.ac.jp> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL/10.8 EasyPG/1.0.0 Emacs/26 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) Organization: Faculty of Science, Chiba University MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 38774-done Cc: 38774-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Wed, 01 Jan 2020 15:08:40 +0900, mituharu@math.s.chiba-u.ac.jp wrote: > > >>> Could you try the patch below? > >>> diff --git a/src/image.c b/src/image.c > >>> index fc90c5ea74..7172bfc810 100644 > > > > Thanks. With that patch I do not get the crash. > > Thanks for testing. I'll install the patch later. Installed to the emacs-27 branch. Closing the bug. YAMAMOTO Mitsuharu mituharu@math.s.chiba-u.ac.jp ------------=_1578369302-16494-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 28 Dec 2019 14:49:44 +0000 Received: from localhost ([127.0.0.1]:58052 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ilDPT-0001v8-M6 for submit@debbugs.gnu.org; Sat, 28 Dec 2019 09:49:44 -0500 Received: from lists.gnu.org ([209.51.188.17]:33114) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ilDPR-0001v0-M9 for submit@debbugs.gnu.org; Sat, 28 Dec 2019 09:49:42 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:50564) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ilDPQ-0005tc-6G for bug-gnu-emacs@gnu.org; Sat, 28 Dec 2019 09:49:41 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: **** X-Spam-Status: No, score=4.9 required=5.0 tests=BAYES_50, RCVD_IN_PBL, RDNS_NONE, URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ilDPO-000855-Kr for bug-gnu-emacs@gnu.org; Sat, 28 Dec 2019 09:49:39 -0500 Received: from [117.208.207.175] (port=40870 helo=localhost.localdomain) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ilDPN-0007mv-QA for bug-gnu-emacs@gnu.org; Sat, 28 Dec 2019 09:49:38 -0500 Received: (qmail 8669 invoked by uid 500); 28 Dec 2019 14:27:06 -0000 From: Madhu To: bug-gnu-emacs@gnu.org Subject: crash in image_pix_context_get_pixel Date: Sat, 28 Dec 2019 19:57:06 +0530 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] [fuzzy] X-Received-From: 117.208.207.175 X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) Recent emacs configured with configure -C --without-all --with-xml2 --with-dbus --with-m17n-flt --with-libotf --with-xft --with-x-toolkit=athena --with-toolkit-scroll-bars --with-xaw3d --with-cairo --with-harfbuzz --with-png crashes on startup. The backtrace is Starting program: /7/gtk/emacs/build-xt-debug/src/emacs -Q [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". delete terminal 0xa4b720 called Program received signal SIGSEGV, Segmentation fault. 0x00000000005bf574 in image_pix_context_get_pixel (y=, x=0, image=0xb3a210) at /7/gtk/emacs/src/image.c:183 (gdb) back #0 0x00000000005bf574 in image_pix_context_get_pixel (y=, x=0, image=0xb3a210) at /7/gtk/emacs/src/image.c:183 #1 image_pix_context_get_pixel (image=0xb3a210, x=0, y=) at /7/gtk/emacs/src/image.c:180 #2 0x00000000005bf65c in four_corners_best (pimg=0xb3a210, corners=corners@entry=0xde108c, width=2, height=24) at /7/gtk/emacs/src/image.c:1334 #3 0x00000000005c2dfc in image_background (img=0xde1020, f=0xb0e9c0, pimg=, pimg@entry=0x0) at /7/gtk/emacs/src/image.c:1374 #4 0x00000000004c8c9b in x_setup_relief_colors (s=s@entry=0x7fffffffbaa0) at /7/gtk/emacs/src/xterm.c:2746 #5 0x00000000004c8e09 in x_draw_glyph_string_box (s=s@entry=0x7fffffffbaa0) at /7/gtk/emacs/src/xterm.c:3029 #6 0x00000000004c9c98 in x_draw_glyph_string (s=0x7fffffffbaa0) at /7/gtk/emacs/src/xterm.c:3970 #7 0x000000000045d045 in draw_glyphs (w=0xbfd670, x=, row=0xc9d960, area=TEXT_AREA, start=, end=, hl=, overlaps=) at /7/gtk/emacs/src/xdisp.c:28490 #8 0x0000000000462731 in gui_write_glyphs (w=0xbfd670, updated_row=, start=, updated_area=TEXT_AREA, len=13) at /7/gtk/emacs/src/xdisp.c:30517 #9 0x000000000041d843 in update_text_area (vpos=0, updated_row=0xc9d960, w=0xbfd670) at /7/gtk/emacs/src/dispnew.c:3832 #10 update_window_line (w=w@entry=0xbfd670, vpos=vpos@entry=0, mouse_face_overwritten_p=mouse_face_overwritten_p@entry=0x7fffffffc33f) at /7/gtk/emacs/src/dispnew.c:4075 #11 0x0000000000422099 in update_window (w=w@entry=0xbfd670, force_p=, force_p@entry=true) at /7/gtk/emacs/src/dispnew.c:3604 #12 0x00000000004238ae in update_frame (f=f@entry=0xb0e9c0, force_p=, force_p@entry=false, inhibit_hairy_id_p=inhibit_hairy_id_p@entry=false) at /7/gtk/emacs/src/dispnew.c:3206 #13 0x0000000000457f65 in redisplay_internal () at /7/gtk/emacs/src/xdisp.c:15702 #14 0x00000000004f45d7 in read_char (commandflag=1, map=XIL(0xad0d63), prev_event=XIL(0), used_mouse_menu=0x7fffffffdd8b, end_time=0x0) at /7/gtk/emacs/src/keyboard.c:2488 #15 0x00000000004f6eee in read_key_sequence (keybuf=, prompt=XIL(0), dont_downcase_last=, can_return_switch_frame=true, fix_current_buffer=true, prevent_redisplay=) at /7/gtk/emacs/src/keyboard.c:9538 #16 0x00000000004f856e in command_loop_1 () at /7/gtk/emacs/src/lisp.h:1047 #17 0x000000000055bf57 in internal_condition_case ( bfun=bfun@entry=0x4f8390 , handlers=handlers@entry=XIL(0x90), hfun=hfun@entry=0x4ef690 ) at /7/gtk/emacs/src/eval.c:1355 #18 0x00000000004ea44c in command_loop_2 (ignore=ignore@entry=XIL(0)) at /7/gtk/emacs/src/lisp.h:1047 #19 0x000000000055beb1 in internal_catch (tag=tag@entry=XIL(0xcc60), func=func@entry=0x4ea430 , arg=arg@entry=XIL(0)) at /7/gtk/emacs/src/eval.c:1116 #20 0x00000000004ea3f4 in command_loop () at /7/gtk/emacs/src/lisp.h:1047 #21 0x00000000004ef2a6 in recursive_edit_1 () at /7/gtk/emacs/src/keyboard.c:714 #22 0x00000000004ef5d0 in Frecursive_edit () at /7/gtk/emacs/src/keyboard.c:786 #23 0x000000000041aa71 in main (argc=2, argv=) at /7/gtk/emacs/src/emacs.c:2078 Lisp Backtrace: "redisplay_internal (C function)" (0x0) (gdb) p image->data 0x0 With emacs -nw (which doesn't crash) the following details are printed: In GNU Emacs 28.0.50 (build 2, x86_64-pc-linux-gnu, X toolkit, cairo version 1.\ 16.0, Xaw3d scroll bars) of 2019-12-28 built on leonis4 [BTW Composing main Info directory...done user-error: Info file emacs does not exist ;; What nonsense! Of course it exists! in /7/gtk/emacs/info/emacs.info ] Configured features: XAW3D PNG CAIRO DBUS LIBXML2 FREETYPE HARFBUZZ M17N_FLT LIBOTF TOOLKIT_SCROLL_BARS LUCID X11 XDBE XIM PDUMPER GMP Now I had this same crash on master a few weeks ago even before the emacs-28 branch (when compiled with gtk instead of xt - the crash happened on a emacs -Q -f gnus in that case) The information in this bug report may not be enough as it may depend on the versions of the graphics libraries. I will be glad to supply the info if it is needed. ------------=_1578369302-16494-1--