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: Fri, 26 Aug 2011 20:41:57 +0900 Message-ID: <20110826114235.4F8011E0043@msa101.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> <20110825095522.6E2482C037@msa104.auone-net.jp> 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 1314359011 11032 80.91.229.12 (26 Aug 2011 11:43:31 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 26 Aug 2011 11:43:31 +0000 (UTC) Cc: Chong Yidong , 9318@debbugs.gnu.org To: Andreas Schwab Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Aug 26 13:43:27 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 1Qwuok-0002x3-Fy for geb-bug-gnu-emacs@m.gmane.org; Fri, 26 Aug 2011 13:43:22 +0200 Original-Received: from localhost ([::1]:33431 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qwuoj-00019K-R5 for geb-bug-gnu-emacs@m.gmane.org; Fri, 26 Aug 2011 07:43:21 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:35642) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qwuog-00019E-Qf for bug-gnu-emacs@gnu.org; Fri, 26 Aug 2011 07:43:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qwuof-0001qZ-NY for bug-gnu-emacs@gnu.org; Fri, 26 Aug 2011 07:43:18 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:48544) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qwuof-0001qU-Kr for bug-gnu-emacs@gnu.org; Fri, 26 Aug 2011 07:43:17 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1QwurJ-0000xA-Ht; Fri, 26 Aug 2011 07:46: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: Fri, 26 Aug 2011 11:46: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.13143591313619 (code B ref 9318); Fri, 26 Aug 2011 11:46:01 +0000 Original-Received: (at 9318) by debbugs.gnu.org; 26 Aug 2011 11:45:31 +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 1Qwuqn-0000wJ-WF for submit@debbugs.gnu.org; Fri, 26 Aug 2011 07:45:30 -0400 Original-Received: from msa101.auone-net.jp ([61.117.18.161]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Qwuqk-0000to-8g for 9318@debbugs.gnu.org; Fri, 26 Aug 2011 07:45:28 -0400 Original-Received: from GUNGNIR.med.osaka-cu.ac.jp (EM119-72-249-29.pool.e-mobile.ne.jp [119.72.249.29]) by msa101.auone-net.jp (au one net msa) with ESMTP id 4F8011E0043; Fri, 26 Aug 2011 20:42:34 +0900 (JST) In-Reply-To: <20110825095522.6E2482C037@msa104.auone-net.jp> 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: Fri, 26 Aug 2011 07:46: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:50363 Archived-At: > > > I think relocation of buffer may cause the problem. > > > > Does that help? > > Andreas' patch resolved the problem partially. It resolved the problem on > NetBSD with '-O0' CFLAGS, but failed on NetBSD with '-O2' and Windows. > > I confirmed that adding the protection of coding->dst_object to > Andreas' patch resolved the problem on NetBSD with '-O2' but not on > Windows. I don't know whether it is incorrect way or is not enough. I noticed char_charset() could cause relocation of buffers because it could call encode_char(). I confirmed similar changes to callers of char_charset() fixed my problem (without the protection of coding->dst_object). SUMMARY OF THE PROBLEM: In encode_coding_XXX(), calling encode_char() could cause relocation of buffers. char_charset(), ENCODE_ISO_CHARACTER and ENCODE_CHAR could also cause relocation because they could call encode_char(). After using of them, coding->destination, dst, dst_end should be updated as needed. -- Kazuhiro Ito