From xemacs-m  Tue Feb  4 06:27:21 1997
Received: from portofix.ida.liu.se (portofix.ida.liu.se [130.236.177.25])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id GAA01988
	for <xemacs-beta@xemacs.org>; Tue, 4 Feb 1997 06:27:19 -0600 (CST)
Received: from sen2.ida.liu.se (sen2.ida.liu.se [130.236.176.112]) by portofix.ida.liu.se (8.8.3/8.8.3) with SMTP id NAA08435; Tue, 4 Feb 1997 13:27:03 +0100 (MET)
Received: by sen2.ida.liu.se (SMI-8.6/ida.slave-V1.0b6d6S2)
	id NAA17114; Tue, 4 Feb 1997 13:27:02 +0100
Date: Tue, 4 Feb 1997 13:27:02 +0100
Message-Id: <199702041227.NAA17114@sen2.ida.liu.se>
From: David Byers <davby@ida.liu.se>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
To: Sudish Joseph <sudish@mindspring.com>
Cc: xemacs-beta@xemacs.org
Subject: Re:20.0 --with-mule segfaults when viewing Japanese
In-Reply-To: <yviasp3digdf.fsf@atreides.mindspring.com>
References: <yviasp3digdf.fsf@atreides.mindspring.com>
X-Face: (@~#v$c[GP"T}a;|MU<%Dpm5*6yv"NR|7k;uk8MAISFxdZ(Og$C{u(j"9X7v$qonp}SKfhT
 g|5[Pu~/3F7XQEk70gK'4z%1R%%gg7]}=>/jD`qcBeHDgo&HS,^S!&.zoTSxh<>-O6EB?SSy96&m37

> I've been seeing segfaults whenever I visit a group in Gnus that has
> Japanese in the body and/or headers.  This happens with both 20.0-b93
> and the latest 20.0.  Other than this, 20.0-b93 ran fine for 3 days.
> It's reproducable with optimisation turned off.

I have a feeling this is the same bug that bit me. The backtrace looks
very familiar, as do the trigger and symptoms.

I think the following patch will prevent the segmentation fault by
doing bounds checking each time the display table is consulted. This
is a typical example of treating the symptoms, not the disease. Even
so, it should probably be included in 20.0.

--
David Byers.



*** glyphs-old.h	Tue Feb  4 12:35:23 1997
--- glyphs.h	Tue Feb  4 12:35:38 1997
***************
*** 548,554 ****
   *****************************************************************************/
  
  #define DISP_TABLE_SIZE	256
! #define DISP_CHAR_ENTRY(dp, c)	((dp)->contents[c])
  
  struct Lisp_Vector *get_display_table (struct window *, face_index);
  
--- 548,554 ----
   *****************************************************************************/
  
  #define DISP_TABLE_SIZE	256
! #define DISP_CHAR_ENTRY(dp, c) ((c < (dp)->size) ? (dp)->contents[c] : Qnil)
  
  struct Lisp_Vector *get_display_table (struct window *, face_index);
  

