From: Kazuhiro Ito <kzhr@d1.dion.ne.jp>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 9318@debbugs.gnu.org
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 [thread overview]
Message-ID: <20110825095519.F1D042C803A@msa105.auone-net.jp> (raw)
In-Reply-To: <83ty97ggiv.fsf@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?
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
next prev parent reply other threads:[~2011-08-25 9:49 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-18 9:01 bug#9318: 23.3.50; The first call of encode-coding-region() returns wrong result on on Windows Kazuhiro Ito
2011-08-18 9:48 ` Andreas Schwab
2011-08-18 21:33 ` Kazuhiro Ito
2011-08-19 13:46 ` bug#9318: 23.3.50; The first call of encode-coding-region() returns wrong result Kazuhiro Ito
2011-08-20 21:26 ` Chong Yidong
2011-08-21 0:17 ` Kazuhiro Ito
2011-08-24 9:37 ` Kazuhiro Ito
2011-08-24 12:06 ` Eli Zaretskii
2011-08-25 9:49 ` Kazuhiro Ito [this message]
2011-08-24 17:59 ` Andreas Schwab
2011-08-25 9:54 ` Kazuhiro Ito
2011-08-26 11:41 ` Kazuhiro Ito
2011-08-28 0:04 ` Kazuhiro Ito
2011-08-30 23:30 ` Kazuhiro Ito
2011-12-01 1:56 ` Kenichi Handa
2011-12-05 7:10 ` Kenichi Handa
2011-12-05 11:31 ` Kazuhiro Ito
2011-12-05 9:11 ` Paul Eggert
2011-12-06 0:30 ` Kenichi Handa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110825095519.F1D042C803A@msa105.auone-net.jp \
--to=kzhr@d1.dion.ne.jp \
--cc=9318@debbugs.gnu.org \
--cc=eliz@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.