all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: William Xu <william.xwl@gmail.com>
To: emacs-devel@gnu.org
Cc: emacs-pretest-bug@gnu.org
Subject: Re: 23.0.50; 23.0.50: x_set_frame_parameters() failure on macosx
Date: Tue, 16 Oct 2007 14:23:21 +0900	[thread overview]
Message-ID: <m2lka3ocom.fsf@gmail.com> (raw)
In-Reply-To: m2sl4od1q8.fsf@gmail.com

[-- Attachment #1: Type: text/plain, Size: 1261 bytes --]

William Xu <william.xwl@gmail.com> writes:

> This failure happens quite often and at random. When it happens, the
> emacs window won't response at all. I can only kill it and restart.
>
> This is the backtrace in gdb: 
>
> ---------------------------------8<------------------------------------- 
> Program received signal EXC_BAD_ACCESS, Could not access memory.
>
> Reason: KERN_PROTECTION_FAILURE at address: 0x000000480x000176f4 in
> x_set_frame_parameters (f=0x869c7a0, alist=145413011) at
> /Users/william/repo/cvs/emacs/src/frame.c:30593059                  if
> (NATNUMP (param_index) 
> (gdb) bt
> #0  0x000176f4 in x_set_frame_parameters (f=0x869c7a0, alist=145413011) at
> /Users/william/repo/cvs/emacs/src/frame.c:3059

For this, I found when it crashed, FRAME_TERMINAL(f)
returns NULL, which i don't know what has caused it. How can i
investigate this?

Hence in frame.c, I modified

,----
| && FRAME_RIF (f)->frame_parm_handlers[XINT (param_index)])
`----

to

,----
| && FRAME_TERMINAL(f)
| && FRAME_RIF (f)->frame_parm_handlers[XINT (param_index)])
`----

Then it's much more stable now. There are three simliar changes in
frame.c, others are simply removing trailing whitespaces change.

See attchment.

-- 
William

http://williamxu.net9.org

[-- Attachment #2: frame.c.diff --]
[-- Type: text/plain, Size: 5795 bytes --]

Index: frame.c
===================================================================
RCS file: /sources/emacs/emacs/src/frame.c,v
retrieving revision 1.355
diff -u -r1.355 frame.c
--- frame.c	15 Oct 2007 02:07:49 -0000	1.355
+++ frame.c	16 Oct 2007 05:11:40 -0000
@@ -261,7 +261,7 @@
     return Qnil;
   else
     return type;
-}      
+}
 
 struct frame *
 make_frame (mini_p)
@@ -546,10 +546,10 @@
   f->terminal = terminal;
   f->terminal->reference_count++;
   f->output_data.nothing = 0;
-  
+
   FRAME_FOREGROUND_PIXEL (f) = FACE_TTY_DEFAULT_FG_COLOR;
   FRAME_BACKGROUND_PIXEL (f) = FACE_TTY_DEFAULT_BG_COLOR;
-    
+
   FRAME_CAN_HAVE_SCROLL_BARS (f) = 0;
   FRAME_VERTICAL_SCROLL_BAR_TYPE (f) = vertical_scroll_bar_none;
 
@@ -611,10 +611,10 @@
     f->terminal = terminal;
     f->terminal->reference_count++;
     create_tty_output (f);
-    
+
     FRAME_FOREGROUND_PIXEL (f) = FACE_TTY_DEFAULT_FG_COLOR;
     FRAME_BACKGROUND_PIXEL (f) = FACE_TTY_DEFAULT_BG_COLOR;
-    
+
     FRAME_CAN_HAVE_SCROLL_BARS (f) = 0;
     FRAME_VERTICAL_SCROLL_BAR_TYPE (f) = vertical_scroll_bar_none;
 
@@ -622,10 +622,10 @@
     if (FRAMEP (FRAME_TTY (f)->top_frame)
         && FRAME_LIVE_P (XFRAME (FRAME_TTY (f)->top_frame)))
       XFRAME (FRAME_TTY (f)->top_frame)->async_visible = 2; /* obscured */
-    
+
     FRAME_TTY (f)->top_frame = frame;
   }
-  
+
 #ifdef CANNOT_DUMP
   FRAME_FOREGROUND_PIXEL(f) = FACE_TTY_DEFAULT_FG_COLOR;
   FRAME_BACKGROUND_PIXEL(f) = FACE_TTY_DEFAULT_BG_COLOR;
@@ -709,7 +709,7 @@
 #endif
 #endif
 #endif /* not MSDOS */
-  
+
   {
     Lisp_Object terminal;
 
@@ -720,9 +720,9 @@
         t = get_terminal (terminal, 1);
       }
   }
-  
+
   if (!t)
-    { 
+    {
       char *name = 0, *type = 0;
       Lisp_Object tty, tty_type;
 
@@ -736,7 +736,7 @@
           strncpy (name, SDATA (tty), SBYTES (tty));
           name[SBYTES (tty)] = 0;
         }
-      
+
       tty_type = get_future_frame_param
         (Qtty_type, parms, (FRAME_TERMCAP_P (XFRAME (selected_frame))
                             ? FRAME_TTY (XFRAME (selected_frame))->type
@@ -758,7 +758,7 @@
     get_tty_size (fileno (FRAME_TTY (f)->input), &width, &height);
     change_frame_size (f, height, width, 0, 0, 0);
   }
-  
+
   adjust_glyphs (f);
   calculate_costs (f);
   XSETFRAME (frame, f);
@@ -774,7 +774,7 @@
                                             Qnil));
   else
     Fmodify_frame_parameters (frame, Fcons (Fcons (Qtty, Qnil), Qnil));
