unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#34346: 26.1; Big hang when opening text (racket) files with .art extension (image-mode)
@ 2019-02-06 12:31 Pierre Neidhardt
  2019-02-06 14:01 ` Basil L. Contovounesios
                   ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: Pierre Neidhardt @ 2019-02-06 12:31 UTC (permalink / raw)
  To: 34346


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/





^ permalink raw reply	[flat|nested] 17+ messages in thread

* bug#34346: 26.1; Big hang when opening text (racket) files with .art extension (image-mode)
  2019-02-06 12:31 bug#34346: 26.1; Big hang when opening text (racket) files with .art extension (image-mode) Pierre Neidhardt
@ 2019-02-06 14:01 ` Basil L. Contovounesios
  2019-02-06 14:15   ` Pierre Neidhardt
  2019-02-06 15:47 ` Eli Zaretskii
  2019-02-06 18:27 ` Glenn Morris
  2 siblings, 1 reply; 17+ messages in thread
From: Basil L. Contovounesios @ 2019-02-06 14:01 UTC (permalink / raw)
  To: Pierre Neidhardt; +Cc: 34346

Pierre Neidhardt <mail@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





^ permalink raw reply	[flat|nested] 17+ messages in thread

* bug#34346: 26.1; Big hang when opening text (racket) files with .art extension (image-mode)
  2019-02-06 14:01 ` Basil L. Contovounesios
@ 2019-02-06 14:15   ` Pierre Neidhardt
  0 siblings, 0 replies; 17+ messages in thread
From: Pierre Neidhardt @ 2019-02-06 14:15 UTC (permalink / raw)
  To: Basil L. Contovounesios; +Cc: 34346

[-- Attachment #1: Type: text/plain, Size: 425 bytes --]


> 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/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* bug#34346: 26.1; Big hang when opening text (racket) files with .art extension (image-mode)
  2019-02-06 12:31 bug#34346: 26.1; Big hang when opening text (racket) files with .art extension (image-mode) Pierre Neidhardt
  2019-02-06 14:01 ` Basil L. Contovounesios
@ 2019-02-06 15:47 ` Eli Zaretskii
  2019-02-06 19:09   ` Glenn Morris
  2019-02-06 20:55   ` Pierre Neidhardt
  2019-02-06 18:27 ` Glenn Morris
  2 siblings, 2 replies; 17+ messages in thread
From: Eli Zaretskii @ 2019-02-06 15:47 UTC (permalink / raw)
  To: Pierre Neidhardt; +Cc: 34346

> From: Pierre Neidhardt <mail@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.





^ permalink raw reply	[flat|nested] 17+ messages in thread

* bug#34346: 26.1; Big hang when opening text (racket) files with .art extension (image-mode)
  2019-02-06 12:31 bug#34346: 26.1; Big hang when opening text (racket) files with .art extension (image-mode) Pierre Neidhardt
  2019-02-06 14:01 ` Basil L. Contovounesios
  2019-02-06 15:47 ` Eli Zaretskii
@ 2019-02-06 18:27 ` Glenn Morris
  2 siblings, 0 replies; 17+ messages in thread
From: Glenn Morris @ 2019-02-06 18:27 UTC (permalink / raw)
  To: Pierre Neidhardt; +Cc: 34346


This is a duplicate of https://debbugs.gnu.org/22289 .





^ permalink raw reply	[flat|nested] 17+ messages in thread

* bug#34346: 26.1; Big hang when opening text (racket) files with .art extension (image-mode)
  2019-02-06 15:47 ` Eli Zaretskii
@ 2019-02-06 19:09   ` Glenn Morris
  2019-02-06 19:11     ` Glenn Morris
  2019-02-06 20:55   ` Pierre Neidhardt
  1 sibling, 1 reply; 17+ messages in thread
From: Glenn Morris @ 2019-02-06 19:09 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 34346, Pierre Neidhardt


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.





^ permalink raw reply	[flat|nested] 17+ messages in thread

* bug#34346: 26.1; Big hang when opening text (racket) files with .art extension (image-mode)
  2019-02-06 19:09   ` Glenn Morris
@ 2019-02-06 19:11     ` Glenn Morris
  2019-02-06 20:53       ` Pierre Neidhardt
  0 siblings, 1 reply; 17+ messages in thread
From: Glenn Morris @ 2019-02-06 19:11 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 34346, Pierre Neidhardt

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.





^ permalink raw reply	[flat|nested] 17+ messages in thread

* bug#34346: 26.1; Big hang when opening text (racket) files with .art extension (image-mode)
  2019-02-06 19:11     ` Glenn Morris
@ 2019-02-06 20:53       ` Pierre Neidhardt
  2019-02-07  3:30         ` Eli Zaretskii
  0 siblings, 1 reply; 17+ messages in thread
From: Pierre Neidhardt @ 2019-02-06 20:53 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 34346

[-- Attachment #1: Type: text/plain, Size: 778 bytes --]

> 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/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* bug#34346: 26.1; Big hang when opening text (racket) files with .art extension (image-mode)
  2019-02-06 15:47 ` Eli Zaretskii
  2019-02-06 19:09   ` Glenn Morris
@ 2019-02-06 20:55   ` Pierre Neidhardt
  1 sibling, 0 replies; 17+ messages in thread
From: Pierre Neidhardt @ 2019-02-06 20:55 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 34346

