From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: storm@cua.dk (Kim F. Storm) Newsgroups: gmane.emacs.devel,gmane.emacs.pretest.bugs Subject: Re: 23.0.50; Emacs seg fault Date: Sun, 30 Sep 2007 12:49:08 +0200 Message-ID: <87abr4a0nv.fsf@kfs-lx.testafd.dk> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1191149480 25394 80.91.229.12 (30 Sep 2007 10:51:20 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 30 Sep 2007 10:51:20 +0000 (UTC) Cc: emacs-pretest-bug@gnu.org To: Leo Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Sep 30 12:51:15 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IbwOE-0002b0-OF for ged-emacs-devel@m.gmane.org; Sun, 30 Sep 2007 12:51:11 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IbwOB-0002lV-17 for ged-emacs-devel@m.gmane.org; Sun, 30 Sep 2007 06:51:07 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IbwMh-0002Lc-NY for emacs-devel@gnu.org; Sun, 30 Sep 2007 06:49:36 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IbwMa-0002FW-Sy for emacs-devel@gnu.org; Sun, 30 Sep 2007 06:49:35 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IbwMa-0002FK-IT for emacs-devel@gnu.org; Sun, 30 Sep 2007 06:49:28 -0400 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IbwMa-0001Zx-5d for emacs-devel@gnu.org; Sun, 30 Sep 2007 06:49:28 -0400 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by fencepost.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IbwLo-0007ut-GI for emacs-pretest-bug@gnu.org; Sun, 30 Sep 2007 06:48:40 -0400 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1IbwMU-0001Yl-RS for emacs-pretest-bug@gnu.org; Sun, 30 Sep 2007 06:49:27 -0400 Original-Received: from mail-relay.sonofon.dk ([212.88.64.25]) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1IbwMU-0001Vm-3r for emacs-pretest-bug@gnu.org; Sun, 30 Sep 2007 06:49:22 -0400 Original-Received: (qmail 64671 invoked from network); 30 Sep 2007 10:49:09 -0000 Original-Received: from unknown (HELO kfs-lx.testafd.dk.cua.dk) (213.83.150.2) by 0 with SMTP; 30 Sep 2007 10:49:10 -0000 In-Reply-To: (Leo's message of "Sat\, 29 Sep 2007 22\:10\:10 +0100") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) X-Detected-Kernel: FreeBSD 4.6-4.9 X-Detected-Kernel: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:80049 gmane.emacs.pretest.bugs:20030 Archived-At: Leo writes: > #1 0x08194676 in wait_reading_process_output (time_limit=30, microsecs=0, read_kbd=-1, do_display=1, wait_for_cell=137551137, > wait_proc=0x0, just_wait_proc=0) at process.c:4880 I doubt that is the right line number due to compiler optimizations. Compile with CFLAGS="-g -O0" to get max debugging info. Since xerrno = 9 (EBADF), I suspect it actually traps in process.c line 4651 This means that one of the bits in the Available mask does not correspond to a valid file descriptor. Looking at the code, I see that this piece of code is executed between setting up the Available mask and the call to select. /* If frame size has changed or the window is newly mapped, redisplay now, before we start to wait. There is a race condition here; if a SIGIO arrives between now and the select and indicates that a frame is trashed, the select may block displaying a trashed screen. */ if (frame_garbaged && do_display) { clear_waiting_for_input (); redisplay_preserve_echo_area (11); if (read_kbd < 0) set_waiting_for_input (&timeout); } This looks dangerous to me. Could you try this patch and see if it fixes the problem: *** process.c 20 Sep 2007 12:50:59 +0200 1.520 --- process.c 30 Sep 2007 12:45:50 +0200 *************** *** 4509,4514 **** --- 4509,4527 ---- break; } + /* If frame size has changed or the window is newly mapped, + redisplay now, before we start to wait. There is a race + condition here; if a SIGIO arrives between now and the select + and indicates that a frame is trashed, the select may block + displaying a trashed screen. */ + if (frame_garbaged && do_display) + { + clear_waiting_for_input (); + redisplay_preserve_echo_area (11); + if (read_kbd < 0) + set_waiting_for_input (&timeout); + } + /* Wait till there is something to do */ if (wait_proc && just_wait_proc) *************** *** 4535,4553 **** check_delay = wait_channel >= 0 ? 0 : process_output_delay_count; } - /* If frame size has changed or the window is newly mapped, - redisplay now, before we start to wait. There is a race - condition here; if a SIGIO arrives between now and the select - and indicates that a frame is trashed, the select may block - displaying a trashed screen. */ - if (frame_garbaged && do_display) - { - clear_waiting_for_input (); - redisplay_preserve_echo_area (11); - if (read_kbd < 0) - set_waiting_for_input (&timeout); - } - no_avail = 0; if (read_kbd && detect_input_pending ()) { --- 4548,4553 ---- -- Kim F. Storm http://www.cua.dk