Daniel Pittman wrote:
Ben Wing <ben(a)xemacs.org> writes:
>Daniel Pittman wrote:
>
>
[...]
>>This happened while running Gnus, and looks like it is a logic error in
>>the handling of the timeout list - the code in Fdisable_timout tries to
>>synchronously free the Lisp object that was removed, presumably because
>>it is an internal object. (This happens in event_stream_disable_wakeup.)
>>
>>This isn't terribly compatible with the finalise method of the image
>>instance, though, which is most likely called during GC.
>>
>>
[...]
>Thanks for the problem and accurate diagnosis. There is a
>register_post_gc_action() function for exactly this situation; it
>should obviously be used.
>
>
Thanks: I should have seen that API. The attached patch seems to
resolve the problem for me, although the issue was never as
deterministic as I wanted it to be. :/
I will test again with the new allocator shortly, to see if this
resolves another issue I have run into there where the page finalize
routine would fail because of pre-freed items, or would walk off into
random numbers...
Daniel
------------------------------------------------------------------------
? build.sh
? confdefs.h
? conftest
? conftest.c
? conftest.er1
Index: src/glyphs-x.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/glyphs-x.c,v
retrieving revision 1.84
diff -u -u -r1.84 glyphs-x.c
--- src/glyphs-x.c 2005/11/26 11:46:08 1.84
+++ src/glyphs-x.c 2005/12/19 02:50:49
@@ -423,8 +423,9 @@
{
int i;
if (IMAGE_INSTANCE_PIXMAP_TIMEOUT (p))
- disable_glyph_animated_timeout (IMAGE_INSTANCE_PIXMAP_TIMEOUT (p));
-
+ register_post_gc_action (disable_glyph_animated_timeout,
+ IMAGE_INSTANCE_PIXMAP_TIMEOUT (p));
+
if (IMAGE_INSTANCE_X_MASK (p) &&
IMAGE_INSTANCE_X_MASK (p) != IMAGE_INSTANCE_X_PIXMAP (p))
XFreePixmap (dpy, IMAGE_INSTANCE_X_MASK (p));
you should fix this so that it passes correct types. here you're mixing
ints and void *'s; i'm surprised it compiles at all. if you could,
please do something like this:
-- change disable_glyph_animated_timeout to take a void *, like a
post_gc_action handler.
-- cast the timeout value to (void *) when calling
register_post_gc_action().
-- also fix up glyphs-msw.c and glyphs-gtk.c in the same fashion (don't
worry if you can't test)
-- put in a comment somewhere, e.g.,disable_glyph_animated_timeout()
explaining that it can't be called in a finalize method, for the reasons
you already gave.
-- when you resubmit the patch, flag it as [RECOMMEND 21.4] since 21.4
has the same problem.
thanks,
ben
btw can you clarify this:
the page finalize
routine would fail because of pre-freed items, or would walk off into
random numbers...
?