Re: [Mutt] #3779: segfault on OSX during cert acceptance prompt

2015-10-03 Thread Mutt
#3779: segfault on OSX during cert acceptance prompt
-+-
  Reporter:  balderdash  |  Owner:  brendan
  Type:  defect  | Status:  new
  Priority:  major   |  Milestone:
 Component:  IMAP|Version:  1.5.23
Resolution:  |   Keywords:
-+-

Comment (by Kevin McCarthy ):

 In [ac156dcc2c54190491c5ab61fa865ec50e6f]:
 {{{
 #!CommitTicketReference repository=""
 revision="ac156dcc2c54190491c5ab61fa865ec50e6f"
 Fix menu type in certificate prompt.  (see #3779)

 The menu type is used in several places as a direct index into
 Keymaps[], so passing in -1 to mutt_new_menu() was leading to illegal
 memory accesses later on.

 Add a range check in mutt_new_menu(), defaulting to MENU_GENERIC, to
 prevent this problem in the future.
 }}}

-- 
Ticket URL: 
Mutt 
The Mutt mail user agent



Re: [Mutt] #3779: segfault on OSX during cert acceptance prompt

2015-10-03 Thread Mutt
#3779: segfault on OSX during cert acceptance prompt
-+-
  Reporter:  balderdash  |  Owner:  brendan
  Type:  defect  | Status:  closed
  Priority:  major   |  Milestone:
 Component:  IMAP|Version:  1.5.23
Resolution:  fixed   |   Keywords:
-+-
Changes (by Kevin McCarthy ):

 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [a07e8215a0efdbf73bdcc5280b5acb3a964c4708]:
 {{{
 #!CommitTicketReference repository=""
 revision="a07e8215a0efdbf73bdcc5280b5acb3a964c4708"
 Create a separate macro/push/exec event buffer.  (closes #3779)

 Currently, the SSL and TLS certficate prompts turn on
 OPTUNBUFFEREDINPUT, (to prevent macros and such from running right
 through the dialog).  Unfortunately, the menu dialog processing in
 menu_dialog_dokey() is using mutt_ungetch() to forward non-dialog keys
 on to standard menu processing.  With OPTUNBUFFEREDINPUT set, those keys
 never make it to the menu and are buffered until after the menu dialog.

 This patch creates a new event buffer, separate from the standard
 "unget" buffer, for use by macros, exec, and push events.  These events
 can be temporarily ignored by setting OPTIGNOREMACROEVENTS (renamed
 from OPTUNBUFFEREDINPUT), while continuing to allow unget events to be
 processed.

 Since the "push" and "unget" functions now go to different buffers,
 function names were slightly renamed, to make it less easy to
 unintentionally use the wrong function at the wrong time.
 }}}

-- 
Ticket URL: 
Mutt 
The Mutt mail user agent



Re: [Mutt] #3779: segfault on OSX during cert acceptance prompt

2015-09-26 Thread Mutt
#3779: segfault on OSX during cert acceptance prompt
-+-
  Reporter:  balderdash  |  Owner:  brendan
  Type:  defect  | Status:  new
  Priority:  major   |  Milestone:
 Component:  IMAP|Version:  1.5.23
Resolution:  |   Keywords:
-+-

Comment (by kevin8t8):

 Thank you for testing those patches!  I'm glad to hear it stopped the
 segfaults and we are seeing consistent behavior.

 My schedule has been a bit crazy recently, but when I have a chance, I
 will work on a different patch for the buffering issue, and let you know
 when I have something better to test.

-- 
Ticket URL: 
Mutt 
The Mutt mail user agent



Re: [Mutt] #3779: segfault on OSX during cert acceptance prompt

2015-09-24 Thread Mutt
#3779: segfault on OSX during cert acceptance prompt
-+-
  Reporter:  balderdash  |  Owner:  brendan
  Type:  defect  | Status:  new
  Priority:  major   |  Milestone:
 Component:  IMAP|Version:  1.5.23
Resolution:  |   Keywords:
-+-

Comment (by balderdash):

 I tried fix-menu-type.patch.  I didn't see a segfault in about ten
 minutes' worth of fiddling around.  It was, as you said, behaving very
 strangely.

 Then I tried fix-menu-type and part-2-turn-off-unbuffered at the same
 time, and in another few minutes of fiddling, everything seemed as it
 should be.

 Let me know if you need me to test more stuff.

-- 
Ticket URL: 
Mutt 
The Mutt mail user agent



Re: [Mutt] #3779: segfault on OSX during cert acceptance prompt

2015-09-23 Thread Mutt
#3779: segfault on OSX during cert acceptance prompt
-+-
  Reporter:  balderdash  |  Owner:  brendan
  Type:  defect  | Status:  new
  Priority:  major   |  Milestone:
 Component:  IMAP|Version:  1.5.23
Resolution:  |   Keywords:
-+-

Comment (by kevin8t8):

 I'm attaching fix-menu-type.patch which I believe will stop the segfaults.
 (Please unapply and ignore part-1-check-menu-range.patch)

 Note that this patch by itself will lead to strange behavior: if you don't
 press one of r/o/a, every other character you press, starting with the
 first, will be "saved".  While every other character, starting with the
 second, will be evaluated right away.  The characters which are "saved"
 will actually be evaluated in the index afterwards so be careful what you
 press (e.g. "d" might invoke  later in the index).

 You can combine fix-menu-type.patch with part-2-turn-off-unbuffered.patch
 to bring back normal behavior.  But I'm still working on a better patch
 than part-2-turn-off-unbuffered.patch.

 Would you mind testing this to see if this stops the segfaults and you see
 the behavior I'm describing?

 Thank you for your help and patience with this, balderdash!

-- 
Ticket URL: 
Mutt 
The Mutt mail user agent



Re: [Mutt] #3779: segfault on OSX during cert acceptance prompt

2015-09-22 Thread Mutt
#3779: segfault on OSX during cert acceptance prompt
-+-
  Reporter:  balderdash  |  Owner:  brendan
  Type:  defect  | Status:  new
  Priority:  major   |  Milestone:
 Component:  IMAP|Version:  1.5.23
Resolution:  |   Keywords:
-+-

Comment (by balderdash):

 First I tested the part-1 patch.

 It no longer segfaulted immediately upon pressing a non-{r,o,a} key, and
 if I follow a keypress with one of r/o/a mutt does what I expect it to.

 However, pressing something like "m" *never* brings up "key is not bound".

 Also (worst of all) hitting "?" brings on the segfault.

 Perhaps one thing that may help: when mutt *does* segfault in the cert
 menu, the whole terminal session is messed up.  No amount of 'clear' or
 ctrl-L pressing will fix it.  This is true in Terminal.app and iTerm2.
 Shell is bash.

-- 
Ticket URL: 
Mutt 
The Mutt mail user agent



Re: [Mutt] #3779: segfault on OSX during cert acceptance prompt

2015-09-22 Thread Mutt
#3779: segfault on OSX during cert acceptance prompt
-+-
  Reporter:  balderdash  |  Owner:  brendan
  Type:  defect  | Status:  new
  Priority:  major   |  Milestone:
 Component:  IMAP|Version:  1.5.23
Resolution:  |   Keywords:
-+-

Comment (by balderdash):

 OK, I tested the part-2 patch (on top of the part-1 patch) and part2 made
 it worse.  There is now immediate segfaulting again upon pressing any
 alphanumeric key other than r/o/a.

 This time I did happen to test a couple of non-alphanums, namely F5 and
 TAB.  The former didn't do anything, and the latter segfaulted
 immediately.

-- 
Ticket URL: 
Mutt 
The Mutt mail user agent



Re: [Mutt] #3779: segfault on OSX during cert acceptance prompt

2015-09-22 Thread Mutt
#3779: segfault on OSX during cert acceptance prompt
-+-
  Reporter:  balderdash  |  Owner:  brendan
  Type:  defect  | Status:  new
  Priority:  major   |  Milestone:
 Component:  IMAP|Version:  1.5.23
Resolution:  |   Keywords:
-+-

Comment (by balderdash):

 > So far I'm having trouble duplicating this. Would you provide some more
 details - perhaps another setting or configuration is causing this?
 Exactly which key do you hit which causes the segfault? Are you using
 gnutls or openssl? Is there any way you could get a stack trace?

 I am using openssl.  Any alphanumeric key other than r/o/a will cause a
 segfault.  Perhaps other keys do too, I haven't tried things like F7 or
 TAB.

 I'm afraid I don't know what a stack trace is.  I'm not a programmer.  I
 could try to get one if you tell me what to do.

-- 
Ticket URL: 
Mutt 
The Mutt mail user agent



Re: [Mutt] #3779: segfault on OSX during cert acceptance prompt

2015-09-22 Thread Mutt
#3779: segfault on OSX during cert acceptance prompt
-+-
  Reporter:  balderdash  |  Owner:  brendan
  Type:  defect  | Status:  new
  Priority:  major   |  Milestone:
 Component:  IMAP|Version:  1.5.23
Resolution:  |   Keywords:
-+-

Comment (by kevin8t8):

 Just to follow up, I do notice some goofiness.  I have to hit "?" twice
 for the help menu to come up, and have to hit another key, e.g. "m", three
 times until mutt finally says "Key is not bound."  The problem may have
 something to do with the segfault you are getting.  I'll try to trace
 through this and see if I can figure it out.

-- 
Ticket URL: 
Mutt 
The Mutt mail user agent



Re: [Mutt] #3779: segfault on OSX during cert acceptance prompt

2015-09-22 Thread Mutt
#3779: segfault on OSX during cert acceptance prompt
-+-
  Reporter:  balderdash  |  Owner:  brendan
  Type:  defect  | Status:  new
  Priority:  major   |  Milestone:
 Component:  IMAP|Version:  1.5.23
Resolution:  |   Keywords:
-+-

Comment (by kevin8t8):

 It looks like interactive_check_cert() and tls_check_one_certificate() are
 both setting OPTUNBUFFEREDINPUT.  However, inside mutt_menuLoop(),
 menu_dialog_dokey() is trying to take a look at the next character to see
 if it's one of the "r/o/a" defined in the dialog.  If not it's calling
 mutt_ungetch() to put the character back on the stack.  But with
 unbuffered input, the next call to mutt_getch() [km_dokey] is not looking
 at the KeyEvent stack!

 That's probably what's causing having to hit "?" twice.

 Additionally, I notice they are both calling
 {{{
 menu = mutt_new_menu (-1);
 }}}

 Inside km_dokey:
 {{{
   struct keymap_t *map = Keymaps[menu];
 }}}
 where menu is -1.  So that seems likely to be causing your segfault.

 I'm not sure whether the intent of setting up the dialog was to completely
 override the menu system, or whether we should just be using MENU_GENERIC
 when setting it up.  Regardless, setting unbuffered input seems contrary
 to how menu_dialog_dokey() is working, so that probably needs to be turned
 off.

 I'll play around with this and create a patch later today.

-- 
Ticket URL: 
Mutt 
The Mutt mail user agent



Re: [Mutt] #3779: segfault on OSX during cert acceptance prompt

2015-09-22 Thread Mutt
#3779: segfault on OSX during cert acceptance prompt
-+-
  Reporter:  balderdash  |  Owner:  brendan
  Type:  defect  | Status:  new
  Priority:  major   |  Milestone:
 Component:  IMAP|Version:  1.5.23
Resolution:  |   Keywords:
-+-

Comment (by kevin8t8):

 I'm attaching a couple patches I'd appreciate if you would test.

 * part-1-check-menu-range.patch should hopefully stop the segfault (if my
 guess about the cause was correct).

 * part-2-turn-off-unbuffered.patch is a "simple" fix for the unbuffered
 input problem, but it will have side effects (pushed input will be
 processed by the prompt instead of the index).

 I'm still thinking about better ways to fix this, but I'd appreciate if
 you would test these patches and see if they at least stop the segfault
 and restore reasonable behavior to the certificate prompt.

-- 
Ticket URL: 
Mutt 
The Mutt mail user agent



Re: [Mutt] #3779: segfault on OSX during cert acceptance prompt

2015-09-21 Thread Mutt
#3779: segfault on OSX during cert acceptance prompt
-+-
  Reporter:  balderdash  |  Owner:  brendan
  Type:  defect  | Status:  new
  Priority:  major   |  Milestone:
 Component:  IMAP|Version:  1.5.23
Resolution:  |   Keywords:
-+-

Comment (by kevin8t8):

 So far I'm having trouble duplicating this.  Would you provide some more
 details - perhaps another setting or configuration is causing this?
 Exactly which key do you hit which causes the segfault?  Are you using
 gnutls or openssl?  Is there any way you could get a stack trace?

-- 
Ticket URL: 
Mutt 
The Mutt mail user agent



[Mutt] #3779: segfault on OSX during cert acceptance prompt

2015-09-09 Thread Mutt
#3779: segfault on OSX during cert acceptance prompt
+-
 Reporter:  balderdash  |  Owner:  brendan
 Type:  defect  | Status:  new
 Priority:  major   |  Milestone:
Component:  IMAP|Version:  1.5.23
 Keywords:  |
+-
 On OSX 10.10.5, and mutt built from latest tip, the following segfault is
 reproducible for me every time.

 Open an imap connection to some server (e.g., gmail or hotmail) that will
 cause the prompt for cert acceptance to pop up.  (The one with "(r)eject,
 (o)nce, (a)lways" as the options). Now hit any letter key OTHER than
 {r,o,a}, and mutt will segfault within a couple of seconds.  Sometimes the
 segfault waits until I hit {r,o,a}.

 I see this in both Terminal.app and iTerm2.

-- 
Ticket URL: 
Mutt 
The Mutt mail user agent