From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kenichi Handa Newsgroups: gmane.emacs.devel,gmane.emacs.pretest.bugs Subject: Re: Crashes with non-default language environments Date: Tue, 12 Feb 2008 20:23:52 +0900 Message-ID: References: <87y79wve9b.fsf@jurta.org> <87zlu96bp2.fsf@jurta.org> <87prv4l96f.fsf@jurta.org> 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: ger.gmane.org 1202815463 4233 80.91.229.12 (12 Feb 2008 11:24:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 12 Feb 2008 11:24:23 +0000 (UTC) Cc: emacs-pretest-bug@gnu.org, monnier@iro.umontreal.ca To: Juri Linkov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Feb 12 12:24:46 2008 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 1JOtFl-0007vc-PZ for ged-emacs-devel@m.gmane.org; Tue, 12 Feb 2008 12:24:46 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JOtFI-00035l-4s for ged-emacs-devel@m.gmane.org; Tue, 12 Feb 2008 06:24:16 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JOtFA-00032g-Mn for emacs-devel@gnu.org; Tue, 12 Feb 2008 06:24:08 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JOtF6-0002yS-8K for emacs-devel@gnu.org; Tue, 12 Feb 2008 06:24:07 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JOtF6-0002yK-41 for emacs-devel@gnu.org; Tue, 12 Feb 2008 06:24:04 -0500 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JOtF5-0001WS-Tw for emacs-devel@gnu.org; Tue, 12 Feb 2008 06:24:04 -0500 Original-Received: from mail.gnu.org ([199.232.76.166] helo=mx10.gnu.org) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1JOtF5-0002Zt-Ls for emacs-pretest-bug@gnu.org; Tue, 12 Feb 2008 06:24:03 -0500 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1JOtF2-0001Vw-K1 for emacs-pretest-bug@gnu.org; Tue, 12 Feb 2008 06:24:03 -0500 Original-Received: from mx1.aist.go.jp ([150.29.246.133]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JOtF1-0001VQ-Pv for emacs-pretest-bug@gnu.org; Tue, 12 Feb 2008 06:24:00 -0500 Original-Received: from rqsmtp2.aist.go.jp (rqsmtp2.aist.go.jp [150.29.254.123]) by mx1.aist.go.jp with ESMTP id m1CBNsmO007717; Tue, 12 Feb 2008 20:23:54 +0900 (JST) env-from (handa@m17n.org) Original-Received: from smtp4.aist.go.jp by rqsmtp2.aist.go.jp with ESMTP id m1CBNsvU024842; Tue, 12 Feb 2008 20:23:54 +0900 (JST) env-from (handa@m17n.org) Original-Received: by smtp4.aist.go.jp with ESMTP id m1CBNqD6020947; Tue, 12 Feb 2008 20:23:53 +0900 (JST) env-from (handa@m17n.org) Original-Received: from handa by etlken.m17n.org with local (Exim 4.68) (envelope-from ) id 1JOtEu-0002gO-Sp; Tue, 12 Feb 2008 20:23:52 +0900 In-reply-to: <87prv4l96f.fsf@jurta.org> (message from Juri Linkov on Mon, 11 Feb 2008 00:48:40 +0200) User-Agent: SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/23.0.60 (i686-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) X-detected-kernel: by monty-python.gnu.org: Solaris 8 (1) X-detected-kernel: by monty-python.gnu.org: 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:88850 gmane.emacs.pretest.bugs:21042 Archived-At: In article <87prv4l96f.fsf@jurta.org>, Juri Linkov writes: >>> This crash is caused by the corrupt byte-code produced by >>> `byte-compile-lapcode'. `string-make-unibyte' at the end of this >>> function produces different bytecode strings in different >>> language environments. This problem can be narrowed down to: > > > > Shouldn't it be string-to-unibyte instead? > I've just checked that `string-as-unibyte' produces even worse results > than `string-make-unibyte'. It replaces every byte in the original > string with 2-byte sequences. > The change to use `string-as-unibyte' came from the Unicode branch: > 2008-02-02 Kenichi Handa > * emacs-lisp/bytecomp.el (byte-compile-lapcode): Be sure to > return a unibyte string. > Maybe, this change is correct, but the bug is in the definition of the > language environment, I can't say for sure. Comparing results of calling > `string-make-unibyte' on 256 bytes in different language environments > gives only 6 differences: It was my fault. I've just installed this change. Could you please try with the latest code? Index: bytecomp.el =================================================================== RCS file: /cvsroot/emacs/emacs/lisp/emacs-lisp/bytecomp.el,v retrieving revision 2.229 retrieving revision 2.230 diff -u -r2.229 -r2.230 --- bytecomp.el 1 Feb 2008 16:01:26 -0000 2.229 +++ bytecomp.el 12 Feb 2008 11:21:31 -0000 2.230 @@ -864,7 +864,7 @@ (setcar (cdr bytes) (logand pc 255)) (setcar bytes (lsh pc -8)))) (setq patchlist (cdr patchlist)))) - (string-make-unibyte (concat (nreverse bytes))))) + (apply 'unibyte-string (nreverse bytes)))) ;;; compile-time evaluation --- Kenichi Handa handa@ni.aist.go.jp