[PATCH] fix buffer overrun in pdump_load()
17 years, 1 month
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 21.5] Starting XEmacs 21.5 via cygwin's run command
17 years, 1 month
Vin Shelton
Since last November, 21.5 has contained a problem where starting a
cygwin XEmacs via the cygwin run command brought up the initial window
unmapped. See this posting for details:
http://calypso.tux.org/pipermail/xemacs-patches/2006-November/000041.html
Here are the basic steps needed to observe the problem:
1. In a cmd window (not a cygwin shell), use the cygwin run command to
start a 21.5 xemacs. On my system, I can do this like so:
run /usr/local/bin/xemacs
2. The XEmacs window will not appear on the screen or on the taskbar,
although the XEmacs process will start, as you can verify with the
Task Manager. You can connect to the process with gnuclient
if you have started gnuserv in your XEmacs startup. Otherwise,
the XEmacs is unreachable.
While perusing the 21.4 source for frame-msw.c, I noticed the
following definition for mswindows_init_frame_3:
/* Called after frame's properties are set */
static void
mswindows_init_frame_3 (struct frame *f)
{
/* Don't do this earlier or we get a WM_PAINT before the frame is ready.
* The SW_x parameter in the first call that an app makes to ShowWindow is
* ignored, and the parameter specified in the caller's STARTUPINFO is
* substituted instead. That parameter is SW_HIDE if we were started by
* runemacs, so call this twice. #### runemacs is evil */
ShowWindow (FRAME_MSWINDOWS_HANDLE(f), SW_SHOWNORMAL);
ShowWindow (FRAME_MSWINDOWS_HANDLE(f), SW_SHOWNORMAL);
SetForegroundWindow (FRAME_MSWINDOWS_HANDLE(f));
DragAcceptFiles (FRAME_MSWINDOWS_HANDLE(f), TRUE);
}
Johnathan Harris edited the 21.5 version to remove the second call to
ShowWindow in May of 2002:
2002-05-06 Jonathan Harris <jonathan(a)xemacs.org>
* frame-msw.c (mswindows_init_frame_3):
Remove obsolete runemacs hack which called ShowWindow() twice.
While I agree with the sentiment that 2 calls to ShowWindow is a hack,
it appears that the second call is necessary in this instance -
restoring the second call to ShowWindow makes the initial frame
appear. This patch does restores mswindow_init_frame_3 to the
definition as it appears in 21.4.
--- src/ChangeLog~ 2007-08-17 07:46:16.184467000 -0400
+++ src/ChangeLog 2007-08-18 15:35:35.468750000 -0400
@@ -0,0 +1,7 @@
+2007-08-18 Vin Shelton <acs(a)xemacs.org>
+
+ * frame-msw.c (mswindows_init_frame_3): Restore extra call to
+ ShowWindow so that cygwin's run command can be used to open an
+ XEmacs session. Without out this, no frame appears when the
+ XEmacs process starts up.
+
--- src/frame-msw.c.orig 2007-08-15 09:01:09.769610000 -0400
+++ src/frame-msw.c 2007-08-18 15:32:48.156250000 -0400
@@ -304,10 +304,15 @@
static void
mswindows_init_frame_3 (struct frame *f)
{
- /* Don't do this earlier or we get a WM_PAINT before the frame is ready */
- ShowWindow (FRAME_MSWINDOWS_HANDLE (f), SW_SHOWNORMAL);
- SetForegroundWindow (FRAME_MSWINDOWS_HANDLE (f));
- DragAcceptFiles (FRAME_MSWINDOWS_HANDLE (f), TRUE);
+ /* Don't do this earlier or we get a WM_PAINT before the frame is ready.
+ * The SW_x parameter in the first call that an app makes to ShowWindow is
+ * ignored, and the parameter specified in the caller's STARTUPINFO is
+ * substituted instead. That parameter is SW_HIDE if we were started by
+ * runemacs, so call this twice. #### runemacs is evil */
+ ShowWindow (FRAME_MSWINDOWS_HANDLE(f), SW_SHOWNORMAL);
+ ShowWindow (FRAME_MSWINDOWS_HANDLE(f), SW_SHOWNORMAL);
+ SetForegroundWindow (FRAME_MSWINDOWS_HANDLE(f));
+ DragAcceptFiles (FRAME_MSWINDOWS_HANDLE(f), TRUE);
}
static void
I will apply this patch in a few days if no one objects.
Discussion welcome.
Regards,
Vin
--
The Journey by Mary Oliver
http://www.poemhunter.com/p/m/poem.asp?poet=6771&poem=30506
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
Make `current-window-configuration' work as documented
17 years, 1 month
Michael Sperber
And, hardly three years later after you precisely reported the problem,
here's a fix. Sorry for the huge delay! (And thanks for the original
report!)
I'll apply Wednesday-ish if nobody objects.
Yoshiaki Kasahara <kasahara(a)nc.kyushu-u.ac.jp> writes:
> On Sun, 04 Apr 2004 11:25:29 +0200,
> Michael Sperber <sperber(a)informatik.uni-tuebingen.de> said:
>
>> Can you provide a recipe for reproducing the problem?
>
> Well, how about this simple example?
>
> in *scratch* buffer:
>
> (setq wc (current-window-configuration)) <hit "C-j">
> <hit "C-x 2" to split the frame>
> (set-window-configuration wc) <hit "C-j">
>
> You will see the cursor returns to the next line of "(setq ...". When
> I did the same things in other kinds of Emacs, the cursor didn't jump
> and stay after the line of "(set-window..".
2007-08-20 Mike Sperber <mike(a)xemacs.org>
* window-xemacs.el (root-window->saved-window):
(restore-saved-window-parameters): Don't save the point of the
current buffer, as per the docstring.
--
Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla
Index: lisp/window-xemacs.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/window-xemacs.el,v
retrieving revision 1.25
diff -u -r1.25 window-xemacs.el
--- lisp/window-xemacs.el 31 Oct 2006 09:16:29 -0000 1.25
+++ lisp/window-xemacs.el 20 Aug 2007 14:19:51 -0000
@@ -278,11 +278,10 @@
(let ((marker (make-marker)))
(set-marker marker (window-start window) buffer)
(setf (saved-window-start-marker saved-window) marker))
- (let ((marker (make-marker)))
- (if (eq window (selected-window))
- (set-marker marker (point buffer) buffer)
- (set-marker marker (window-point window) buffer))
- (setf (saved-window-point-marker saved-window) marker))
+ (if (not (eq buffer (current-buffer)))
+ (let ((marker (make-marker)))
+ (set-marker marker (window-point window) buffer)
+ (setf (saved-window-point-marker saved-window) marker)))
(setf (saved-window-mark-marker saved-window)
(copy-marker (mark-marker t buffer)))))
saved-window))))
@@ -417,8 +416,9 @@
(set-window-start window
(marker-position (saved-window-start-marker saved-window))
t)
- (set-window-point window
- (marker-position (saved-window-point-marker saved-window)))
+ (if (markerp (saved-window-point-marker saved-window))
+ (set-window-point window
+ (marker-position (saved-window-point-marker saved-window))))
(set-marker (mark-marker t buffer)
(marker-position (saved-window-mark-marker saved-window))
buffer)
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
[C] xemacsweb: Remove addresss markup for archives currently unavailable on calypso
17 years, 1 month
Adrian Aichner
COMMIT
All these links will have to be touched again anyways when our
archives come back.
Adrian
xemacsweb ChangeLog patch:
Diff command: cvs -q diff -U 0
Files affected: Lists/ChangeLog
Index: Lists/ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacsweb/Lists/ChangeLog,v
retrieving revision 1.30
diff -u -U0 -r1.30 ChangeLog
--- Lists/ChangeLog 24 Mar 2007 15:30:43 -0000 1.30
+++ Lists/ChangeLog 21 Aug 2007 22:01:01 -0000
@@ -0,0 +1,5 @@
+2007-08-21 Adrian Aichner <adrian(a)xemacs.org>
+
+ * index.content: Remove addresss markup for archives currently
+ unavailable on calypso.
+
xemacsweb source patch:
Diff command: cvs -f -z3 -q diff -u -w -N
Files affected: Lists/index.content
===================================================================
RCS
Index: Lists/index.content
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacsweb/Lists/index.content,v
retrieving revision 1.30
diff -u -w -r1.30 index.content
--- Lists/index.content 24 Mar 2007 15:30:43 -0000 1.30
+++ Lists/index.content 21 Aug 2007 21:59:29 -0000
@@ -220,7 +220,7 @@
<dl>
<!-- one of (dd dt) -->
<dt><a id="xemacs-beta-ja" name="xemacs-beta-ja">Archive</a>:</dt>
- <dd><a href="http://calypso.tux.org/pipermail/xemacs-beta-ja/">http://calypso.tu...>
+ <dd>http://calypso.tux.org/pipermail/xemacs-beta-ja/</dd>
</dl>
</td>
</tr>
@@ -286,7 +286,7 @@
<dl>
<!-- one of (dd dt) -->
<dt><a id="xemacs-design" name="xemacs-design">Archive</a>:</dt>
- <dd><a href="http://calypso.tux.org/pipermail/xemacs-design/">http://calypso.tux...>
+ <dd>http://calypso.tux.org/pipermail/xemacs-design/</dd>
<!--
<dt>Subscribe by E-mail:</dt>
<dd><a href="mailto:xemacs-design-request@xemacs.org?body=subscribe address=...">mailto:xemacs-design-request@xemacs.org?body=subscribe address=...</a></dd>
@@ -308,7 +308,7 @@
<dl>
<!-- one of (dd dt) -->
<dt><a id="xemacs-mule" name="xemacs-mule">Archive</a>:</dt>
- <dd><a href="http://calypso.tux.org/pipermail/xemacs-mule/">http://calypso.tux.o...>
+ <dd>http://calypso.tux.org/pipermail/xemacs-mule/</dd>
<!--
<dt>Subscribe by E-mail:</dt>
<dd><a href="mailto:xemacs-mule-request@xemacs.org?body=subscribe address=...">mailto:xemacs-mule-request@xemacs.org?body=subscribe address=...</a></dd>
@@ -330,7 +330,7 @@
<dl>
<!-- one of (dd dt) -->
<dt><a id="xemacs-news" name="xemacs-news">Archive</a>:</dt>
- <dd><a href="http://calypso.tux.org/pipermail/xemacs/">http://calypso.tux.org/pi...>
+ <dd>http://calypso.tux.org/pipermail/xemacs/</dd>
<!--
<dt>Subscribe by E-mail:</dt>
<dd><a href="mailto:xemacs-news-request@xemacs.org?body=subscribe address=...">mailto:xemacs-news-request@xemacs.org?body=subscribe address=...</a></dd>
@@ -350,7 +350,7 @@
<dl>
<!-- one of (dd dt) -->
<dt><a id="xemacs-nt" name="xemacs-nt">Legacy Archive</a>:</dt>
- <dd><a href="http://calypso.tux.org/pipermail/xemacs-nt/">http://calypso.tux.org...>
+ <dd>http://calypso.tux.org/pipermail/xemacs-nt/</dd>
</dl>
</td>
</tr>
@@ -392,7 +392,7 @@
<dl>
<!-- one of (dd dt) -->
<dt><a id="xemacs-users-ja" name="xemacs-users-ja">Legacy Archive</a>:</dt>
- <dd><a href="http://calypso.tux.org/pipermail/xemacs-users-ja/">http://calypso.t...>
+ <dd>http://calypso.tux.org/pipermail/xemacs-users-ja/</dd>
<!--
<dt>Subscribe by E-mail:</dt>
<dd><a href="mailto:xemacs-users-ja-request@xemacs.org?body=subscribe address=...">mailto:xemacs-users-ja-request@xemacs.org?body=subscribe address=...</a></dd>
@@ -416,7 +416,7 @@
<dl>
<!-- one of (dd dt) -->
<dt><a id="xemacs-users-ru" name="xemacs-users-ru">Legacy Archive</a>:</dt>
- <dd><a href="http://calypso.tux.org/pipermail/xemacs-users-ru/">http://calypso.t...>
+ <dd>http://calypso.tux.org/pipermail/xemacs-users-ru/</dd>
<!--
<dt>Subscribe by E-mail:</dt>
<dd><a href="mailto:xemacs-users-ru-request@xemacs.org?body=subscribe address=...">mailto:xemacs-users-ru-request@xemacs.org?body=subscribe address=...</a></dd>
@@ -436,7 +436,7 @@
<dl>
<!-- one of (dd dt) -->
<dt><a id="xemacs-nt" name="xemacs-nt">Legacy Archive</a>:</dt>
- <dd><a href="http://calypso.tux.org/pipermail/xemacs-nt/">http://calypso.tux.org...>
+ <dd>http://calypso.tux.org/pipermail/xemacs-nt/</dd>
</dl>
</td>
</tr>
--
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
[PATCH] Don't use args to XINT_OR_CHAR where multiple evaluation is possible; revise X_I_O_C to not multiply evaluate
17 years, 1 month
Aidan Kehoe
src/ChangeLog addition:
2007-08-21 Aidan Kehoe <kehoea(a)parhasard.net>
* mule-ccl.c (ccl_driver):
Don't pass XCHAR_OR_INT an argument of which the evaluation has
side effects; thank you Mike Fabian.
* lisp.h:
Redundantly, don't multiply evaluate the argument to XCHAR_OR_INT;
this should prevent the same error in the future.
XEmacs Trunk source patch:
Diff command: cvs -q diff -Nu
Files affected: src/lisp.h
===================================================================
RCS src/mule-ccl.c
===================================================================
RCS
Index: src/mule-ccl.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/mule-ccl.c,v
retrieving revision 1.33
diff -u -u -r1.33 mule-ccl.c
--- src/mule-ccl.c 2007/07/26 11:15:08 1.33
+++ src/mule-ccl.c 2007/08/21 20:28:29
@@ -1578,7 +1578,7 @@
Lisp_Object map, content, attrib, value;
int point, size, fin_ic;
- j = XCHAR_OR_INT (ccl_prog[ic++]); /* number of maps. */
+ j = XCHAR_OR_INT (ccl_prog[ic]); ic++; /* number of maps. */
fin_ic = ic + j;
op = reg[rrr];
if ((j > reg[RRR]) && (j >= 0))
@@ -1693,7 +1693,7 @@
stack_idx_of_map_multiple = 0;
map_set_rest_length =
- XCHAR_OR_INT (ccl_prog[ic++]); /* number of maps and separators. */
+ XCHAR_OR_INT (ccl_prog[ic]); ic++; /* number of maps and separators. */
fin_ic = ic + map_set_rest_length;
op = reg[rrr];
@@ -1880,7 +1880,7 @@
{
Lisp_Object map, attrib, value, content;
int size, point;
- j = XCHAR_OR_INT (ccl_prog[ic++]); /* map_id */
+ j = XCHAR_OR_INT (ccl_prog[ic]); ic++;/* map_id */
op = reg[rrr];
if (j >= XVECTOR (Vcode_conversion_map_vector)->size)
{
Index: src/lisp.h
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/lisp.h,v
retrieving revision 1.147
diff -u -u -r1.147 lisp.h
--- src/lisp.h 2007/08/17 08:04:27 1.147
+++ src/lisp.h 2007/08/21 20:28:31
@@ -2890,7 +2890,15 @@
#else /* no error checking */
-#define XCHAR_OR_INT(obj) (CHARP (obj) ? XCHAR (obj) : XINT (obj))
+/* obj is multiply eval'ed and not an lvalue; use an inline function instead
+ of a macro. */
+DECLARE_INLINE_HEADER (
+EMACS_INT
+XCHAR_OR_INT (Lisp_Object obj)
+)
+{
+ return CHARP (obj) ? XCHAR (obj) : XINT (obj);
+}
#endif /* no error checking */
--
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
Re: [C] Ignore .hg directories with igrep
17 years, 1 month
Michael Sperber
"Robert Pluim" <rpluim(a)gmail.com> writes:
> On 8/21/07, Michael Sperber <sperber(a)informatik.uni-tuebingen.de> wrote:
>>
>>
>> 2007-08-21 Mike Sperber <mike(a)xemacs.org>
>>
>> * igrep.el (igrep-find-prune-clause): Add .hg to the list of
>> ignored directories.
>>
>> --
>> Cheers =8-} Mike
>> Friede, Völkerverständigung und überhaupt blabla
>>
>> Index: igrep.el
>> ===================================================================
>> RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/igrep/igrep.el,v
>> retrieving revision 1.10
>> diff -u -r1.10 igrep.el
>> --- igrep.el 21 Aug 2007 12:44:26 -0000 1.10
>> +++ igrep.el 21 Aug 2007 12:45:26 -0000
>> @@ -427,7 +427,7 @@
>> (if (equal (call-process igrep-find-program nil nil nil
>> igrep-null-device "-prune")
>> 0)
>> - (format "-type d %s -name RCS -o -name CVS -o -name SCCS -name .svn
>> %s"
>> + (format "-type d %s -name RCS -o -name CVS -o -name SCCS -name .svn
>> -name .hg %s"
>> (shell-quote-argument "(")
>> (shell-quote-argument ")")))
>> "The `find` clause used to prune directories, or nil;
>
>
>
> I think you have a '-o' missing there.
Yup. Will fix. Thanks!
--
Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
[C] Ignore .hg directories with igrep
17 years, 1 month
Michael Sperber
2007-08-21 Mike Sperber <mike(a)xemacs.org>
* igrep.el (igrep-find-prune-clause): Add .hg to the list of
ignored directories.
--
Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla
Index: igrep.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/igrep/igrep.el,v
retrieving revision 1.10
diff -u -r1.10 igrep.el
--- igrep.el 21 Aug 2007 12:44:26 -0000 1.10
+++ igrep.el 21 Aug 2007 12:45:26 -0000
@@ -427,7 +427,7 @@
(if (equal (call-process igrep-find-program nil nil nil
igrep-null-device "-prune")
0)
- (format "-type d %s -name RCS -o -name CVS -o -name SCCS -name .svn %s"
+ (format "-type d %s -name RCS -o -name CVS -o -name SCCS -name .svn -name .hg %s"
(shell-quote-argument "(")
(shell-quote-argument ")")))
"The `find` clause used to prune directories, or nil;
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
[COMMIT] Clean up tests/automated/mule-test.el, fix a problem revealed by it
17 years, 1 month
Aidan Kehoe
Ar an seachtú lá déag de mí Lúnasa, scríobh Aidan Kehoe:
> Ar an seachtú lá déag de mí Lúnasa, scríobh Stephen J. Turnbull:
>
> > Yes. I couldn't remember whether `make-temp-name' was the sanctioned
> > (robust and secure) way to do this, so I punted.
>
> It is, AIUI. Though the Gnus people do check with #’file-already-exists
> after they call it--see http://tinyurl.com/2hm355 in Google code search.
I still think this, but now I investigate some more I learn that GNU now
have a #’make-temp-file, which does what a Unix mkstemp call does. For the
sake of compatibility we should merge that, and for the sake of paranoia we
should use it, here and elsewhere--it’s a better-designed API than
#’make-temp-name or mktemp(3).
> > > (2) The actual unexpected errors: "Unsupported Unicode code point"...
> >
> > If Aidan wants to work on this, he probably knows more about it than I
> > do offhand. If he doesn't, I'll get to it.
>
> The issue here is that I just changed the Lisp reader to error when it
> sees a Unicode code point that the current XEmacs doesn’t support.
> Portable code needs to be able to handle this case, because that’s what
> GNU does too; and we support all valid UCS code points right now in Mule
> XEmacs, so we don’t error illegitimately there. However, it happens *all
> the time* under non-Mule XEmacs, which is kind of the point of non-Mule
> XEmacs.
>
> Okay, I’ve got a solution; call #’read at runtime on escaped versions of
> the relevant strings. The tests aren’t executed on non-Mule, so the error
> won’t happen, but the Unicode escape functionality will still be tested
> in passing (while testing the coding-cookie-in-compiled-files
> functionality). I’ll send a patch later today.
Heh, not quite “later today” but the patch is a bit more comprehensive.
> > > (3) The fact that the summary does not report the unexpected errors.
> >
> > This may be hard to do well. I'll take a look at it.
> >
> > > Unexpected error (error "Can't activate input method
> > > `german-postfix'") while executing interpreted code.
> >
> > This is due to the fact that the Makefile suppresses adding packages
> > to the load-path.
No, it was due to Mike Sperber changing the load path for packages and not
telling anyone.
> > Probably the best thing to do is have a package-dependent-tests.el,
> > which is run as a separate command.
>
> os-tests.el calls #’Skip-Test-Unless in a similar context (when components
> required for a test are not available) so something similar might be the
> least intrusive approach; I’m not certain what the right check would be,
> though-- (assq 'leim packages-package-list) ? But leim doesn’t provide all
> the input methods--egg and skk are exceptions, at least.
I’ve decided to use Skip-Test-Unless, with the not-particularly-robust
assumption that if input-method-alist is greater than one in length (the
first entry coming from canna, the #’register-input-method call for which is
dumped), then all the package input methods are available. This reveals that
the following input methods used in language environments are not available
in packages:
latin-8-prefix latin-10-prefix latin-5-prefix latin-4-prefix latin-4-prefix
latin-4-prefix latin-4-prefix latin-4-prefix belarusian bulgarian-bds
Using Known-Bug-Expect-Failure calls to say that we know this already is
awkward, and the actual problem itself can be fixed with less work than that
would involve. Hopefully I’ll get to that soon.
I have added a Known-Bug-Expect-Failure for a separate bug, and documented
what provokes it and what needs to be done to eliminate it.
APPROVE COMMIT
NOTE: This patch has been committed.
tests/ChangeLog addition:
2007-08-21 Aidan Kehoe <kehoea(a)parhasard.net>
* automated/mule-tests.el (test-chars):
There are now 2^21 possible characters under Mule, not 2^19.
* automated/mule-tests.el (test-file-name):
Call #'make-temp-name instead of writing the file needed for the
rever-buffer test to the user's home directory. Wrap the following
#'save-buffer in a Silence-Message call.
* automated/mule-tests.el:
In the language environment tests, check that a given input method
exists before trying to activate it. If there are installed input
methods, assert that every input method specified in any language
environment exists. If the native-coding-system of the language
environment is specified as a function, don't assert that it is a
coding system.
In the byte-compiler coding cookie tests, call #'read at runtime
on strings with non-Latin-1 Unicode escapes. This avoids errors
when make check is run under a non-Mule XEmacs, where unavailable
Unicode escapes throw an error in the Lisp reader.
Add a new Known-Bug-Expect-Failure call for a bug that occurred to
me yesterday; if non-Latin-1 is generated in an eval-when-compile
clause, that non-ASCII may be trashed and the compiled code
incorrectly saved as no-conversion if no other non-Latin-1 exists
in the input buffer. Add a comment giving more details of the bug
and how one might fix it.
lisp/ChangeLog addition:
2007-08-21 Aidan Kehoe <kehoea(a)parhasard.net>
* mule/vietnamese.el ("Vietnamese"): Remove vscii and viqr from
the coding-system slot of the language environment for Vietnamese;
they're no longer available as coding systems in XEmacs, and they
were never widely used.
XEmacs Trunk source patch:
Diff command: cvs -q diff -u
Files affected: lisp/mule/vietnamese.el
===================================================================
RCS tests/automated/mule-tests.el
===================================================================
RCS
Index: tests/automated/mule-tests.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/tests/automated/mule-tests.el,v
retrieving revision 1.19
diff -u -r1.19 mule-tests.el
--- tests/automated/mule-tests.el 2007/06/22 16:37:41 1.19
+++ tests/automated/mule-tests.el 2007/08/21 12:34:15
@@ -42,12 +42,12 @@
(defun test-chars (&optional for-test-harness)
"Insert all characters in a buffer, to see if XEmacs will crash.
This is done by creating a string with all the legal characters
-in [0, 2^19) range, inserting it into the buffer, and checking
+in [0, 2^21) range, inserting it into the buffer, and checking
that the buffer's contents are equivalent to the string.
If FOR-TEST-HARNESS is specified, a temporary buffer is used, and
the Assert macro checks for correctness."
- (let ((max (expt 2 (if (featurep 'mule) 19 8)))
+ (let ((max (expt 2 (if (featurep 'mule) 21 8)))
(list nil)
(i 0))
(while (< i max)
@@ -118,14 +118,27 @@
;; Fixed 2007-06-22 <18043.2793.611745.734215(a)parhasard.net>.
;;----------------------------------------------------------------
-;; #### need a temp file name but this will do for now
-(let ((test-file-name (expand-file-name "~/test-revert-buffer-resets-modiff"))
+(let ((test-file-name
+ ;; The Gnus people, when they call #'make-temp-name, then loop,
+ ;; checking if the corresponding file exists. Our #'make-temp-name
+ ;; already does this loop, and the Gnus approach doesn't bring
+ ;; anything; there remains a race condition if you can predict the
+ ;; path name. The path name in question depends on the process ID and
+ ;; a (weak) PRNG seeded with the seconds to the power of the
+ ;; milliseconds of some instant close to the startup time of this
+ ;; XEmacs; without being able to read the address space of this
+ ;; XEmacs, or monitor what stat() calls it does, it is not predictable.
+ ;;
+ ;; The really kosher way to do this is to merge GNU's make-temp-file
+ ;; and use that. It basically has the functionality of the Unix
+ ;; mkstemp.
+ (make-temp-name (expand-file-name "tXfXsKc" (temp-directory))))
revert-buffer-function
kill-buffer-hook) ; paranoia
(find-file test-file-name)
(erase-buffer)
(insert "a string\n")
- (save-buffer 0)
+ (Silence-Message (save-buffer 0))
(insert "more text\n")
(revert-buffer t t)
;; Just "find-file" with autodetect coding didn't fail for me, but it does
@@ -491,7 +504,7 @@
;; The sort is to make the algorithm of charsets-in-region
;; irrelevant.
(sort (charsets-in-region (point-min) (point-max))
- 'string<)
+ #'string<)
'(arabic-1-column arabic-2-column ascii chinese-big5-1
chinese-gb2312 cyrillic-iso8859-5 ethiopic greek-iso8859-7
hebrew-iso8859-8 japanese-jisx0208 japanese-jisx0212
@@ -500,26 +513,54 @@
(Assert (equal
(sort (charsets-in-string (buffer-substring (point-min)
(point-max)))
- 'string<)
+ #'string<)
'(arabic-1-column arabic-2-column ascii chinese-big5-1
chinese-gb2312 cyrillic-iso8859-5 ethiopic greek-iso8859-7
hebrew-iso8859-8 japanese-jisx0208 japanese-jisx0212
katakana-jisx0201 korean-ksc5601 latin-iso8859-1
latin-iso8859-2 thai-xtis vietnamese-viscii-lower))))
- ;; Language environments.
- (dolist (language (mapcar 'car language-info-alist))
- (set-language-environment language)
+ ;;---------------------------------------------------------------
+ ;; Language environments, and whether the specified values are sane.
+ ;;---------------------------------------------------------------
+ (loop
+ for language in (mapcar #'car language-info-alist)
+ with language-input-method = nil
+ do
+ ;; s-l-e can call #'require, which says "Loading ..."
+ (Silence-Message (set-language-environment language))
(Assert (equal language current-language-environment))
- (set-input-method (get-language-info language 'input-method))
- (Assert (equal (get-language-info language 'input-method)
- current-input-method))
+
+ (setq language-input-method
+ (get-language-info language 'input-method))
+ (when (and language-input-method
+ ;; #### Not robust, if more input methods besides canna are
+ ;; in core. The intention of this is that if *any* of the
+ ;; packages' input methods are available, we check that *all*
+ ;; of the language environments' input methods actually
+ ;; exist, which goes against the spirit of non-monolithic
+ ;; packages. But I don't have a better approach to this.
+ (> (length input-method-alist) 1))
+ (Assert (assoc language-input-method input-method-alist))
+ (Skip-Test-Unless
+ (assoc language-input-method input-method-alist)
+ "input method unavailable"
+ (format "check that IM %s can be activated" language-input-method)
+ ;; s-i-m can load files.
+ (Silence-Message
+ (set-input-method language-input-method))
+ (Assert (equal language-input-method current-input-method))))
+
(dolist (charset (get-language-info language 'charset))
(Assert (charsetp (find-charset charset))))
(dolist (coding-system (get-language-info language 'coding-system))
(Assert (coding-system-p (find-coding-system coding-system))))
- (dolist (coding-system (get-language-info language 'coding-system))
- (Assert (coding-system-p (find-coding-system coding-system)))))
+ (dolist (coding-system (get-language-info language
+ 'native-coding-system))
+ ;; We don't have the appropriate POSIX locales to test with a
+ ;; native-coding-system that is a function.
+ (unless (functionp coding-system)
+ (Assert (coding-system-p (find-coding-system coding-system))))))
(with-temp-buffer
(flet
@@ -535,9 +576,9 @@
temporary-file-name
(current-buffer)
byte-compile-result)
- (Assert (string-match "^;;;###coding system: escape-quoted"
- (buffer-substring nil nil
- byte-compile-result))))))
+ (Assert (string-match
+ "^;;;###coding system: escape-quoted"
+ (buffer-substring nil nil byte-compile-result))))))
(Assert-elc-has-no-specified-encoding ()
"Assert the current buffer has no coding cookie if compiled."
(save-excursion
@@ -552,17 +593,21 @@
byte-compile-result)
(Assert (not (string-match
";;;###coding system:"
- (buffer-substring nil nil byte-compile-result))))))))
+ (buffer-substring nil nil
+ byte-compile-result))))))))
(insert
- ;; Create a buffer creating the Unicode escapes.
- #r" (defvar testing-mule-compilation-handling
- (string ?\u371E ;; kDefinition beautiful; pretty, used
+ ;; Create a buffer with Unicode escapes. The #'read call is at
+ ;; runtime, because this file may be compiled and read in a non-Mule
+ ;; XEmacs. (But it won't be run.)
+ (read
+ "#r\" (defvar testing-mule-compilation-handling
+ (string ?\\u371E ;; kDefinition beautiful; pretty, used
;; in girl's name
- ?\U0002A6A9 ;; kDefinition (Cant.) sound of shouting
- ?\U0002A65B ;; kDefinition (Cant.) decayed teeth;
+ ?\\U0002A6A9 ;; kDefinition (Cant.) sound of shouting
+ ?\\U0002A65B ;; kDefinition (Cant.) decayed teeth;
;; tongue-tied
- ?\U00010400 ;; DESERET CAPITAL LETTER LONG I
- ?\u3263)) ;; CIRCLED HANGUL RIEUL ")
+ ?\\U00010400 ;; DESERET CAPITAL LETTER LONG I
+ ?\\u3263)) ;; CIRCLED HANGUL RIEUL \""))
(Assert-elc-is-escape-quoted)
(delete-region (point-min) (point-max))
@@ -570,55 +615,83 @@
(insert
;; This time, the buffer will contain the actual characters, because of
;; u flag to the #r.
- #ru" (defvar testing-mule-compilation-handling
- (string ?\u371E ;; kDefinition beautiful; pretty, used
+ (read
+ "#ru\" (defvar testing-mule-compilation-handling
+ (string ?\\u371E ;; kDefinition beautiful; pretty, used
;; in girl's name
- ?\U0002A6A9 ;; kDefinition (Cant.) sound of shouting
- ?\U0002A65B ;; kDefinition (Cant.) decayed teeth;
+ ?\\U0002A6A9 ;; kDefinition (Cant.) sound of shouting
+ ?\\U0002A65B ;; kDefinition (Cant.) decayed teeth;
;; tongue-tied
- ?\U00010400 ;; DESERET CAPITAL LETTER LONG I
- ?\u3263)) ;; CIRCLED HANGUL RIEUL ")
+ ?\\U00010400 ;; DESERET CAPITAL LETTER LONG I
+ ?\\u3263)) ;; CIRCLED HANGUL RIEUL \""))
(Assert-elc-is-escape-quoted)
(delete-region (point-min) (point-max))
(insert
;; Just a single four character escape.
- #r" (defvar testing-mule-compilation-handling
- (string ?\u371E)) ;; kDefinition beautiful; pretty, used")
+ (read
+ "#r\" (defvar testing-mule-compilation-handling
+ (string ?\\u371E)) ;; kDefinition beautiful; pretty, used\""))
(Assert-elc-is-escape-quoted)
(delete-region (point-min) (point-max))
(insert
;; Just a single eight character escape.
- #r" (defvar testing-mule-compilation-handling
- (string ?\U0002A65B)) ;; kDefinition (Cant.) decayed teeth;")
+ (read
+ "#r\" (defvar testing-mule-compilation-handling
+ (string ?\\U0002A65B)) ;; kDefinition (Cant.) decayed teeth;\""))
(Assert-elc-is-escape-quoted)
(delete-region (point-min) (point-max))
(insert
- ;; A single latin-1 hex digit escape
+ ;; A single latin-1 hex digit escape No run-time #'read call,
+ ;; non-Mule can handle this too.
#r" (defvar testing-mule-compilation-handling
- (string ?\xab)) ;; LEFT-POINTING DOUBLE ANGLE QUOTATION MARK")
+ (string ?\xab)) ;; LEFT-POINTING DOUBLE ANGLE QUOTATION MARK")
(Assert-elc-has-no-specified-encoding)
(delete-region (point-min) (point-max))
(insert
- ;; A single latin-1 character
+ ;; A single latin-1 character. No run-time #'read call.
#ru" (defvar testing-mule-compilation-handling
- (string ?\u00AB)) ;; LEFT-POINTING DOUBLE ANGLE QUOTATION MARK")
+ (string ?\u00AB)) ;; LEFT-POINTING DOUBLE ANGLE QUOTATION MARK\")")
(Assert-elc-has-no-specified-encoding)
(delete-region (point-min) (point-max))
(insert
- ;; Just ASCII.
+ ;; Just ASCII. No run-time #'read call
#r" (defvar testing-mule-compilation-handling
(string ?A)) ;; LATIN CAPITAL LETTER A")
(Assert-elc-has-no-specified-encoding)
+ (delete-region (point-min) (point-max))
+
+ ;; This bug exists because the coding-cookie insertion code looks at
+ ;; the input buffer, not the output buffer.
+ ;;
+ ;; It looks at the input buffer because byte-compile-dynamic and
+ ;; byte-compile-dynamic-docstrings currently need to be
+ ;; unconditionally turned off for Mule files, since dynamic
+ ;; compilation of function bodies and docstrings fails if you can't
+ ;; call (point) and trivially get the byte offset in the file.
+ ;;
+ ;; And to unconditionally turn those two features off, you need to
+ ;; know before byte-compilation whether the byte-compilation output
+ ;; file contains non-Latin-1 characters, or perhaps to check after
+ ;; compilation and redo; but we don't do the latter.
+ ;;
+ ;; To fix this bug, we need to add Mule support to
+ ;; byte-compile-dynamic and byte-compile-dynamic-docstrings. Or drop
+ ;; support for those features entirely.
+ (insert
+ "(defvar testing-mule-compilation-handling (eval-when-compile
+ (decode-char 'ucs #x371e))) ;; kDefinition beautiful; pretty, used\"")
+ (Known-Bug-Expect-Failure
+ (Assert-elc-is-escape-quoted))
(delete-region (point-min) (point-max))))
)
Index: lisp/mule/vietnamese.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/mule/vietnamese.el,v
retrieving revision 1.9
diff -u -r1.9 vietnamese.el
--- lisp/mule/vietnamese.el 2007/07/22 22:03:50 1.9
+++ lisp/mule/vietnamese.el 2007/08/21 12:34:15
@@ -205,7 +205,7 @@
(set-language-info-alist
"Vietnamese" '((charset vietnamese-viscii-lower vietnamese-viscii-upper)
- (coding-system viscii vscii viqr)
+ (coding-system viscii)
(coding-priority viscii)
(locale "vietnamese" "vi")
;; Not available in packages.
--
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
[C] xemacs-builds: remove ftp.jp.xemacs.org from package-get-2-download-sites-ftp-only-regexp
17 years, 1 month
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.79
diff -u -U0 -r1.79 ChangeLog
--- ChangeLog 18 Aug 2007 13:44:21 -0000 1.79
+++ ChangeLog 20 Aug 2007 21:47:59 -0000
@@ -0,0 +1,7 @@
+2007-08-20 Adrian Aichner <adrian(a)xemacs.org>
+
+ * adrian/website/package-get-2-download-sites.el
+ (package-get-2-download-sites-ftp-only-regexp): Remove
+ ftp.jp.xemacs.org from
+ package-get-2-download-sites-ftp-only-regexp.
+
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.12
diff -u -w -r1.12 package-get-2-download-sites.el
--- adrian/website/package-get-2-download-sites.el 18 Aug 2007 13:44:23 -0000 1.12
+++ adrian/website/package-get-2-download-sites.el 20 Aug 2007 21:47:16 -0000
@@ -27,11 +27,6 @@
(defconst package-get-2-download-sites-ftp-only-regexp
(regexp-opt
'(
- "ftp.jp.xemacs.org" ; currently no content and
- ; ftp-only; contacted
- ; ring.aist.go.jp requesting
- ; permission to delegate
- ; jp.xemacs.org.
"ftp.nrc.ca"
"ftp.pasteur.fr"
"mirror.cict.fr"
--
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