From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kenichi Handa Newsgroups: gmane.emacs.devel Subject: Re: Crash using text property 'composite on w32 Date: Thu, 14 Jun 2007 21:32:34 +0900 Message-ID: References: <466D7903.6040508@gmail.com> <466DDFA5.3090202@gnu.org> <87bqfl5g90.fsf@stupidchicken.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.3 - "Ushinoya") Content-Type: text/plain; charset=US-ASCII X-Trace: sea.gmane.org 1181824435 12319 80.91.229.12 (14 Jun 2007 12:33:55 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 14 Jun 2007 12:33:55 +0000 (UTC) Cc: emacs-devel@gnu.org To: Chong Yidong Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jun 14 14:33:53 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 1HyoWN-0007nO-VT for ged-emacs-devel@m.gmane.org; Thu, 14 Jun 2007 14:33:52 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HyoWN-0001eV-A8 for ged-emacs-devel@m.gmane.org; Thu, 14 Jun 2007 08:33:51 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HyoVQ-0000hA-L9 for emacs-devel@gnu.org; Thu, 14 Jun 2007 08:32:52 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HyoVP-0000fl-Gk for emacs-devel@gnu.org; Thu, 14 Jun 2007 08:32:51 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HyoVP-0000fc-89 for emacs-devel@gnu.org; Thu, 14 Jun 2007 08:32:51 -0400 Original-Received: from mx1.aist.go.jp ([150.29.246.133]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1HyoVN-0000Z1-Dr for emacs-devel@gnu.org; Thu, 14 Jun 2007 08:32:50 -0400 Original-Received: from rqsmtp1.aist.go.jp (rqsmtp1.aist.go.jp [150.29.254.115]) by mx1.aist.go.jp with ESMTP id l5ECWawb018612; Thu, 14 Jun 2007 21:32:36 +0900 (JST) env-from (handa@m17n.org) Original-Received: from smtp3.aist.go.jp by rqsmtp1.aist.go.jp with ESMTP id l5ECWa6T018937; Thu, 14 Jun 2007 21:32:36 +0900 (JST) env-from (handa@m17n.org) Original-Received: by smtp3.aist.go.jp with ESMTP id l5ECWYZe003194; Thu, 14 Jun 2007 21:32:34 +0900 (JST) env-from (handa@m17n.org) Original-Received: from handa by etlken.m17n.org with local (Exim 4.63) (envelope-from ) id 1HyoV8-0002KX-LC; Thu, 14 Jun 2007 21:32:34 +0900 In-reply-to: <87bqfl5g90.fsf@stupidchicken.com> (message from Chong Yidong on Tue, 12 Jun 2007 11:44:59 -0400) User-Agent: SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/23.0.0 (i686-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) X-detected-kernel: Solaris 8 (1) 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:72857 Archived-At: In article <87bqfl5g90.fsf@stupidchicken.com>, Chong Yidong writes: > The following message is a courtesy copy of an article > that has been posted to gmane.emacs.bugs as well. > "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. Thank you for finding this bug. You are right. I installed a fix in the trunk. Anyway, composition property should not be attached manually as this: (let ((s "text")) (put-text-property 0 2 'composition ?A s) (insert s)) Instead, people should use compose-region or compose-string as this: (insert (compose-string "text" 0 2 ?A)) > 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? Yes. The above description is for the argument COMPONENTS of the function `compose-region', or for just a part of the property value. The value has this form: The property value has this form when the composition is made: ((LENGTH . COMPONENTS) . MODIFICATION-FUNC) then turns to this form: (COMPOSITION-ID . (LENGTH COMPONENTS-VEC . MODIFICATION-FUNC)) when the composition is registered in composition_hash_table and composition_table. These rather peculiar structures were designed to make it easy to distinguish them quickly (we can do that by checking only the first element) and to extract LENGTH (from the former form) and COMPOSITION-ID (from the latter form). [...] The detail is described in the header comment of src/composite.c. How much detail, do you think, we should describe in Info? Isn't it enough to say just as below? The value should be a cons of special structure. It should be manipulated only by the functions `compose-region', `compose-string' and `find-composition'. --- Kenichi Handa handa@m17n.org