[21.5] Fix crash in PNG initialiation [was: can't move cursor ...]
17 years, 4 months
Stephen J. Turnbull
21.5
Vin, this presumably affects 21.4 too. If you don't recall any
related reports (probably only comes up if PNG lib that gets found at
runtime differs from build-time link lib), I'll take my time....
Stephen J. Turnbull writes:
> Does `configure --with-cppflags="-newflag $CPPFLAGS" ...' work in your
> application? I think that having the `--with-whateverflags' options
> override the corresponding environment variables is easier to
> explain. It's certainly easier to code!
[[ This is in my queue but I am working on other stuff. ]]
> Ron Isaacson writes:
> > #2 is definitely not our problem. :-) I think you need to ensure that
> > png_err_stct.setjmp_buffer is set to a valid address BEFORE passing
> > png_error_func as a parameter to anything. Otherwise, any runtime
> > error from png_create_read_struct will get you into the same boat.
OK, yes, this is really ugly. (But then, when isn't a setjmp/longjmp
ugly?) I think the attached patch should fix the problem, but I don't
yet have a test case and I've never patched code involving setjmp/
longjmp before so a second opinion would be welcome (and a third...).
(I think the relevant test case for the original bug can be easily
constructed by substituting "You're going down, sucker!" for
PNG_LIBPNG_VER_STRING, but I haven't done that yet.)
The first hunk is a little suspicious; for some reason
png_destroy_read_struct() wants access to the pointer variable
containing png_ptr, not just the pointer itself. The only reason I
can think why it would want that is to NULL it, and I've done that, so
passing &tmp to png_destroy_read_struct() should be OK, I think.
The other changes are to first NULL out any unwind pointers to
structures that are being destroyed in case the libpng code longjmps,
then call libpng's finalizer; to move the setjmp call much earlier;
and to stuff the unwind structure with the the necessary data as soon
as we get it.
I guess I have to assume that none of the libpng functions will
implicitly call a finalizer....
I'll run with it a while before committing, but would really
appreciate comments.
2007-02-17 Stephen J. Turnbull <stephen(a)xemacs.org>
* glyphs-eimage.c (png_instantiate_unwind): Avoid recursion.
(png_instantiate): Initialize setjmp_buffer early, and avoid
recursive entry to error handler.
diff --git a/src/glyphs-eimage.c b/src/glyphs-eimage.c
index 49364ca..5184e2c 100644
--- a/src/glyphs-eimage.c
+++ b/src/glyphs-eimage.c
@@ -849,7 +849,13 @@ png_instantiate_unwind (Lisp_Object unwind_obj)
free_opaque_ptr (unwind_obj);
if (data->png_ptr)
- png_destroy_read_struct (&(data->png_ptr), &(data->info_ptr), (png_infopp)NULL);
+ {
+ /* ensure we can't get here again */
+ png_structp tmp = data->png_ptr;
+ data->png_ptr = NULL;
+ png_destroy_read_struct (&tmp, &(data->info_ptr), (png_infopp)NULL);
+ }
+
if (data->instream)
retry_fclose (data->instream);
@@ -874,24 +880,36 @@ png_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
png_structp png_ptr;
png_infop info_ptr;
+ xzero (unwind);
+ record_unwind_protect (png_instantiate_unwind, make_opaque_ptr (&unwind));
+
+ if (setjmp (png_err_stct.setjmp_buffer))
+ {
+ /* Something blew up:
+ just display the error (cleanup happens in the unwind) */
+ signal_image_error_2 ("Error decoding PNG",
+ build_string(png_err_stct.err_str),
+ instantiator);
+ }
+
/* Initialize all PNG structures */
- png_ptr = png_create_read_struct (PNG_LIBPNG_VER_STRING, (void*)&png_err_stct,
+ png_ptr = png_create_read_struct (PNG_LIBPNG_VER_STRING,
+ (void *) &png_err_stct,
png_error_func, png_warning_func);
if (!png_ptr)
signal_image_error ("Error obtaining memory for png_read", instantiator);
+ unwind.png_ptr = png_ptr;
+
info_ptr = png_create_info_struct (png_ptr);
if (!info_ptr)
{
+ unwind.png_ptr = NULL; /* avoid re-calling png_destroy_read_struct
+ when unwinding */
png_destroy_read_struct (&png_ptr, (png_infopp)NULL, (png_infopp)NULL);
signal_image_error ("Error obtaining memory for png_read", instantiator);
}
-
- xzero (unwind);
- unwind.png_ptr = png_ptr;
unwind.info_ptr = info_ptr;
- record_unwind_protect (png_instantiate_unwind, make_opaque_ptr (&unwind));
-
/* This code is a mixture of stuff from Ben's GIF/JPEG stuff from
this file, example.c from the libpng 0.81 distribution, and the
pngtopnm sources. -WMP-
@@ -900,16 +918,6 @@ png_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
and is no longer usable for previous versions. jh
*/
- /* Set the jmp_buf return context for png_error ... if this returns !0, then
- we ran into a problem somewhere, and need to clean up after ourselves. */
- if (setjmp (png_err_stct.setjmp_buffer))
- {
- /* Something blew up: just display the error (cleanup happens in the unwind) */
- signal_image_error_2 ("Error decoding PNG",
- build_string(png_err_stct.err_str),
- instantiator);
- }
-
/* Initialize the IO layer and read in header information */
{
Lisp_Object data = find_keyword_in_vector (instantiator, Q_data);
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
[PATCH] fix buffer overrun in pdump_load()
17 years, 4 months
Nix
The initial problem was easy to describe: starting XEmacs with absolute
paths was broken (at least it is if you use a separate .dmp file, which
I'm constrained to right now because I'm using the new GC.)
loki 1686 /usr/packages/xemacs/i686-loki% which xemacs
/usr/bin/xemacs
loki 1687 /usr/packages/xemacs/i686-loki% xemacs -vanilla -batch -eval '(message "foo")'
foo
loki 1685 /usr/packages/xemacs/i686-loki% /usr/bin/xemacs -vanilla -batch -eval '(message "foo")'
temacs can only be run in -batch mode.
strace and valgrind (and a bit of gdb) pinpoint the cause:
loki 1688 /usr/packages/xemacs/i686-loki% strace -e open /usr/bin/xemacs -vanilla -batch -eval '(message "foo")'
[...]
open("/lib/libpthread.so.0", O_RDONLY) = 3
open("", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/etc/fonts/fonts.conf", O_RDONLY|O_LARGEFILE) = 3
[...]
==29209== Syscall param open(filename) points to unaddressable byte(s)
==29209== at 0x4D873272: open64 (in /lib/libc-2.4.so)
==29209== Address 0xBEBA0070 is not stack'd, malloc'd or (recently) free'd
If you're unlucky, that "" turns into an -EFAULT, and if you're *really*
unlucky, you get a segfault.
This is happening because in src/dumper.c:pdump_load(), exe_path is
being sized as (if XEmacs is invoked with an absolute path) one byte
longer than the length of the directory component of the name, or (if
XEmacs is invoked with a relative path) ten bytes longer than the larger
of the name and PATH variable...
... and then pdump_load() calls pdump_file_try(), which proceeds to
sprintf() things on the end of it, like "-21.5-b27-453712b7.dmp". Oops,
there's no room for that. Instant buffer overrun, and because that
structure is alloca()ed a lot of the time, instant stack overrun as
well, which if you're unlucky blows away a pile of variables,
invalidates `exe_path', et seq ad nauseam.
(Probably nobody's noticed this because most of the time XEmacs is
invoked without an absolute path, and most people have a PATH that is
much longer than five characters. I don't know what the ten bytes of
slop are for: it's not even long enough for `-21.4.16.dmp'...)
I've `fixed' this by moving from incorrect dynamic allocation to
arguably inefficient-but-who-cares static allocation: it's way too much
work to realloc() this string, and it's also way too much work to
determine the maximum possible length of that string (plus it's brittle;
the next time someone changes the filename construction method,
*boom*). This necessitated a tiny fix to text.h before PATH_MAX_EXTERNAL
could be used on non-Windows systems at all...
You may want to fix the fix if using PATH_MAX_{INTERNAL,EXTERNAL} is
really as bad as all that.
(This patch is against CVS HEAD.)
2006-10-26 Nix <nix(a)esperi.org.uk>
* dumper.c (pdump_load): Statically allocate a large enough
exe_path for all conceivable uses. Fixes a buffer overrun.
* text.h (MAX_XETCHAR_SIZE): Define, for PATH_MAX_EXTERNAL.
Index: 21.5/src/dumper.c
===================================================================
--- 21.5.orig/src/dumper.c 2006-10-26 00:29:53.000000000 +0100
+++ 21.5/src/dumper.c 2006-10-26 00:30:21.000000000 +0100
@@ -2658,7 +2658,7 @@
wext_strcpy (exe_path, wexe);
}
#else /* !WIN32_NATIVE */
- Wexttext *exe_path;
+ Wexttext exe_path[PATH_MAX_EXTERNAL];
Wexttext *w;
const Wexttext *dir, *p;
@@ -2692,8 +2692,7 @@
if (p != dir)
{
/* invocation-name includes a directory component -- presumably it
- is relative to cwd, not $PATH */
- exe_path = alloca_array (Wexttext, 1 + wext_strlen (dir));
+ is relative to cwd, not $PATH. */
wext_strcpy (exe_path, dir);
}
else
@@ -2701,9 +2700,6 @@
const Wexttext *path = wext_getenv ("PATH"); /* not egetenv --
not yet init. */
const Wexttext *name = p;
- exe_path = alloca_array (Wexttext,
- 10 + max (wext_strlen (name),
- wext_strlen (path)));
for (;;)
{
p = path;
Index: 21.5/src/text.h
===================================================================
--- 21.5.orig/src/text.h 2006-10-26 00:29:53.000000000 +0100
+++ 21.5/src/text.h 2006-10-26 00:30:21.000000000 +0100
@@ -2988,6 +2988,7 @@
/* Extra indirection needed in case of manifest constant as arg */
#define WEXTSTRING_1(arg) L##arg
#define WEXTSTRING(arg) WEXTSTRING_1(arg)
+#define MAX_XETCHAR_SIZE sizeof (WCHAR)
#define wext_strlen wcslen
#define wext_strcmp wcscmp
#define wext_strncmp wcsncmp
@@ -3013,6 +3014,7 @@
#else
#define WEXTTEXT_ZTERM_SIZE sizeof (char)
#define WEXTSTRING(arg) arg
+#define MAX_XETCHAR_SIZE sizeof (char)
#define wext_strlen strlen
#define wext_strcmp strcmp
#define wext_strncmp strncmp
--
`When we are born we have plenty of Hydrogen but as we age our
Hydrogen pool becomes depleted.'
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
[PATCH] Fix numeric overflow leading to failure to GC
17 years, 4 months
Nix
This is the fix for the dreaded memory leak, which isn't a memory leak
at all (which kind of explains why it was so hard to find when I was
looking for leaks).
A clue to the problem is that you can make the leak go away by setting
`gc-cons-percentage' to zero.
I instrumented recompute_need_to_garbage_collect() in gc.c to report the
total memory usage at GC and the percentage used whenever the
percentage-based counting should kick in. It kicked in when I'd
expected: with the default setting for gc-cons-percentage of 40 and a
gc-cons-threshold of 40000000, when the total memory consumed
approximated 70Mb. It soon became obvious that something was very wrong:
total gc usage: 56471356; GC percentage used: -5
[...]
total gc usage: 56471356; GC percentage used: -1
total gc usage: 56471356; GC percentage used: 0
total gc usage: 56471356; GC percentage used: 1
[...]
(consing-since-gc was rising all along, at about 75000000 at this
point, but I wasn't printing it out in this debugging dump.)
The problem is numeric overflow in the percentage-comparison code:
(!total_gc_usage_set ||
(100 * consing_since_gc) / total_gc_usage >=
gc_cons_percentage)
Obviously if consing-since-gc is bigger than about 20Mb (since this is a
*signed* integer) we're pretty much dead; each time around, we allow the
heap to bloat more and more, and GC less and less often: heap
fragmentation just makes things worse, because memory's vanishingly
rarely going to get given back to the OS as long as GCs get less and
less frequent like this.
(This also explains why this leak takes some time to kick in: XEmacs has
to load enough to be governed by gc-cons-percentage rather than
gc-cons-threshold in the first place, particularly if you've got it set
as high as I have. It turns up less often when not using X because not
loading the X stuff means that the total_gc_usage takes longer to reach
that threshold.)
2006-12-29 Nix <nix(a)esperi.org.uk>
* gc.c (recompute_need_to_garbage_collect): Avoid numeric
overflow in percentage calculation.
Index: 21.5/src/gc.c
===================================================================
--- 21.5.orig/src/gc.c 2006-12-29 18:21:43.000000000 +0000
+++ 21.5/src/gc.c 2006-12-29 22:11:22.000000000 +0000
@@ -314,12 +314,12 @@
(consing_since_gc > gc_cons_threshold
&&
#if 0 /* #### implement this better */
- (100 * consing_since_gc) / total_data_usage () >=
- gc_cons_percentage
+ ((double)consing_since_gc) / total_data_usage()) >=
+ ((double)gc_cons_percentage / 100)
#else
(!total_gc_usage_set ||
- (100 * consing_since_gc) / total_gc_usage >=
- gc_cons_percentage)
+ ((double)consing_since_gc / total_gc_usage) >=
+ ((double)gc_cons_percentage / 100))
#endif
);
recompute_funcall_allocation_flag ();
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
Prevent infinite recursion with undecided coding system
17 years, 5 months
Michael Sperber
This has been haunting me forever. I'll apply Thursday if nobody
objects.
2007-07-31 Mike Sperber <mike(a)xemacs.org>
* file-coding.c (undecided_convert): Kludge to prevent infinite
recursion.
--
Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla
Index: src/file-coding.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/file-coding.c,v
retrieving revision 1.57
diff -u -r1.57 file-coding.c
--- src/file-coding.c 22 Jul 2007 22:04:13 -0000 1.57
+++ src/file-coding.c 31 Jul 2007 15:46:41 -0000
@@ -3869,6 +3869,9 @@
random result when doing subprocess detection. */
detect_coding_type (data->st, src, n);
data->actual = detected_coding_system (data->st);
+ /* kludge to prevent infinite recursion */
+ if (XCODING_SYSTEM(data->actual)->methods->enumtype == undecided_coding_system)
+ data->actual = Fget_coding_system (Qraw_text);
}
}
/* We need to set the detected coding system if we actually have
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
[C] xemacsweb: Update InnoSetup Release Information
17 years, 5 months
Adrian Aichner
COMMIT
xemacsweb ChangeLog patch:
Diff command: cvs -q diff -U 0
Files affected: Download/win32/ChangeLog
Index: Download/win32/ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacsweb/Download/win32/ChangeLog,v
retrieving revision 1.55
diff -u -U0 -r1.55 ChangeLog
--- Download/win32/ChangeLog 28 Jul 2007 11:06:34 -0000 1.55
+++ Download/win32/ChangeLog 30 Jul 2007 20:43:57 -0000
@@ -0,0 +1,4 @@
+2007-07-30 Adrian Aichner <adrian(a)xemacs.org>
+
+ * index.content: Update InnoSetup Release Information.
+
xemacsweb source patch:
Diff command: cvs -f -z3 -q diff -u -w -N
Files affected: Download/win32/index.content
===================================================================
RCS
Index: Download/win32/index.content
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacsweb/Download/win32/index.content,v
retrieving revision 1.42
diff -u -w -r1.42 index.content
--- Download/win32/index.content 30 Jul 2006 10:23:26 -0000 1.42
+++ Download/win32/index.content 30 Jul 2007 20:43:17 -0000
@@ -26,11 +26,12 @@
<dl>
<!-- one of (dd dt) -->
- <dt>XEmacs 21.4.19 "Constant Variable"</dt>
+ <dt>XEmacs 21.4.20 "Double Solitaire"</dt>
<dd>
<p>
- This native Windows setup kit includes a small set of
- packages:
+ This native Windows setup kit of the <a href="<!-- _GP_
+ relPath(qq{Releases/21.4.20.html}) -->">XEmacs 21.4.20
+ Release</a> includes a small set of packages:
</p>
<p>
c-support, cc-mode, debug, dired, ecb, edebug, ediff,
--
Adrian Aichner
mailto:adrian@xemacs.org
http://www.xemacs.org/
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
[C] xemacs-builds: Minor update of adrian/website/package-get-2-download-sites.el
17 years, 5 months
Adrian Aichner
COMMIT
xemacs-builds ChangeLog patch:
Diff command: cvs -q diff -U 0
Files affected: ChangeLog
Index: ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs-builds/ChangeLog,v
retrieving revision 1.76
diff -u -U0 -r1.76 ChangeLog
--- ChangeLog 22 Jun 2007 23:28:34 -0000 1.76
+++ ChangeLog 29 Jul 2007 17:22:42 -0000
@@ -0,0 +1,16 @@
+2007-07-29 Adrian Aichner <adrian(a)xemacs.org>
+
+ * adrian/website/package-get-2-download-sites.el:
+ * adrian/website/package-get-2-download-sites.el
+ (package-get-2-download-sites-experimental-packages-regex): New.
+ * adrian/website/package-get-2-download-sites.el
+ (package-get-2-download-sites-netinstall): Use
+ `package-get-2-download-sites-experimental-packages-regex'.
+ * adrian/website/package-get-2-download-sites.el
+ (package-get-2-download-sites-installshield): Use
+ `package-get-2-download-sites-experimental-packages-regex'.
+ * adrian/website/package-get-2-download-sites.el
+ (package-get-2-download-sites-innosetup): Use
+ `package-get-2-download-sites-experimental-packages-regex'.
+ Update for 21.4.20 kit.
+
xemacs-builds source patch:
Diff command: cvs -f -z3 -q diff -u -w -N
Files affected: adrian/website/package-get-2-download-sites.el
===================================================================
RCS
Index: adrian/website/package-get-2-download-sites.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs-builds/adrian/website/package-get-2-download-sites.el,v
retrieving revision 1.9
diff -u -w -r1.9 package-get-2-download-sites.el
--- adrian/website/package-get-2-download-sites.el 22 Jun 2007 23:28:37 -0000 1.9
+++ adrian/website/package-get-2-download-sites.el 29 Jul 2007 17:20:34 -0000
@@ -44,6 +44,10 @@
"c:\\Hacking\\cvs.xemacs.org\\XEmacs\\xemacsweb\\"
"Put output files of `package-get-2-download-sites' in hierarchy under this directory.")
+(defconst package-get-2-download-sites-experimental-packages-regex
+"[^/]+/experimental/packages$"
+"Regular expression matching package pre-release path.")
+
; Missing from package-get.el:
; ftp://ftp.planetmirror.com/pub/xemacs/beta/experimental/packages/
; ** Ping ** ping ** ftp.au.xemacs.org
@@ -146,8 +150,8 @@
(second e)
(replace-in-string
(third e)
- "/[^/]+/experimental/packages$"
- "/binaries/win32/netinstall/xemacs-i586-pc-win32-21.4.13.tar.gz")))
+ package-get-2-download-sites-experimental-packages-regex
+ "binaries/win32/netinstall/xemacs-i586-pc-win32-21.4.13.tar.gz")))
package-get-pre-release-download-sites))
(defun package-get-2-download-sites-installshield ()
@@ -157,8 +161,8 @@
(second e)
(replace-in-string
(third e)
- "/[^/]+/experimental/packages$"
- "/binaries/win32/installshield/xemacs-21.5.17.exe")))
+ package-get-2-download-sites-experimental-packages-regex
+ "binaries/win32/installshield/xemacs-21.5.17.exe")))
package-get-pre-release-download-sites))
(defun package-get-2-download-sites-innosetup ()
@@ -168,8 +172,8 @@
(second e)
(replace-in-string
(third e)
- "/[^/]+/experimental/packages$"
- "/binaries/win32/InnoSetup/XEmacs%20Setup%2021.4.19.exe")))
+ package-get-2-download-sites-experimental-packages-regex
+ "binaries/win32/InnoSetup/XEmacs_Setup_21.4.20.exe")))
package-get-pre-release-download-sites))
; package-get-2-download-sites-gamma
--
Adrian Aichner
mailto:adrian@xemacs.org
http://www.xemacs.org/
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
[COMMIT] Have fsf-compat-unicode.el behave better on 21.4
17 years, 5 months
Aidan Kehoe
APPROVE COMMIT.
(This is actually embarrassing if you look closely at the diff.)
NOTE: This patch has been committed.
mule-packages/mule-base/ChangeLog addition:
2007-07-29 Aidan Kehoe <kehoea(a)parhasard.net>
* fsf-compat-unicode.el:
* fsf-compat-unicode.el (and):
* fsf-compat-unicode.el (fsf-compat-ccl-program):
* fsf-compat-unicode.el (fsf-compat-init-mule-unicode-charsets):
Shifting the arguments to mule-to-unicode 7 bits was appropriate,
but for redisplay r1 needs to be the highest octet, r2 the lowest,
of the 16-bit UCS code.
text-conversion-error is not available on 21.4, so it turns out
the code fails in a more ugly way thatn I wanted there.
XEmacs Packages source patch:
Diff command: cvs -q diff -Nu
Files affected: mule-packages/mule-base/fsf-compat-unicode.el
===================================================================
RCS
Index: mule-packages/mule-base/fsf-compat-unicode.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/mule-packages/mule-base/fsf-compat-unicode.el,v
retrieving revision 1.4
diff -u -u -r1.4 fsf-compat-unicode.el
--- mule-packages/mule-base/fsf-compat-unicode.el 2007/07/27 20:30:23 1.4
+++ mule-packages/mule-base/fsf-compat-unicode.el 2007/07/29 11:02:52
@@ -28,23 +28,22 @@
;;; Code:
-;;; Only for 21.5 and newer.
+;;; Only for 21.5 and newer. Compiles with 21.4 fine.
(eval-when-compile (require 'ccl))
;; Check at runtime that the Unicode support is available, and that its
;; coverage is good enough.
-(unless (if-fboundp 'encode-char
- (with-fboundp '(encode-char decode-char)
- (eq #x31C (encode-char (decode-char 'ucs #x31C) 'ucs))))
- (error 'text-conversion-error
+(unless (and (fboundp 'encode-char)
+ (eq #x31C (encode-char (decode-char 'ucs #x31C) 'ucs)))
+ (error 'unimplemented
"Unicode support needed is not available in your XEmacs."))
;; For redisplay of these character sets, provide a CCL program to address
;; iso10646-1 X11 fonts.
(defvar fsf-compat-ccl-program
(eval-when-compile
- (let ((pre-existing [1 10 131127 7 98872 65823 147513 7 82009 127 22]))
+ (let ((pre-existing [1 10 131127 7 98872 65823 147513 8 82009 255 22]))
(when (and (> emacs-major-version 20) (> emacs-minor-version 4)
(featurep 'mule))
;; In the event that we're compiling on 21.5, check that the
@@ -56,8 +55,8 @@
((r1 = (r1 << 7))
(r1 = (r1 | r2))
(mule-to-unicode r0 r1)
- (r1 = (r0 >> 7))
- (r2 = (r0 & #x7F))))))
+ (r1 = (r0 >> 8))
+ (r2 = (r0 & #xFF))))))
nil
"The pre-compiled CCL program appears broken. "))
pre-existing))
@@ -87,9 +86,9 @@
chars 96
columns 1
direction l2r
- final final
+ final ,final
graphic 0
- short-name ,(format "Unicode subset %c" final)
+ short-name ,(format "Unicode subset U+%04X" first-ucs)
long-name ,(format "Unicode subset (U+%04X..U+%04X)"
first-ucs last-ucs)
ccl-program ,fsf-compat-ccl-program))
--
On the quay of the little Black Sea port, where the rescued pair came once
more into contact with civilization, Dobrinton was bitten by a dog which was
assumed to be mad, though it may only have been indiscriminating. (Saki)
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
[COMMIT] Don't creat JIT mappings for U+0080-U+00FF at dump time
17 years, 5 months
Aidan Kehoe
APPROVE COMMIT
NOTE: This patch has been committed.
It turns out that a call to make-8-bit-coding-system at dump time (and not
at byte-compile time) like so:
(make-8-bit-coding-system
'windows-1252
(list
(list #x80 (decode-char 'ucs #x20AC)) ;; EURO SIGN
(list #x82 (decode-char 'ucs #x201A)) ;; SINGLE LOW-9 QUOTATION MARK
[...]
(list #x9F (decode-char 'ucs #x0178)));; LATIN CAPITAL LETTER Y WITH DIAERESIS
"Microsoft's Code Page 1252, for Western Europe and the Americas."
'(mnemonic "cp1252"
documentation
"This is an extension of ISO 8859-1 that provides the Euro sign and
several punctuation marks not otherwise available in ISO 8859 1. It is
incompatible with ISO 2022, which is not a problem in the regions
where it is used. "
aliases (cp1252)))
created JIT mappings for U+00A0 to U+00FF at dump time. So files read in
using windows-1252 had Latin 1 characters distinct from the XEmacs Latin 1
characters. This patch changes that.
lisp/ChangeLog addition:
2007-07-28 Aidan Kehoe <kehoea(a)parhasard.net>
* mule/mule-coding.el (make-8-bit-create-decode-encode-tables):
Don't creat JIT mappings for U+0080-U+00FF at dump time.
XEmacs Trunk source patch:
Diff command: cvs -q diff -Nu
Files affected: lisp/mule/mule-coding.el
===================================================================
RCS
Index: lisp/mule/mule-coding.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/mule/mule-coding.el,v
retrieving revision 1.21
diff -u -u -r1.21 mule-coding.el
--- lisp/mule/mule-coding.el 2007/07/27 18:56:53 1.21
+++ lisp/mule/mule-coding.el 2007/07/28 09:26:38
@@ -480,8 +480,13 @@
;; it'll be something else.
(setq desired-ucs (+ private-use-start desired-ucs)
private-use-start (+ private-use-start 1)))
- (aset decode-table i (decode-char 'ucs desired-ucs))
- (puthash desired-ucs (int-to-char i) encode-table)))
+ (puthash desired-ucs (int-to-char i) encode-table)
+ (setq desired-ucs (if (> desired-ucs #xFF)
+ (decode-char 'ucs desired-ucs)
+ ;; So we get Latin-1 when run at dump time,
+ ;; instead of JIT-allocated characters.
+ (int-to-char desired-ucs)))
+ (aset decode-table i desired-ucs)))
(values decode-table encode-table)))
(defun make-8-bit-generate-decode-program (decode-table)
--
On the quay of the little Black Sea port, where the rescued pair came once
more into contact with civilization, Dobrinton was bitten by a dog which was
assumed to be mad, though it may only have been indiscriminating. (Saki)
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
[COMMIT] Don't map any BIG5 characters to U+FFFD.
17 years, 5 months
Aidan Kehoe
Mike, this commits that change.
APPROVE COMMIT
NOTE: This patch has been committed.
etc/ChangeLog addition:
2007-07-28 Aidan Kehoe <kehoea(a)parhasard.net>
* unicode/unicode-consortium/BIG5.TXT:
Don't map any characters to U+FFFD; for round trip compatibility,
map those that were mapped to U+FFFD to the Unicode private use
area.
XEmacs Trunk source patch:
Diff command: cvs -q diff -Nu
Files affected: etc/unicode/unicode-consortium/BIG5.TXT
===================================================================
RCS
Index: etc/unicode/unicode-consortium/BIG5.TXT
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/etc/unicode/unicode-consortium/BIG5.TXT,v
retrieving revision 1.3
diff -u -u -r1.3 BIG5.TXT
--- etc/unicode/unicode-consortium/BIG5.TXT 2007/01/27 18:29:03 1.3
+++ etc/unicode/unicode-consortium/BIG5.TXT 2007/07/28 08:22:35
@@ -58,6 +58,11 @@
# We currently map all of these characters to U+FFFD REPLACEMENT CHARACTER.
# It is also possible to map these characters to their duplicates, or to
# the user zone.
+#
+# XEmacs change; we map them to private use characters above
+# U+F0000. 0xA15A => U+FA15A, and so on. See
+# http://mid.gmane.org/s3tsl7j7zg9.fsf@magellan.suse.de and related
+# discussion.
#
# Notes:
#
@@ -118,7 +123,7 @@
0xA157 0xFE31 # PRESENTATION FORM FOR VERTICAL EM DASH
0xA158 0x2014 # EM DASH
0xA159 0xFE33 # PRESENTATION FORM FOR VERTICAL LOW LINE
-0xA15A 0xFFFD # *** NO MAPPING ***
+0xA15A 0xFA15A # #### PRIVATE USE
0xA15B 0xFE34 # PRESENTATION FORM FOR VERTICAL WAVY LOW LINE
0xA15C 0xFE4F # WAVY LOW LINE
0xA15D 0xFF08 # FULLWIDTH LEFT PARENTHESIS
@@ -189,9 +194,9 @@
0xA1C0 0x32A3 # CIRCLED IDEOGRAPH CORRECT
0xA1C1 0x2105 # CARE OF
0xA1C2 0x203E # OVERLINE
-0xA1C3 0xFFFD # *** NO MAPPING ***
+0xA1C3 0xFA1C3 # #### PRIVATE USE
0xA1C4 0xFF3F # FULLWIDTH LOW LINE
-0xA1C5 0xFFFD # *** NO MAPPING ***
+0xA1C5 0xFA1C5 # #### PRIVATE USE
0xA1C6 0xFE49 # DASHED OVERLINE
0xA1C7 0xFE4A # CENTRELINE OVERLINE
0xA1C8 0xFE4D # DASHED LOW LINE
@@ -248,8 +253,8 @@
0xA1FB 0x2198 # SOUTH EAST ARROW
0xA1FC 0x2225 # PARALLEL TO
0xA1FD 0x2223 # DIVIDES
-0xA1FE 0xFFFD # *** NO MAPPING ***
-0xA240 0xFFFD # *** NO MAPPING ***
+0xA1FE 0xFA1FE # #### PRIVATE USE
+0xA240 0xFA240 # #### PRIVATE USE
0xA241 0xFF0F # FULLWIDTH SOLIDUS
0xA242 0xFF3C # FULLWIDTH REVERSE SOLIDUS
0xA243 0xFF04 # FULLWIDTH DOLLAR SIGN
@@ -355,9 +360,9 @@
0xA2C9 0x3027 # HANGZHOU NUMERAL SEVEN
0xA2CA 0x3028 # HANGZHOU NUMERAL EIGHT
0xA2CB 0x3029 # HANGZHOU NUMERAL NINE
-0xA2CC 0xFFFD # *** NO MAPPING ***
+0xA2CC 0xFA2CC # #### PRIVATE USE
0xA2CD 0x5344 # <CJK>
-0xA2CE 0xFFFD # *** NO MAPPING ***
+0xA2CE 0xFA2CE # #### PRIVATE USE
0xA2CF 0xFF21 # FULLWIDTH LATIN CAPITAL LETTER A
0xA2D0 0xFF22 # FULLWIDTH LATIN CAPITAL LETTER B
0xA2D1 0xFF23 # FULLWIDTH LATIN CAPITAL LETTER C
--
On the quay of the little Black Sea port, where the rescued pair came once
more into contact with civilization, Dobrinton was bitten by a dog which was
assumed to be mad, though it may only have been indiscriminating. (Saki)
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches