GNU bug report logs - #34346
ImageMagick: hang when opening text (racket) files with .art extension

Previous Next

Package: emacs;

Reported by: Pierre Neidhardt <mail <at> ambrevar.xyz>

Date: Wed, 6 Feb 2019 12:32:01 UTC

Severity: normal

Merged with 22289

Found in versions 24.3, 26.1

Fixed in version 26.2

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 34346 in the body.
You can then email your comments to 34346 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#34346; Package emacs. (Wed, 06 Feb 2019 12:32:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Pierre Neidhardt <mail <at> ambrevar.xyz>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 06 Feb 2019 12:32:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Pierre Neidhardt <mail <at> ambrevar.xyz>
To: bug-gnu-emacs <at> gnu.org
Subject: 26.1; Big hang when opening text (racket) files with .art extension
 (image-mode)
Date: Wed, 06 Feb 2019 13:31:15 +0100
Tested with emacs -Q: opening a .art file
(e.g. https://raw.githubusercontent.com/euhmeuh/rilouw.eu/master/articles/hello.art)
will hang Emacs for about a minute (on a rather powerful computer).  CPU
is about 0% but disk I/O oscillates between 80MB/s-400MB/s (your mileage
may vary).

It seems to be because Emacs tries to open the .art file in image-mode.
The regexp seems to be added by imagemagick-register-types.

Removing .art from auto-mode-alist works.  The following workaround will
remove the complete regexp, that is, all extensions added by
imagemagick-register-types.

  (dolist (pair auto-mode-alist)
    (when (string-match (car pair) ".art")
      (delete pair auto-mode-alist)))





In GNU Emacs 26.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.0)
 of 2018-11-14 built on localhost
Windowing system distributor 'The X.Org Foundation', version 11.0.12003000

Configured using:
 'configure
 CONFIG_SHELL=/gnu/store/q19l04vd2za80mk1845pz7r8cz29qk43-bash-minimal-4.4.23/bin/bash
 SHELL=/gnu/store/q19l04vd2za80mk1845pz7r8cz29qk43-bash-minimal-4.4.23/bin/bash
 --prefix=/gnu/store/vsiqlxhj7lnydhhi85jc1pg0xzhcfdny-emacs-26.1
 --enable-fast-install'

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND DBUS GSETTINGS NOTIFY ACL
GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS
GTK3 X11 THREADS

Important settings:
  value of $LANG: en_US.utf8
  locale-coding-system: utf-8-unix

Major mode: mu4e:view
<#secure method=pgpmime mode=sign>

--
Pierre Neidhardt
https://ambrevar.xyz/




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#34346; Package emacs. (Wed, 06 Feb 2019 14:02:03 GMT) Full text and rfc822 format available.

Message #8 received at 34346 <at> debbugs.gnu.org (full text, mbox):

From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
To: Pierre Neidhardt <mail <at> ambrevar.xyz>
Cc: 34346 <at> debbugs.gnu.org
Subject: Re: bug#34346: 26.1;
 Big hang when opening text (racket) files with .art extension
 (image-mode)
Date: Wed, 06 Feb 2019 14:01:50 +0000
Pierre Neidhardt <mail <at> ambrevar.xyz> writes:

> Removing .art from auto-mode-alist works.  The following workaround will
> remove the complete regexp, that is, all extensions added by
> imagemagick-register-types.
>
>   (dolist (pair auto-mode-alist)
>     (when (string-match (car pair) ".art")
>       (delete pair auto-mode-alist)))

Another way of achieving this would be through customising
imagemagick-types-inhibit or imagemagick-enabled-types, right?

-- 
Basil




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#34346; Package emacs. (Wed, 06 Feb 2019 14:16:02 GMT) Full text and rfc822 format available.

Message #11 received at 34346 <at> debbugs.gnu.org (full text, mbox):

From: Pierre Neidhardt <mail <at> ambrevar.xyz>
To: "Basil L. Contovounesios" <contovob <at> tcd.ie>
Cc: 34346 <at> debbugs.gnu.org
Subject: Re: bug#34346: 26.1;
 Big hang when opening text (racket) files with .art extension
 (image-mode)
Date: Wed, 06 Feb 2019 15:15:27 +0100
[Message part 1 (text/plain, inline)]
> Another way of achieving this would be through customising
> imagemagick-types-inhibit or imagemagick-enabled-types, right?

Thanks for sharing, I didn't know about these.  Yes, that would be a better
workaround.

That said, there is an issue and image-mode should not try to do what ever it is
doing when loading plain text...  Not sure how we could prevent that.