[-- Attachment #1: Type: text/plain, Size: 151 bytes --]


> This is a duplicate of https://debbugs.gnu.org/22289 .

It is indeed, thanks for looking it up!

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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* bug#34346: 26.1; Big hang when opening text (racket) files with .art extension (image-mode)
  2019-02-06 20:53       ` Pierre Neidhardt
@ 2019-02-07  3:30         ` Eli Zaretskii
  2019-02-07 12:04           ` Pierre Neidhardt
  0 siblings, 1 reply; 17+ messages in thread
From: Eli Zaretskii @ 2019-02-07  3:30 UTC (permalink / raw)
  To: Pierre Neidhardt; +Cc: 34346

> From: Pierre Neidhardt <mail@ambrevar.xyz>
> Cc: Eli Zaretskii <eliz@gnu.org>, 34346@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.





^ permalink raw reply	[flat|nested] 17+ messages in thread

* bug#34346: 26.1; Big hang when opening text (racket) files with .art extension (image-mode)
  2019-02-07  3:30         ` Eli Zaretskii
@ 2019-02-07 12:04           ` Pierre Neidhardt
  2019-02-07 14:44             ` Eli Zaretskii
  0 siblings, 1 reply; 17+ messages in thread
From: Pierre Neidhardt @ 2019-02-07 12:04 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 34346

[-- Attachment #1: Type: text/plain, Size: 470 bytes --]


> 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/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* bug#34346: 26.1; Big hang when opening text (racket) files with .art extension (image-mode)
  2019-02-07 12:04           ` Pierre Neidhardt
@ 2019-02-07 14:44             ` Eli Zaretskii
  2019-02-07 14:59               ` Pierre Neidhardt
  2019-02-07 15:52               ` Stephen Berman
  0 siblings, 2 replies; 17+ messages in thread
From: Eli Zaretskii @ 2019-02-07 14:44 UTC (permalink / raw)
  To: Pierre Neidhardt; +Cc: 34346

> From: Pierre Neidhardt <mail@ambrevar.xyz>
> Cc: rgm@gnu.org, 34346@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.





^ permalink raw reply	[flat|nested] 17+ messages in thread

* bug#34346: 26.1; Big hang when opening text (racket) files with .art extension (image-mode)
  2019-02-07 14:44             ` Eli Zaretskii
@ 2019-02-07 14:59               ` Pierre Neidhardt
  2019-02-07 17:27                 ` Eli Zaretskii
  2019-02-07 15:52               ` Stephen Berman
  1 sibling, 1 reply; 17+ messages in thread
From: Pierre Neidhardt @ 2019-02-07 14:59 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 34346

[-- Attachment #1: Type: text/plain, Size: 113 bytes --]

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

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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* bug#34346: 26.1; Big hang when opening text (racket) files with .art extension (image-mode)
  2019-02-07 14:44             ` Eli Zaretskii
  2019-02-07 14:59               ` Pierre Neidhardt
@ 2019-02-07 15:52               ` Stephen Berman
  2019-02-07 16:59                 ` Glenn Morris
  1 sibling, 1 reply; 17+ messages in thread
From: Stephen Berman @ 2019-02-07 15:52 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 34346, Pierre Neidhardt

On Thu, 07 Feb 2019 16:44:21 +0200 Eli Zaretskii <eliz@gnu.org> wrote:

>> From: Pierre Neidhardt <mail@ambrevar.xyz>
>> Cc: rgm@gnu.org, 34346@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@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





^ permalink raw reply	[flat|nested] 17+ messages in thread

* bug#34346: 26.1; Big hang when opening text (racket) files with .art extension (image-mode)
  2019-02-07 15:52               ` Stephen Berman
@ 2019-02-07 16:59                 ` Glenn Morris
  2019-02-07 17:07                   ` Pierre Neidhardt
  0 siblings, 1 reply; 17+ messages in thread
From: Glenn Morris @ 2019-02-07 16:59 UTC (permalink / raw)
  To: Stephen Berman; +Cc: 34346, Pierre Neidhardt

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





^ permalink raw reply	[flat|nested] 17+ messages in thread

* bug#34346: 26.1; Big hang when opening text (racket) files with .art extension (image-mode)
  2019-02-07 16:59                 ` Glenn Morris
@ 2019-02-07 17:07                   ` Pierre Neidhardt
  0 siblings, 0 replies; 17+ messages in thread
From: Pierre Neidhardt @ 2019-02-07 17:07 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 34346, Stephen Berman

[-- Attachment #1: Type: text/plain, Size: 166 bytes --]

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/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* bug#34346: 26.1; Big hang when opening text (racket) files with .art extension (image-mode)
  2019-02-07 14:59               ` Pierre Neidhardt
@ 2019-02-07 17:27                 ` Eli Zaretskii
  0 siblings, 0 replies; 17+ messages in thread
From: Eli Zaretskii @ 2019-02-07 17:27 UTC (permalink / raw)
  To: Pierre Neidhardt; +Cc: 34346

> From: Pierre Neidhardt <mail@ambrevar.xyz>
> Cc: rgm@gnu.org, 34346@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.





^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2019-02-07 17:27 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-06 12:31 bug#34346: 26.1; Big hang when opening text (racket) files with .art extension (image-mode) Pierre Neidhardt
2019-02-06 14:01 ` Basil L. Contovounesios
2019-02-06 14:15   ` Pierre Neidhardt
2019-02-06 15:47 ` Eli Zaretskii
2019-02-06 19:09   ` Glenn Morris
2019-02-06 19:11     ` Glenn Morris
2019-02-06 20:53       ` Pierre Neidhardt
2019-02-07  3:30         ` Eli Zaretskii
2019-02-07 12:04           ` Pierre Neidhardt
2019-02-07 14:44             ` Eli Zaretskii
2019-02-07 14:59               ` Pierre Neidhardt
2019-02-07 17:27                 ` Eli Zaretskii
2019-02-07 15:52               ` Stephen Berman
2019-02-07 16:59                 ` Glenn Morris
2019-02-07 17:07                   ` Pierre Neidhardt
2019-02-06 20:55   ` Pierre Neidhardt
2019-02-06 18:27 ` Glenn Morris

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).