unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: <emacs@kosowsky.org>
To: Ted Zlatanov <tzz@lifelogs.com>
Cc: emacs@kosowsky.org, 15648@debbugs.gnu.org
Subject: bug#15648: 24.2.50; gnutls SSL connection to IMAP server causes emacs to crash completely
Date: Thu, 24 Oct 2013 10:10:08 -0400	[thread overview]
Message-ID: <21097.10816.221279.461499@consult.pretender> (raw)
In-Reply-To: <87eh7bj5no.fsf_-_@flea.lifelogs.com>

Ted Zlatanov wrote at about 06:59:39 -0400 on Thursday, October 24, 2013:
 > On Wed, 23 Oct 2013 19:45:48 -0400 <emacs@kosowsky.org> wrote: 
 > Provide a backtrace, please.  I promise you we'll consider your proposal
 > and all the alternatives as soon as we know what's broken.

OK... but before I invest in downloading and running a C-debugger,
I want to be clear that there are actually 2 bugs here - one at the
elisp level and one at the C-level

1. At the elisp level, gnutls.el fails to consistently and
   appropriately handle (or disable) Magic Files aka file handlers
   (including in particular, cygwin-mount).

   Specifically, gnutls-negotiate uses the Magic File associated
   primitive file-exists-p to test for the existence of a file but
   then passes off the unmodified (and non-existent) Magic File path
   (e.g., path relative to cygwin root) to some C-code. Clearly, short
   of passing nearly the entire Emacs state (including variable &
   function defs) to the C-code, it is impossible for the C-code to
   know what file handler to use to translate the Magic File into a
   system recognizable and valid path.

   I believe the nature of this bug is fully explored and understood.
   
   The solution is to treat Magic files appropriately and consistently
   either (1) by using the Magic File aware primitive expand-file-name
   to expand the file name before passing off to the C-code or (2)
   disabling Magic file handlers (and documenting that fact)

2. At the C-code level, there is a bug in that passing a
   non-existent/invalid file path may cause the entire Emacs code to
   crash.

   It is this bug that requires further C-source debugging to identify
   the source...

 > I will gladly make the change to avoid a path like
 > "/usr/ssl/whatever" that doesn't work in Cygwin, but I don't want
 > to make that change in order to hide an underlying problem.

Again, the issue is broader than just Cygwin paths... the code as-is
fails to handle any type of Magic File and associated file
handlers... and there is no reason or way for a user to suspect or
know that the officially include Emacs library gnutls.el chooses not
to handle Magic files correctly -- short of debugging, tracing, and
reading the detailed gnutls.el elisp code.


Also, as above, there is both a problem in the gnutls.el code AND in
the underlying C-code

 > In other words, if a magic path can break Emacs because of some library
 > interaction beneath the ELisp code, the fix is *probably* not at the
 > ELisp level because there are so many potential trigger points for the
 > bad behavior.

Wrong - the opposite is true. Handling of magic files via their
associated file handlers can *only* be done generally and properly at
the elisp level since short of passing the entire Emacs state to
external C-code, there is no way of the C-code knowing how to handle
potentially arbitrary file handlers.

It's very simple. File access and reference should only be done
via Magic File aware primitives. In particular, when passing a path to
external C-code, that code should first be translated by something like
expand-file-name to system-recognizable and valid paths.





  reply	other threads:[~2013-10-24 14:10 UTC|newest]

