From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kazuhiro Ito Newsgroups: gmane.emacs.bugs Subject: bug#9318: 23.3.50; The first call of encode-coding-region() returns wrong result Date: Thu, 25 Aug 2011 18:49:52 +0900 Message-ID: <20110825095519.F1D042C803A@msa105.auone-net.jp> References: <20110818090129.DC129360038@msa102.auone-net.jp> <20110819134637.9727A34803A@msa103.auone-net.jp> <877h67vkpf.fsf@stupidchicken.com> <20110821001726.D29052C037@msa104.auone-net.jp> <20110824093755.8E190360038@msa102.auone-net.jp> <83ty97ggiv.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (generated by SEMI-EPG 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Trace: dough.gmane.org 1314266199 475 80.91.229.12 (25 Aug 2011 09:56:39 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 25 Aug 2011 09:56:39 +0000 (UTC) Cc: 9318@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Aug 25 11:56:32 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QwWfn-0004pU-SN for geb-bug-gnu-emacs@m.gmane.org; Thu, 25 Aug 2011 11:56:32 +0200 Original-Received: from localhost ([::1]:37674 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QwWfk-0005rX-G3 for geb-bug-gnu-emacs@m.gmane.org; Thu, 25 Aug 2011 05:56:28 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:41121) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QwWfh-0005rI-NY for bug-gnu-emacs@gnu.org; Thu, 25 Aug 2011 05:56:26 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QwWfg-0000Nn-Qp for bug-gnu-emacs@gnu.org; Thu, 25 Aug 2011 05:56:25 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:42155) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QwWfg-0000NV-M0 for bug-gnu-emacs@gnu.org; Thu, 25 Aug 2011 05:56:24 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1QwWiD-0004T2-Rt; Thu, 25 Aug 2011 05:59:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Kazuhiro Ito Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 25 Aug 2011 09:59:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 9318 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 9318-submit@debbugs.gnu.org id=B9318.131426628517099 (code B ref 9318); Thu, 25 Aug 2011 09:59:01 +0000 Original-Received: (at 9318) by debbugs.gnu.org; 25 Aug 2011 09:58:05 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QwWhH-0004Rj-Qr for submit@debbugs.gnu.org; Thu, 25 Aug 2011 05:58:05 -0400 Original-Received: from msa105.auone-net.jp ([61.117.18.165]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QwWhE-0004RH-BO for 9318@debbugs.gnu.org; Thu, 25 Aug 2011 05:58:02 -0400 Original-Received: from GUNGNIR.med.osaka-cu.ac.jp (unknown [114.179.36.76]) by msa105.auone-net.jp (au one net msa) with ESMTP id F1D042C803A; Thu, 25 Aug 2011 18:55:19 +0900 (JST) In-Reply-To: <83ty97ggiv.fsf@gnu.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?Q?Goj=C5=8D?=) APEL/10.8 EasyPG/1.0.0 Emacs/23.3.50 (i386-mingw-nt6.1.7601) MULE/6.0 (HANACHIRUSATO) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Thu, 25 Aug 2011 05:59:01 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:50330 Archived-At: > > > (progn > > > (goto-char (point-min)) > > > (insert #x80) > > > (insert (make-string 16 ?A)) > > > (encode-coding-region 1 18 'ctext-unix)) > > > > > > backtrace is below. Please let me know if you need more information. > > > > > > > > > Program received signal SIGSEGV, Segmentation fault. > > > 0x0000000000557419 in mark_object (arg=4702111234474983745) at alloc.c:5473 > > > 5473 if (STRING_MARKED_P (ptr)) > > > > I think relocation of buffer may cause the problem. > > > > The comment for CODING_DECODE_CHAR macro in coding.c says as below. > > > > > /* This wrapper macro is used to preserve validity of pointers into > > > buffer text across calls to decode_char, which could cause > > > relocation of buffers if it loads a charset map, because loading a > > > charset map allocates large structures. */ > > > > encode_coding_iso_2022() uses ENCODE_ISO_CHARACTER macro, which uses > > ENCODE_CHAR macro. ENCODE_CHAR macro calls encode_char() and it may > > load a charset map. > > But which pointer(s) in encode_coding_iso_2022 can be altered by > relocation? encode_coding() sets coding->destination with coding_set_destination() before calling encode_coding_iso_2022(). I think at least correct value of coding->destination can change in encode_coding_iso_2022() by loading charset maps. > Do you actually see any of the pointers used by this > function modified by relocation of some buffer? No, beacuse I don't know how to see. -- Kazuhiro Ito