unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#18628: Emacs hangs trying to open "CON" file (on Windows)
@ 2014-10-04 15:20 Lee Houghton
  2014-10-04 16:51 ` Eli Zaretskii
  2016-06-08 22:18 ` Noam Postavsky
  0 siblings, 2 replies; 6+ messages in thread
From: Lee Houghton @ 2014-10-04 15:20 UTC (permalink / raw)
  To: 18628

Hello,

I don't know if this can really be counted as a bug, as CON is the
windows equivalent of /dev/stdin, (and of course I deserve it for
using Windows), but it is a frustrating problem, especially when I am
using helm-mode and trying to get my "config" directory and it decides
to read the "CON" file instead. I

t doesn't matter where you are in the file system, CON is also
omnipresent, and it also happens when trying to read files such as
CON.txt, as Windows considers it to be the same file as CON (though
this doesn't appear in the file listing).

Perhaps emacs should refuse to open this file. Or should this be
something I should forward to the helm-mode developers?

Regards,
Lee

To reproduce the problem:

Open the scratch buffer, execute (find-file "CON") and watch emacs hang.

The top of the stack is (I don't have debugging symbols for emacs,
only the Windows libraries):

ntdll.dll!_NtReadFile@36 () Unknown
KernelBase.dll!_ReadFile@20 () Unknown
msvcrt.dll!__read_nolock () Unknown
msvcrt.dll!__read () Unknown
emacs.exe!01022134() Unknown
[Frames below may be incorrect and/or missing, no symbols loaded for emacs.exe]

In GNU Emacs 24.3.1 (i386-mingw-nt6.2.9200)
 of 2013-03-17 on MARVIN
Windowing system distributor `Microsoft Corp.', version 6.2.9200
Configured using:
 `configure --with-gcc (4.7) --cflags
 -ID:/devel/emacs/libs/libXpm-3.5.8/include
 -ID:/devel/emacs/libs/libXpm-3.5.8/src
 -ID:/devel/emacs/libs/libpng-dev_1.4.3-1/include
 -ID:/devel/emacs/libs/zlib-dev_1.2.5-2/include
 -ID:/devel/emacs/libs/giflib-4.1.4-1/include
 -ID:/devel/emacs/libs/jpeg-6b-4/include
 -ID:/devel/emacs/libs/tiff-3.8.2-1/include
 -ID:/devel/emacs/libs/gnutls-3.0.9/include
 -ID:/devel/emacs/libs/libiconv-1.13.1-1-dev/include
 -ID:/devel/emacs/libs/libxml2-2.7.8/include/libxml2'

Important settings:
  value of $LANG: ENG
  locale-coding-system: cp1252
  default enable-multibyte-characters: t

Major mode: Lisp Interaction

Minor modes in effect:
  helm-mode: t
  shell-dirtrack-mode: t
  helm-match-plugin-mode: t
  helm-occur-match-plugin-mode: t
  electric-pair-mode: t
  electric-indent-mode: t
  desktop-save-mode: t
  delete-selection-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
y M-x r e p o r t <down> <down> <down> <down> <ret
urn>

Recent messages:
Loading delsel...done
Loading desktop...done
Loading electric...done
Helm completion enabled
Warning: desktop file appears to be in use by PID 11008.
Using it may cause conflicts.  Use it anyway? (y or n)  y
Desktop: 0 buffers restored.
For information about GNU Emacs and the GNU system, type C-h C-a.

Load-path shadows:
c:/Users/CTG/AppData/Roaming/.emacs.d/elpa/js2-mode-20140114/.dir-locals
hides c:/Users/CTG/Programs/emacs-24.3/lisp/gnus/.dir-locals

Features:
(shadow sort mail-extr emacsbug message rfc822 mml mml-sec mm-decode
mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader
sendmail rfc2047 rfc2045 ietf-drums mail-utils helm-mode helm-files rx
image-dired tramp tramp-compat tramp-loaddefs shell pcomplete
format-spec dired-x easymenu dired-aux ffap thingatpt helm-buffers
helm-elscreen helm-tags helm-bookmark helm-adaptive helm-info helm-net
browse-url xml url url-proxy url-privacy url-expand url-methods
url-history url-cookie url-domsuf url-util url-parse auth-source
gnus-util mm-util mail-prsvr password-cache url-vars mailcap helm-plugin
bookmark pp helm-locate helm-help helm-match-plugin helm-grep
helm-regexp grep helm-external helm-utils warnings dired helm advice
help-fns advice-preload cl-macs gv helm-source eieio byte-opt bytecomp
byte-compile cconv cl-lib scss-mode flymake compile comint ansi-color
ring derived edmacro kmacro helm-autoloads async-autoloads
js2-mode-autoloads finder-inf rainbow-mode-autoloads scss-mode-autoloads
package electric desktop delsel cus-start cus-load time-date tooltip
ediff-hook vc-hooks lisp-float-type mwheel dos-w32 ls-lisp
w32-common-fns disp-table w32-win w32-vars tool-bar dnd fontset image
regexp-opt fringe tabulated-list newcomment lisp-mode register page
menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core frame cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer loaddefs
button faces cus-face macroexp files text-properties overlay sha1 md5
base64 format env code-pages mule custom widget hashtable-print-readable
backquote make-network-process w32 multi-tty emacs)





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

* bug#18628: Emacs hangs trying to open "CON" file (on Windows)
  2014-10-04 15:20 bug#18628: Emacs hangs trying to open "CON" file (on Windows) Lee Houghton
@ 2014-10-04 16:51 ` Eli Zaretskii
  2014-10-04 16:57   ` Glenn Morris
  2014-10-05 11:33   ` Lee Houghton
  2016-06-08 22:18 ` Noam Postavsky
  1 sibling, 2 replies; 6+ messages in thread
From: Eli Zaretskii @ 2014-10-04 16:51 UTC (permalink / raw)
  To: Lee Houghton; +Cc: 18628

> From: Lee Houghton <lee@theconnectgroup.net>
> Date: Sat, 4 Oct 2014 16:20:38 +0100
> 
> I don't know if this can really be counted as a bug, as CON is the
> windows equivalent of /dev/stdin, (and of course I deserve it for
> using Windows), but it is a frustrating problem, especially when I am
> using helm-mode and trying to get my "config" directory and it decides
> to read the "CON" file instead.

Please provide a reproducible recipe starting with "emacs -Q".  Just
typing "C-x C-f con TAB TAB" doesn't show CON in the completions, so
I'm unsure how you bump into this problem.

> To reproduce the problem:
> 
> Open the scratch buffer, execute (find-file "CON") and watch emacs hang.

Well, then don't do that, right?  There cannot be a usable file by
that name on Windows, so why would you need to try visiting it?





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

* bug#18628: Emacs hangs trying to open "CON" file (on Windows)
  2014-10-04 16:51 ` Eli Zaretskii
@ 2014-10-04 16:57   ` Glenn Morris
  2014-10-05 11:33   ` Lee Houghton
  1 sibling, 0 replies; 6+ messages in thread
From: Glenn Morris @ 2014-10-04 16:57 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Lee Houghton, 18628

Eli Zaretskii wrote:

> Well, then don't do that, right?  There cannot be a usable file by
> that name on Windows, so why would you need to try visiting it?

That's the awesome power of helm! ;)





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

* bug#18628: Emacs hangs trying to open "CON" file (on Windows)
  2014-10-04 16:51 ` Eli Zaretskii
  2014-10-04 16:57   ` Glenn Morris
@ 2014-10-05 11:33   ` Lee Houghton
  2014-10-05 14:36     ` Eli Zaretskii
  1 sibling, 1 reply; 6+ messages in thread
From: Lee Houghton @ 2014-10-05 11:33 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 18628

On 4 October 2014 17:51, Eli Zaretskii <eliz@gnu.org> wrote:
>> From: Lee Houghton <lee@theconnectgroup.net>
>> Date: Sat, 4 Oct 2014 16:20:38 +0100
>>
>> I don't know if this can really be counted as a bug, as CON is the
>> windows equivalent of /dev/stdin, (and of course I deserve it for
>> using Windows), but it is a frustrating problem, especially when I am
>> using helm-mode and trying to get my "config" directory and it decides
>> to read the "CON" file instead.
>
> Please provide a reproducible recipe starting with "emacs -Q".  Just
> typing "C-x C-f con TAB TAB" doesn't show CON in the completions, so
> I'm unsure how you bump into this problem.

Sorry, I didn't know that was required. The easiest way I found was:

emacs -Q con.js

Or if you want to go the long way...

emacs -Q --eval "(find-file \"CON.js\")"

(I hope I've understood what you mean by that.)

In this case, if I run it from the console, I can press Ctrl-C in the
console and then emacs un-hangs. But I imagine most people who run
emacs on Windows do so using runemacs and don't have a separate
console window in which to press Ctrl-C.

>> To reproduce the problem:
>>
>> Open the scratch buffer, execute (find-file "CON") and watch emacs hang.
>
> Well, then don't do that, right?  There cannot be a usable file by
> that name on Windows, so why would you need to try visiting it?

It is partly helm's fault. The reason I encounter this bug so often is
that I have a directory which contains two subdirectories,
"collections" and "config".  The quickest way for me to navigate to
the config directory would be C-x C-f c o n <right> (where C-x C-f is
bound to helm-find-file). Normally the <right> key would auto-complete
to the config directory. Instead what it does is try to preview the
"CON" file in the window I was just in, and emacs hangs. Sometimes I
remember to type "conf" before pressing <right>, sometimes I don't.
When I don't, I invariably kick myself :-)

The reason I chose this mailing list instead of the developers of
helm-mode is that
 a) Not many people know about the special behaviour of "CON" -- that
is, even if you add a file extension it still has the same behaviour
-- and could conceivably try to create a file called "con.c" or
similar, even if not using helm,
 b) No other text editor that I can find hangs when trying to create a
file named "con" or "con.c".

By all means close this bug if you think it's invalid! I am sure I
could find a workaround.





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

* bug#18628: Emacs hangs trying to open "CON" file (on Windows)
  2014-10-05 11:33   ` Lee Houghton
@ 2014-10-05 14:36     ` Eli Zaretskii
  0 siblings, 0 replies; 6+ messages in thread
From: Eli Zaretskii @ 2014-10-05 14:36 UTC (permalink / raw)
  To: Lee Houghton; +Cc: 18628

> From: Lee Houghton <lee@theconnectgroup.net>
> Date: Sun, 5 Oct 2014 12:33:36 +0100
> Cc: 18628@debbugs.gnu.org
> 
> > Please provide a reproducible recipe starting with "emacs -Q".  Just
> > typing "C-x C-f con TAB TAB" doesn't show CON in the completions, so
> > I'm unsure how you bump into this problem.
> 
> Sorry, I didn't know that was required. The easiest way I found was:
> 
> emacs -Q con.js
> 
> Or if you want to go the long way...
> 
> emacs -Q --eval "(find-file \"CON.js\")"
> 
> (I hope I've understood what you mean by that.)

Yes, I do understand.  But I cannot reproduce the problem with such a
simple recipe: for me, Emacs does not hang, but instead says "File
exists, but cannot be read", which sounds reasonable.

I tried this both on Windows 7 and on XP.  You seem to be on Windows
8, so perhaps this is something specific to that version.  I don't
have access to a Windows 8 machine, so I hope someone else will be
able to debug this.

> It is partly helm's fault. The reason I encounter this bug so often is
> that I have a directory which contains two subdirectories,
> "collections" and "config".  The quickest way for me to navigate to
> the config directory would be C-x C-f c o n <right> (where C-x C-f is
> bound to helm-find-file). Normally the <right> key would auto-complete
> to the config directory. Instead what it does is try to preview the
> "CON" file in the window I was just in, and emacs hangs. Sometimes I
> remember to type "conf" before pressing <right>, sometimes I don't.
> When I don't, I invariably kick myself :-)

Not sure this is the same problem (although it might be): the APIs
Emacs invokes for completion are different from those it invokes to
visit a file.





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

* bug#18628: Emacs hangs trying to open "CON" file (on Windows)
  2014-10-04 15:20 bug#18628: Emacs hangs trying to open "CON" file (on Windows) Lee Houghton
  2014-10-04 16:51 ` Eli Zaretskii
@ 2016-06-08 22:18 ` Noam Postavsky
  1 sibling, 0 replies; 6+ messages in thread
From: Noam Postavsky @ 2016-06-08 22:18 UTC (permalink / raw)
  To: 18628; +Cc: Lee Houghton

tag 18628 + unreproducible
quit

Eli Zaretskii <eliz <at> gnu.org> wrote:
> Yes, I do understand.  But I cannot reproduce the problem with such
> a simple recipe: for me, Emacs does not hang, but instead says "File
> exists, but cannot be read", which sounds reasonable.

Getting the same on Windows 8, Emacs 24.5 and 25.0.94.





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

end of thread, other threads:[~2016-06-08 22:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-04 15:20 bug#18628: Emacs hangs trying to open "CON" file (on Windows) Lee Houghton
2014-10-04 16:51 ` Eli Zaretskii
2014-10-04 16:57   ` Glenn Morris
2014-10-05 11:33   ` Lee Houghton
2014-10-05 14:36     ` Eli Zaretskii
2016-06-08 22:18 ` Noam Postavsky

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).