-  
+
   /* Make the frame face alist be frame-specific, so that each
      frame could change its face definitions independently.  */
   f->face_alist = Fcopy_alist (sf->face_alist);
@@ -1520,7 +1520,7 @@
 
   {
     struct terminal *terminal = FRAME_TERMINAL (f);
-    f->output_data.nothing = 0; 
+    f->output_data.nothing = 0;
     f->terminal = 0;             /* Now the frame is dead. */
 
     /* If needed, delete the terminal that this frame was on.
@@ -2027,7 +2027,7 @@
   CHECK_LIVE_FRAME (frame);
 
   f = XFRAME (frame);
-  
+
   /* Do like the documentation says. */
   Fmake_frame_visible (frame);
 
@@ -2047,14 +2047,14 @@
      Lisp_Object frame;
 {
   struct frame *f;
-  
+
   if (NILP (frame))
     frame = selected_frame;
 
   CHECK_LIVE_FRAME (frame);
 
   f = XFRAME (frame);
-  
+
   if (FRAME_TERMINAL (f)->frame_raise_lower_hook)
     (*FRAME_TERMINAL (f)->frame_raise_lower_hook) (f, 0);
 
@@ -2091,7 +2091,7 @@
      Lisp_Object frame, focus_frame;
 {
   struct frame *f;
-  
+
   /* Note that we don't check for a live frame here.  It's reasonable
      to redirect the focus of a frame you're about to delete, if you
      know what other frame should receive those keystrokes.  */
@@ -2101,7 +2101,7 @@
     CHECK_LIVE_FRAME (focus_frame);
 
   f = XFRAME (frame);
-  
+
   f->focus_frame = focus_frame;
 
   if (FRAME_TERMINAL (f)->frame_rehighlight_hook)
@@ -3004,10 +3004,11 @@
 
 	      param_index = Fget (prop, Qx_frame_parameter);
 	      if (NATNUMP (param_index)
-		  && (XFASTINT (param_index)
-		      < sizeof (frame_parms)/sizeof (frame_parms[0]))
-                  && FRAME_RIF (f)->frame_parm_handlers[XINT (param_index)])
-                (*(FRAME_RIF (f)->frame_parm_handlers[XINT (param_index)])) (f, val, old_value);
+              && (XFASTINT (param_index)
+                  < sizeof (frame_parms)/sizeof (frame_parms[0]))
+              && FRAME_TERMINAL(f)
+              && FRAME_RIF (f)->frame_parm_handlers[XINT (param_index)])
+               (*(FRAME_RIF (f)->frame_parm_handlers[XINT (param_index)])) (f, val, old_value);
 	      unbind_to (count, Qnil);
 	    }
 	}
@@ -3051,6 +3052,7 @@
 	  if (NATNUMP (param_index)
 	      && (XFASTINT (param_index)
 		  < sizeof (frame_parms)/sizeof (frame_parms[0]))
+          && FRAME_TERMINAL(f)
 	      && FRAME_RIF (f)->frame_parm_handlers[XINT (param_index)])
 	    (*(FRAME_RIF (f)->frame_parm_handlers[XINT (param_index)])) (f, val, old_value);
 	}
@@ -3291,7 +3293,7 @@
   else if (EQ (new_value, Qfullheight))
     f->want_fullscreen = FULLSCREEN_HEIGHT;
 
-  if (FRAME_TERMINAL (f)->fullscreen_hook != NULL) 
+  if (FRAME_TERMINAL (f)->fullscreen_hook != NULL)
     FRAME_TERMINAL (f)->fullscreen_hook (f);
 }
 
@@ -3341,6 +3343,7 @@
       if (NATNUMP (index)
 	  && (XFASTINT (index)
 	      < sizeof (frame_parms)/sizeof (frame_parms[0]))
+      && FRAME_TERMINAL(f)
 	  && FRAME_RIF (f)->frame_parm_handlers[XFASTINT (index)])
 	  (*FRAME_RIF (f)->frame_parm_handlers[XFASTINT (index)])
 	    (f, bgcolor, Qnil);
@@ -4319,7 +4322,7 @@
   staticpro (&Qterminal);
   Qterminal_live_p = intern ("terminal-live-p");
   staticpro (&Qterminal_live_p);
-  
+
   {
     int i;
 
@@ -4454,7 +4457,7 @@
 #else
   focus_follows_mouse = 0;
 #endif
-	 
+
   staticpro (&Vframe_list);
 
   defsubr (&Sactive_minibuffer_window);

[-- Attachment #3: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

  parent reply	other threads:[~2007-10-16  5:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-06  9:35 23.0.50; 23.0.50: x_set_frame_parameters() failure on macosx William Xu
2007-10-06 20:06 ` Dan Nicolaescu
2007-10-07 10:38   ` William Xu
2007-10-07 14:14     ` Dan Nicolaescu
2007-10-16  5:23 ` William Xu [this message]
2007-10-16  6:26   ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2lka3ocom.fsf@gmail.com \
    --to=william.xwl@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=emacs-pretest-bug@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.