Debian Emacs Devel Commit: r93 - in emacs21/pkg/trunk/debian: . patches
Jerome Marant
jerome@haydn.debian.org
Sat, 09 Oct 2004 02:06:31 -0600
Author: jerome
Date: 2004-10-09 02:06:21 -0600 (Sat, 09 Oct 2004)
New Revision: 93
Added:
emacs21/pkg/trunk/debian/patches/coding-region-leak.dpatch
Modified:
emacs21/pkg/trunk/debian/changelog
emacs21/pkg/trunk/debian/patches/00list
Log:
Fix memory leak in decode-coding-region (#273919)
Modified: emacs21/pkg/trunk/debian/changelog
===================================================================
--- emacs21/pkg/trunk/debian/changelog 2004-10-08 21:00:08 UTC (rev 92)
+++ emacs21/pkg/trunk/debian/changelog 2004-10-09 08:06:21 UTC (rev 93)
@@ -1,4 +1,4 @@
-emacs21 (21.3+1-8) unstable; urgency=low
+emacs21 (21.3+1-8) unstable; urgency=medium
* Apply patch from Denis Barbier <barbier@linufr.org> allowing
Emacs to properly interpret logo keys as Meta rather than
@@ -6,7 +6,13 @@
XFree86 and Xorg introducted `fake keys'.
(closes: #255286, #274103) [Jérôme Marant]
- debian/patches/xfree86-4.3-modifiers.dpatch: new file
- - debian/patches/00list: updated
+ - debian/patches/00list: updated.
+
+ * Apply patch Florian Weimer <fw@deneb.enyo.de> fixing long-standing
+ memory leak in decode-coding-region and similar routines.
+ (closes: #273919) [Jérôme Marant]
+ - debian/patches/coding-region-leak.dpatch: new file
+ - debian/patches/00list: updated.
--
Modified: emacs21/pkg/trunk/debian/patches/00list
===================================================================
--- emacs21/pkg/trunk/debian/patches/00list 2004-10-08 21:00:08 UTC (rev 92)
+++ emacs21/pkg/trunk/debian/patches/00list 2004-10-09 08:06:21 UTC (rev 93)
@@ -17,4 +17,5 @@
startup-auto-save-file-name-transforms
python-completion-ignored-extensions
xfree86-4.3-modifiers
+coding-region-leak
fix-x-vs-no-x-diffs
Added: emacs21/pkg/trunk/debian/patches/coding-region-leak.dpatch
===================================================================
--- emacs21/pkg/trunk/debian/patches/coding-region-leak.dpatch 2004-10-08 21:00:08 UTC (rev 92)
+++ emacs21/pkg/trunk/debian/patches/coding-region-leak.dpatch 2004-10-09 08:06:21 UTC (rev 93)
@@ -0,0 +1,117 @@
+#! /bin/sh -e
+## coding-region-leak.dpatch by Florian Weimer <fw@deneb.enyo.de>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+
+## DP: This patch fixes a long-standing memory leak in decode-coding-region
+## DP: and similar routines.
+## DP: Authors: Kenichi Handa and Florian Weimer
+## DP: Status: has been incorporated upstream
+## DP: Date: Fri, 8 Oct 2004 23:13:59 +0200
+
+if [ $# -lt 1 ]; then
+ echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
+ exit 1
+fi
+
+[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
+patch_opts="${patch_opts:--f --no-backup-if-mismatch} ${2:+-d $2}"
+
+case "$1" in
+ -patch) patch -p1 ${patch_opts} < $0;;
+ -unpatch) patch -R -p1 ${patch_opts} < $0;;
+ *)
+ echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
+ exit 1;;
+esac
+
+exit 0
+
+@DPATCH@
+diff -urNad /home/fw/debian/tmp/emacs21-21.3+1/src/callproc.c emacs21-21.3+1/src/callproc.c
+--- /home/fw/debian/tmp/emacs21-21.3+1/src/callproc.c 2002-07-09 02:02:36.000000000 +0200
++++ emacs21-21.3+1/src/callproc.c 2004-09-30 09:44:42.000000000 +0200
+@@ -790,6 +790,8 @@
+ {
+ detect_coding (&process_coding, bufptr, nread);
+ if (process_coding.composing != COMPOSITION_DISABLED)
++ /* We have not yet allocated the composition
++ data because the coding type was undecided. */
+ coding_allocate_composition_data (&process_coding, PT);
+ }
+ if (process_coding.cmp_data)
+diff -urNad /home/fw/debian/tmp/emacs21-21.3+1/src/coding.c emacs21-21.3+1/src/coding.c
+--- /home/fw/debian/tmp/emacs21-21.3+1/src/coding.c 2003-03-16 23:06:55.000000000 +0100
++++ emacs21-21.3+1/src/coding.c 2004-09-30 09:44:42.000000000 +0200
+@@ -5489,8 +5489,11 @@
+ coding_allocate_composition_data (coding, from);
+ }
+
+- /* Try to skip the heading and tailing ASCIIs. */
+- if (coding->type != coding_type_ccl)
++ /* Try to skip the heading and tailing ASCIIs. We can't skip them
++ if we must run CCL program or there are compositions to
++ encode. */
++ if (coding->type != coding_type_ccl
++ && (! coding->cmp_data || coding->cmp_data->used == 0))
+ {
+ int from_byte_orig = from_byte, to_byte_orig = to_byte;
+
+@@ -5506,6 +5509,7 @@
+ if (!replace)
+ /* We must record and adjust for this new text now. */
+ adjust_after_insert (from, from_byte_orig, to, to_byte_orig, len);
++ coding_free_composition_data (coding);
+ return 0;
+ }
+
+@@ -6106,12 +6110,16 @@
+ coding_save_composition (coding, from, to, str);
+
+ /* Try to skip the heading and tailing ASCIIs. */
+- if (coding->type != coding_type_ccl)
++ if (coding->type != coding_type_ccl
++ && (! coding->cmp_data || coding->cmp_data->used == 0))
+ {
+ SHRINK_CONVERSION_REGION (&from, &to_byte, coding, XSTRING (str)->data,
+ 1);
+ if (from == to_byte)
+- return (nocopy ? str : Fcopy_sequence (str));
++ {
++ coding_free_composition_data (coding);
++ return (nocopy ? str : Fcopy_sequence (str));
++ }
+ shrinked_bytes = from + (STRING_BYTES (XSTRING (str)) - to_byte);
+ }
+
+diff -urNad /home/fw/debian/tmp/emacs21-21.3+1/src/fileio.c emacs21-21.3+1/src/fileio.c
+--- /home/fw/debian/tmp/emacs21-21.3+1/src/fileio.c 2003-02-04 11:52:40.000000000 +0100
++++ emacs21-21.3+1/src/fileio.c 2004-09-30 09:44:42.000000000 +0200
+@@ -4087,7 +4087,7 @@
+ if (how_much < 0)
+ {
+ xfree (conversion_buffer);
+-
++ coding_free_composition_data (&coding);
+ if (how_much == -1)
+ error ("IO error reading %s: %s",
+ XSTRING (orig_filename)->data, emacs_strerror (errno));
+@@ -4109,6 +4109,7 @@
+ if (bufpos == inserted)
+ {
+ xfree (conversion_buffer);
++ coding_free_composition_data (&coding);
+ emacs_close (fd);
+ specpdl_ptr--;
+ /* Truncate the buffer to the size of the file. */
+diff -urNad /home/fw/debian/tmp/emacs21-21.3+1/src/process.c emacs21-21.3+1/src/process.c
+--- /home/fw/debian/tmp/emacs21-21.3+1/src/process.c 2003-03-16 23:06:56.000000000 +0100
++++ emacs21-21.3+1/src/process.c 2004-09-30 09:44:42.000000000 +0200
+@@ -3347,6 +3347,7 @@
+ object = XPROCESS (proc)->encoding_buf;
+ encode_coding (coding, (char *) buf, XSTRING (object)->data,
+ len, STRING_BYTES (XSTRING (object)));
++ coding_free_composition_data (coding);
+ len = coding->produced;
+ buf = XSTRING (object)->data;
+ if (temp_buf)
Property changes on: emacs21/pkg/trunk/debian/patches/coding-region-leak.dpatch
___________________________________________________________________
Name: svn:executable
+ *