Subject: Re: bug#16878: 24.3.50; gif animation continues even after killing buffer

From: Eli Zaretskii <[email-masked]>
Date: Tue, 25 Feb 2014 18:37:18 +0200

> From: Ivan Kanis <[email-masked]>
> Date: Tue, 25 Feb 2014 13:54:02 +0100
> 
> 1) emacs -Q
> 2) M-x eww https://github.com/ShingoFukuyama/emacs-swoop RET
> 3) Wait for the emacs screenshot to load.
> 4) C-x k RET
> 
> I expect emacs to stop processing the animated gif. Instead emacs is
> pegged at 100% cpu. Doing a C-z in the debugger shows it is still
> processing the gif. This renders emacs unusable and I have to restart
> it.
> 
> I think the slowness of rendering animated gif is a bug too. I know I
> run on a under powered PC but Firefox has no problem rendering animated
> gif.
> 
> ^Z
> Program received signal SIGTSTP, Stopped (user).
> 0xabeb40e3 in ?? ()
>    from /usr/lib/i386-linux-gnu/ImageMagick-6.7.7/modules-Q16/coders/gif.so
> (gdb) bt
> #0  0xabeb40e3 in ?? ()
>    from /usr/lib/i386-linux-gnu/ImageMagick-6.7.7/modules-Q16/coders/gif.so
> #1  0xb706722a in ReadImage () from /usr/lib/i386-linux-gnu/libMagickCore.so.5
> #2  0xb702ca32 in BlobToImage ()
>    from /usr/lib/i386-linux-gnu/libMagickCore.so.5
> #3  0xb7341973 in MagickReadImageBlob ()
>    from /usr/lib/i386-linux-gnu/libMagickWand.so.5
> #4  0x0825f74e in imagemagick_load_image (f=0x885a3e8, img=0x8d6d600, 
>     contents=0x9a8ff24 "GIF89a[\003U\002w", size=7729394, filename=0x0)
>     at image.c:8193
> #5  0x08260373 in imagemagick_load (f=0x885a3e8, img=0x8d6d600) at image.c:8515
> #6  0x0825658f in lookup_image (f=0x885a3e8, spec=143734606) at image.c:1694
> #7  0x082552f5 in Fimage_metadata (spec=143734606, frame=140327874)
>     at image.c:945
> #8  0x081db61f in Ffuncall (nargs=2, args=0xbfffd7c4) at eval.c:2816

Please show the entire backtrace.  What you show here only tell us
that we are in a call to Imagemagick library, but it tells almost
nothing about how we got into Imagemagick when you typed "C-x k",
which is the main issue here.

Btw, do you see the "C-x-" prompt in the echo area if you wait for a
second or so before pressing 'k'?  If not, I think Emacs simply didn't
yet see your keypress, and is still inside Imagemagick processing the
image.  In that case, this is expected, since Emacs is not
multi-threaded (yet).