GNU bug report logs - #9318
23.3.50; The first call of encode-coding-region() returns wrong result on on Windows

Previous Next

Package: emacs;

Reported by: Kazuhiro Ito <kzhr <at> d1.dion.ne.jp>

Date: Thu, 18 Aug 2011 09:04:02 UTC

Severity: normal

Found in version 23.3.50

Fixed in version 24.0.93

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Kazuhiro Ito <kzhr <at> d1.dion.ne.jp>
Cc: cyd <at> stupidchicken.com, 9318 <at> debbugs.gnu.org
Subject: bug#9318: 23.3.50; The first call of encode-coding-region() returns wrong result
Date: Wed, 24 Aug 2011 15:06:48 +0300
> Date: Wed, 24 Aug 2011 18:37:24 +0900
> From: Kazuhiro Ito <kzhr <at> d1.dion.ne.jp>
> Cc: 9318 <at> debbugs.gnu.org
> 
> > (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?  Do you actually see any of the pointers used by this
function modified by relocation of some buffer?




This bug report was last modified 13 years and 170 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.