From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.bugs Subject: Re: Crash using text property 'composite on w32 Date: Tue, 12 Jun 2007 11:44:59 -0400 Message-ID: <87bqfl5g90.fsf@stupidchicken.com> References: <466D7903.6040508@gmail.com> <466DDFA5.3090202@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1181663150 4192 80.91.229.12 (12 Jun 2007 15:45:50 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 12 Jun 2007 15:45:50 +0000 (UTC) Cc: Kenichi Handa To: bug-gnu-emacs@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jun 12 17:45:49 2007 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Hy8Z0-0000Xn-UY for geb-bug-gnu-emacs@m.gmane.org; Tue, 12 Jun 2007 17:45:47 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Hy8Z0-0006Gi-Es for geb-bug-gnu-emacs@m.gmane.org; Tue, 12 Jun 2007 11:45:46 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Hy8Yy-0006Gc-7z for bug-gnu-emacs@gnu.org; Tue, 12 Jun 2007 11:45:44 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Hy8Yt-0006GH-TS for bug-gnu-emacs@gnu.org; Tue, 12 Jun 2007 11:45:42 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Hy8Yt-0006GE-QJ for bug-gnu-emacs@gnu.org; Tue, 12 Jun 2007 11:45:39 -0400 Original-Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Hy8Yt-0005Bf-7x for bug-gnu-emacs@gnu.org; Tue, 12 Jun 2007 11:45:39 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1Hy8Yj-0003AI-UZ for bug-gnu-emacs@gnu.org; Tue, 12 Jun 2007 17:45:29 +0200 Original-Received: from cyd.mit.edu ([18.115.2.24]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 12 Jun 2007 17:45:29 +0200 Original-Received: from cyd by cyd.mit.edu with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 12 Jun 2007 17:45:29 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 47 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: cyd.mit.edu User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux) Cancel-Lock: sha1:ZlPImoqFNq8Y9HK4epTIpbgVQd0= X-detected-kernel: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:15860 Archived-At: "Juanma Barranquero" writes: > Program received signal SIGSEGV, Segmentation fault. > 0x010c798a in run_composition_function (from=267, to=269, prop=520) > at composite.c:456 > 456 func = COMPOSITION_MODIFICATION_FUNC (prop); > (gdb) bt > #0 0x010c798a in run_composition_function (from=267, to=269, prop=520) > at composite.c:456 > #1 0x010c7d1c in update_compositions (from=269, to=271, check_mask=3) > at composite.c:514 The trouble here is that the code expects the property `prop' obtained from find_composition to be a valid composition, which is a cons. So probably the way to fix this is to stick in a couple of COMPOSITION_VALID_P checks into update_compositions, around composite.c:514. The strange thing, though, is that the elisp manual describes the composition property as follows (documented by Handa on 2007-04-19): `composition' This text property is used to display a sequence of characters as a single glyph composed from components. For instance, in Thai a base consonant is composed with the following combining vowel as a single glyph. The value should be a character or a sequence (vector, list, or string) of integers. * If it is a character, it means to display that character instead of the text in the region. * If it is a string, it means to display that string's contents instead of the text in the region. * If it is a vector or list, the elements are characters interleaved with internal codes specifying how to compose the following character with the previous one. Is this a mistake? The assumption made in the Emacs code is that the only valid form for a `composition' property is a cons cell. For example, the definition of COMPOSITION_VALID_P in composite.h:96 is #define COMPOSITION_VALID_P(start, end, prop) \ (CONSP (prop) \ && ..... So it looks like the documentation needs to be fixed too.