Thread overview: 80+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-18 18:29 bug#15648: 24.2.50; gnutls SSL connection to IMAP server causes emacs to crash completely emacs
2013-10-18 19:38 ` Glenn Morris
2013-10-20 20:24   ` emacs
2013-10-21 14:22   ` bug#15648: 24.2.50; gnutls SSL connection to IMAP server causes emacs to crash completely, " Ted Zlatanov
2013-10-21 19:30     ` emacs
2013-10-22 13:27       ` Ted Zlatanov
2013-10-22 15:23         ` emacs
2013-10-22 15:41           ` emacs
2013-10-22 19:10             ` emacs
2013-10-22 20:06               ` Ted Zlatanov
2013-10-22 20:22                 ` emacs
2013-10-22 20:34                   ` Eli Zaretskii
2013-10-22 22:27               ` emacs
2013-10-23  2:51                 ` Eli Zaretskii
2013-10-23  4:17                 ` emacs
2013-10-23 14:52                   ` Ted Zlatanov
2013-10-23 17:25                     ` emacs
2013-10-23 18:07                       ` Eli Zaretskii
2013-10-23 18:58                         ` Ted Zlatanov
2013-10-23 23:45                           ` emacs
2013-10-24  0:13                             ` emacs
2013-10-24 10:59                             ` Ted Zlatanov
2013-10-24 14:10                               ` emacs [this message]
2013-10-24 15:48                                 ` Ted Zlatanov
2013-10-24 17:02                                   ` emacs
2013-10-24 17:57                                 ` Stefan Monnier
2013-10-24 18:42                                   ` emacs
2013-10-25  0:59                                     ` Stefan Monnier
2013-10-25 13:59                                       ` emacs
2013-10-26  1:52                                         ` Stefan Monnier
2013-10-29  5:13                                           ` emacs
2013-11-03 11:42                                           ` Ted Zlatanov
2013-11-03 15:12                                             ` emacs
2013-11-03 17:32                                               ` Eli Zaretskii
2013-11-03 19:12                                                 ` emacs
2013-11-04 16:28                                                 ` Ted Zlatanov
2013-11-04 16:58                                                   ` Eli Zaretskii
2013-11-11 19:12                                                     ` emacs
2013-11-11 19:42                                                       ` Ted Zlatanov
2013-11-11 20:00                                                         ` emacs
2013-11-11 20:00                                                         ` Achim Gratz
2013-11-11 23:58                                                           ` Ted Zlatanov
2013-11-12  0:45                                                             ` emacs
2013-11-11 20:06                                                       ` Eli Zaretskii
2013-11-11 21:53                                                         ` emacs
2013-11-12  3:56                                                           ` Eli Zaretskii
2013-11-12 15:19                                                             ` emacs
2013-11-12 17:42                                                               ` Eli Zaretskii
     [not found]                                                               ` <<83ppq51pq8.fsf@gnu.org>
2013-11-12 18:08                                                                 ` Drew Adams
2013-11-03 21:37                                             ` Stefan Monnier
2013-10-23 15:16                   ` bug#15648: 24.2.50; gnutls SSL connection to IMAP server causes emacs to crash completely, " Eli Zaretskii
2013-10-23 17:12                     ` emacs
2013-10-23 18:00                       ` Eli Zaretskii
2013-10-23 19:49                         ` emacs
2013-10-24  2:46                           ` Eli Zaretskii
2013-10-25  3:17                         ` emacs
2013-10-25 14:09                           ` Eli Zaretskii
2013-10-25 15:38                             ` Ted Zlatanov
2013-10-25 18:37                               ` Eli Zaretskii
2013-11-03 17:30                                 ` Eli Zaretskii
2013-11-04 16:44                                 ` Ted Zlatanov
2013-11-04 17:06                                   ` Eli Zaretskii
2013-11-04 18:05                                     ` Ted Zlatanov
2013-11-04 22:14                                       ` emacs
2013-11-05  2:30                                         ` Ted Zlatanov
2013-11-05 23:11                                           ` emacs
2013-11-05 23:16                                             ` Alp Aker
2013-11-05 23:54                                               ` emacs
2013-11-11 15:53                                                 ` Ted Zlatanov
2013-11-11 19:40                                                   ` emacs
2013-11-11 20:11                                                     ` Eli Zaretskii
2013-11-11 21:56                                                       ` emacs
2013-11-12  3:58                                                         ` Eli Zaretskii
2013-11-12 15:23                                                           ` emacs
2013-11-06  3:51                                             ` Eli Zaretskii
2013-11-06  5:45                                               ` emacs
2013-10-22 15:43         ` bug#15648: 24.2.50; gnutls SSL connection to IMAP server causes emacs to crash completely, " Eli Zaretskii
2013-10-22 20:03           ` Ted Zlatanov
2013-10-22 20:35           ` Andy Moreton
2013-10-22 20:45             ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=21097.10816.221279.461499@consult.pretender \
    --to=emacs@kosowsky.org \
    --cc=15648@debbugs.gnu.org \
    --cc=tzz@lifelogs.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).