-- 
Pierre Neidhardt
https://ambrevar.xyz/
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#34346; Package emacs. (Wed, 06 Feb 2019 15:48:02 GMT) Full text and rfc822 format available.

Message #14 received at 34346 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Pierre Neidhardt <mail <at> ambrevar.xyz>
Cc: 34346 <at> debbugs.gnu.org
Subject: Re: bug#34346: 26.1;
 Big hang when opening text (racket) files with .art extension
 (image-mode)
Date: Wed, 06 Feb 2019 17:47:40 +0200
> From: Pierre Neidhardt <mail <at> ambrevar.xyz>
> Date: Wed, 06 Feb 2019 13:31:15 +0100
> 
> Tested with emacs -Q: opening a .art file
> (e.g. https://raw.githubusercontent.com/euhmeuh/rilouw.eu/master/articles/hello.art)
> will hang Emacs for about a minute (on a rather powerful computer).  CPU
> is about 0% but disk I/O oscillates between 80MB/s-400MB/s (your mileage
> may vary).
> 
> It seems to be because Emacs tries to open the .art file in image-mode.
> The regexp seems to be added by imagemagick-register-types.
> 
> Removing .art from auto-mode-alist works.

Not sure I understand: are you saying that hello.art uses an extension
of some image files, but is not an image?  If so, why is that a bug --
these things can happen with any file, and removing an extension just
because there's one example to the contrary isn't necessarily a good
idea.

Or did I miss something?

Thanks.




Changed bug title to 'ImageMagick: hang when opening text (racket) files with .art extension' from '26.1; Big hang when opening text (racket) files with .art extension (image-mode)' Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Wed, 06 Feb 2019 18:27:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#34346; Package emacs. (Wed, 06 Feb 2019 18:29:01 GMT) Full text and rfc822 format available.

Message #19 received at 34346 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Pierre Neidhardt <mail <at> ambrevar.xyz>
Cc: 34346 <at> debbugs.gnu.org
Subject: Re: bug#34346: 26.1;
 Big hang when opening text (racket) files with .art extension
 (image-mode)
Date: Wed, 06 Feb 2019 13:27:58 -0500
This is a duplicate of https://debbugs.gnu.org/22289 .




Merged 22289 34346. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Wed, 06 Feb 2019 18:29:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#34346; Package emacs. (Wed, 06 Feb 2019 19:10:02 GMT) Full text and rfc822 format available.

Message #24 received at 34346 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 34346 <at> debbugs.gnu.org, Pierre Neidhardt <mail <at> ambrevar.xyz>
Subject: Re: bug#34346: 26.1;
 Big hang when opening text (racket) files with .art extension
 (image-mode)
Date: Wed, 06 Feb 2019 14:09:13 -0500
I've never heard of .art image files.

According to
https://en.wikipedia.org/wiki/ART_image_file_format

"ART is a proprietary image file format used mostly by the America
Online (AOL) service"

I doubt many people want to look at such images with Emacs.
Given that .art more often seems to be used for something else that
isn't an image but causes big problems for ImageMagick, it seems like a
good idea to add it to the default value of imagemagick-types-inhibit.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#34346; Package emacs. (Wed, 06 Feb 2019 19:12:01 GMT) Full text and rfc822 format available.

Message #27 received at 34346 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 34346 <at> debbugs.gnu.org, Pierre Neidhardt <mail <at> ambrevar.xyz>
Subject: Re: bug#34346: 26.1;
 Big hang when opening text (racket) files with .art extension
 (image-mode)
Date: Wed, 06 Feb 2019 14:11:25 -0500
Glenn Morris wrote:

> it seems like a good idea to add it to the default value of
> imagemagick-types-inhibit.

Or rather, remove ART from the default imagemagick-enabled-types.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#34346; Package emacs. (Wed, 06 Feb 2019 20:54:02 GMT) Full text and rfc822 format available.

Message #30 received at 34346 <at> debbugs.gnu.org (full text, mbox):

From: Pierre Neidhardt <mail <at> ambrevar.xyz>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 34346 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>
Subject: Re: bug#34346: 26.1;
 Big hang when opening text (racket) files with .art extension
 (image-mode)
Date: Wed, 06 Feb 2019 21:53:26 +0100
[Message part 1 (text/plain, inline)]
> Not sure I understand: are you saying that hello.art uses an extension
> of some image files, but is not an image?  If so, why is that a bug --
> these things can happen with any file, and removing an extension just
> because there's one example to the contrary isn't necessarily a good
> idea.
> 
> Or did I miss something?

Sorry if this was unclear.

Extensions and actual content don't necessary match the auto-mode-alist mapping.

If the extension does not match Emacs' expectations, it should not freeze it for
a minute and almost halt the computer to a grind.

In other words, Emacs should fail gracefully when image-mode does not make sense
with the actual content of the file.

Does that make sense?

-- 
Pierre Neidhardt
https://ambrevar.xyz/
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#34346; Package emacs. (Wed, 06 Feb 2019 20:56:02 GMT) Full text and rfc822 format available.

Message #33 received at 34346 <at> debbugs.gnu.org (full text, mbox):

From: Pierre Neidhardt <mail <at> ambrevar.xyz>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 34346 <at> debbugs.gnu.org
Subject: Re: bug#34346: 26.1;
 Big hang when opening text (racket) files with .art extension
 (image-mode)
Date: Wed, 06 Feb 2019 21:55:40 +0100
[Message part 1 (text/plain, inline)]
> This is a duplicate of https://debbugs.gnu.org/22289 .

It is indeed, thanks for looking it up!

-- 
Pierre Neidhardt
https://ambrevar.xyz/
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#34346; Package emacs. (Thu, 07 Feb 2019 03:31:02 GMT) Full text and rfc822 format available.

Message #36 received at 34346 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Pierre Neidhardt <mail <at> ambrevar.xyz>
Cc: rgm <at> gnu.org, 34346 <at> debbugs.gnu.org
Subject: Re: bug#34346: 26.1;
 Big hang when opening text (racket) files with .art extension
 (image-mode)
Date: Thu, 07 Feb 2019 05:30:20 +0200
> From: Pierre Neidhardt <mail <at> ambrevar.xyz>
> Cc: Eli Zaretskii <eliz <at> gnu.org>, 34346 <at> debbugs.gnu.org
> Date: Wed, 06 Feb 2019 21:53:26 +0100
> 
> If the extension does not match Emacs' expectations, it should not freeze it for
> a minute and almost halt the computer to a grind.
> 
> In other words, Emacs should fail gracefully when image-mode does not make sense
> with the actual content of the file.
> 
> Does that make sense?

I does, I just think that your desire is generally unattainable, even
though in the specific case in point perhaps we should simply drop
support for .art extensions.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#34346; Package emacs. (Thu, 07 Feb 2019 12:06:02 GMT) Full text and rfc822 format available.

Message #39 received at 34346 <at> debbugs.gnu.org (full text, mbox):

From: Pierre Neidhardt <mail <at> ambrevar.xyz>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: rgm <at> gnu.org, 34346 <at> debbugs.gnu.org
Subject: Re: bug#34346: 26.1;
 Big hang when opening text (racket) files with .art extension
 (image-mode)
Date: Thu, 07 Feb 2019 13:04:58 +0100
[Message part 1 (text/plain, inline)]
> I does, I just think that your desire is generally unattainable, even
> though in the specific case in point perhaps we should simply drop
> support for .art extensions.

I think there is a misunderstanding (probably due to my initial post and the
poor title).  The issue, I  believe, is with image-mode: when it is fed random
bytes (e.g. a text buffer) it goes berserk.  This is probably a bug in
image-mode.

-- 
Pierre Neidhardt
https://ambrevar.xyz/
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#34346; Package emacs. (Thu, 07 Feb 2019 14:45:02 GMT) Full text and rfc822 format available.

Message #42 received at 34346 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Pierre Neidhardt <mail <at> ambrevar.xyz>
Cc: rgm <at> gnu.org, 34346 <at> debbugs.gnu.org
Subject: Re: bug#34346: 26.1;
 Big hang when opening text (racket) files with .art extension
 (image-mode)
Date: Thu, 07 Feb 2019 16:44:21 +0200
> From: Pierre Neidhardt <mail <at> ambrevar.xyz>
> Cc: rgm <at> gnu.org, 34346 <at> debbugs.gnu.org
> Date: Thu, 07 Feb 2019 13:04:58 +0100
> 
> I think there is a misunderstanding (probably due to my initial post and the
> poor title).  The issue, I  believe, is with image-mode: when it is fed random
> bytes (e.g. a text buffer) it goes berserk.  This is probably a bug in
> image-mode.

Does image-mode goes berserk, or does ImageMagick do it?  AFAIU, we
just hand the file to the appropriate image library for processing.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#34346; Package emacs. (Thu, 07 Feb 2019 15:00:01 GMT) Full text and rfc822 format available.

Message #45 received at 34346 <at> debbugs.gnu.org (full text, mbox):

From: Pierre Neidhardt <mail <at> ambrevar.xyz>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: rgm <at> gnu.org, 34346 <at> debbugs.gnu.org
Subject: Re: bug#34346: 26.1;
 Big hang when opening text (racket) files with .art extension
 (image-mode)
Date: Thu, 07 Feb 2019 15:59:14 +0100
[Message part 1 (text/plain, inline)]
Could be.  Any hint on how I could test that more specifically?

-- 
Pierre Neidhardt
https://ambrevar.xyz/
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#34346; Package emacs. (Thu, 07 Feb 2019 15:54:01 GMT) Full text and rfc822 format available.

Message #48 received at 34346 <at> debbugs.gnu.org (full text, mbox):

From: Stephen Berman <stephen.berman <at> gmx.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 34346 <at> debbugs.gnu.org, Pierre Neidhardt <mail <at> ambrevar.xyz>
Subject: Re: bug#34346: 26.1;
 Big hang when opening text (racket) files with .art extension
 (image-mode)
Date: Thu, 07 Feb 2019 16:52:56 +0100
On Thu, 07 Feb 2019 16:44:21 +0200 Eli Zaretskii <eliz <at> gnu.org> wrote:

>> From: Pierre Neidhardt <mail <at> ambrevar.xyz>
>> Cc: rgm <at> gnu.org, 34346 <at> debbugs.gnu.org
>> Date: Thu, 07 Feb 2019 13:04:58 +0100
>> 
>> I think there is a misunderstanding (probably due to my initial post and the
>> poor title).  The issue, I  believe, is with image-mode: when it is fed random
>> bytes (e.g. a text buffer) it goes berserk.  This is probably a bug in
>> image-mode.
>
> Does image-mode goes berserk, or does ImageMagick do it?  AFAIU, we
> just hand the file to the appropriate image library for processing.

On Thu, 07 Feb 2019 15:59:14 +0100 Pierre Neidhardt <mail <at> ambrevar.xyz> wrote:

> Could be.  Any hint on how I could test that more specifically?

Try opening the file from the shell with the 'display' command (and have
another shell ready to kill that process).

Steve Berman




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#34346; Package emacs. (Thu, 07 Feb 2019 17:00:03 GMT) Full text and rfc822 format available.

Message #51 received at 34346 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Stephen Berman <stephen.berman <at> gmx.net>
Cc: 34346 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>,
 Pierre Neidhardt <mail <at> ambrevar.xyz>
Subject: Re: bug#34346: 26.1;
 Big hang when opening text (racket) files with .art extension
 (image-mode)
Date: Thu, 07 Feb 2019 11:59:32 -0500
Stephen Berman wrote:

> Try opening the file from the shell with the 'display' command (and have
> another shell ready to kill that process).

This was already investigated in
https://debbugs.gnu.org/22289#8
https://debbugs.gnu.org/22289#20




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#34346; Package emacs. (Thu, 07 Feb 2019 17:08:02 GMT) Full text and rfc822 format available.

Message #54 received at 34346 <at> debbugs.gnu.org (full text, mbox):

From: Pierre Neidhardt <mail <at> ambrevar.xyz>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 34346 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>,
 Stephen Berman <stephen.berman <at> gmx.net>
Subject: Re: bug#34346: 26.1;
 Big hang when opening text (racket) files with .art extension
 (image-mode)
Date: Thu, 07 Feb 2019 18:07:34 +0100
[Message part 1 (text/plain, inline)]
Thank you for the links, Glenn!

Sounds like removing the .art auto-load would not be so bad after all.
Thoughts?

-- 
Pierre Neidhardt
https://ambrevar.xyz/
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#34346; Package emacs. (Thu, 07 Feb 2019 17:28:02 GMT) Full text and rfc822 format available.

Message #57 received at 34346 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Pierre Neidhardt <mail <at> ambrevar.xyz>
Cc: rgm <at> gnu.org, 34346 <at> debbugs.gnu.org
Subject: Re: bug#34346: 26.1;
 Big hang when opening text (racket) files with .art extension
 (image-mode)
Date: Thu, 07 Feb 2019 19:27:13 +0200
> From: Pierre Neidhardt <mail <at> ambrevar.xyz>
> Cc: rgm <at> gnu.org, 34346 <at> debbugs.gnu.org
> Date: Thu, 07 Feb 2019 15:59:14 +0100
> 
> Could be.  Any hint on how I could test that more specifically?

One possible way is to attach a debugger to Emacs while this
processing goes on, and produce a backtrace to see what code is
working.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 20 Mar 2019 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 5 years and 39 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.