emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Coding system conversion error (was Re: abort in x_handle_selection_


From: Jan D.
Subject: Re: Coding system conversion error (was Re: abort in x_handle_selection_event when copying text)
Date: Tue, 08 Feb 2005 22:50:38 +0100
User-agent: Mozilla Thunderbird 1.0 (X11/20041206)

Hi.

I think I found the reason for this, but I am not sure. Can anybody with knowledge about multibyte and unibyte string representations comment on the patch below (in function allocate_string_data in alloc.c)?

Thanks,

diff -c alloc.c.~1.363.~ alloc.c
Index: alloc.c
*** alloc.c.~1.363.~    2005-01-20 21:20:32.000000000 +0100
--- alloc.c    2005-02-08 22:46:02.000000000 +0100
***************
*** 1977,1983 ****
   SDATA_NBYTES (data) = nbytes;
 #endif
   s->size = nchars;
!   s->size_byte = nbytes;
   s->data[nbytes] = '\0';
 #ifdef GC_CHECK_STRING_OVERRUN
   bcopy (string_overrun_cookie, (char *) data + needed,
--- 1977,1983 ----
   SDATA_NBYTES (data) = nbytes;
 #endif
   s->size = nchars;
!   s->size_byte = nchars != nbytes ? nbytes : -1;
   s->data[nbytes] = '\0';
 #ifdef GC_CHECK_STRING_OVERRUN
   bcopy (string_overrun_cookie, (char *) data + needed,



Jan D. wrote:

Reiner Steib wrote:

When doing this, another problem appeared.  I was copying the content
of the *Messages* buffer using M-w (`kill-ring-save') in the current
CVS Emacs.  Then I yanked (`C-y') it in the mail buffer of this Emacs
session (Emacs 21.3).

At this moment, CVS Emacs aborted, see this backtrace:

This is easy for me to reproduce, start emacs-21.3, and emacs-cvs.
In emacs-cvs:
C-h i C-x h M-w
In emacs-21.3, right click.

Apparently it is not enought with a small set of text, it must be large enough to trigger trigger this error (1025 characters, 1024 is ok).

Emacs cvs crashes in the xassert in xselect.c, lisp_data_to_selection_data:
 else if (STRINGP (obj))
   {
     xassert (! STRING_MULTIBYTE (obj));
     if (NILP (type))
   type = QSTRING;
     *format_ret = 8;
     *size_ret = SBYTES (obj);


The problem seems to be that xselect-convert-to-string in select.el returns a multibyte string when coding is compount-text-with-extensions in this call:

      ((eq type 'COMPOUND_TEXT)
       (setq str (encode-coding-string str coding)))

Most applications except Emacs apparently don't request COMPOUND_TEXT, for example UTF8_STRING works ok.

I don't know enough of these coding systems, can anybody with insight here help?

Thanks,

   Jan D.





_______________________________________________
Emacs-pretest-bug mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug






reply via email to

[Prev in Thread] Current Thread [Next in Thread]