On Wed, Mar 18, 2020 at 07:31:35PM +0000, Rainer Weikusat wrote: > Package: dialog > Version: 1.3-20190211-1 > Severity: normal > Tags: patch > > As originally reported in #930775, the dialog program aborts with an exit > status of > 255 after resizing a widget. This is due to the dlg_win_resize function > (util.c) > configuring an input timeout of 0.02s which is then left in place, causing > the next > regular character read (via dlg_getc in ui_getc.c) to fail with a timeout the > code > isn't prepared to handle. The orignal command for triggering this was > > dialog --msgbox Text 0 0 > > Supposedly, this issue is fixed in 1.3-20190808-1 but this isn't the case: > The relevant > change in there ignores getc errors after a resize until some key event is > received.
I'm not seeing this behavior. In 20190724, I added wtimeout(win, 0); which conflicts with the suggested patch and leaves the input in nonblocking (rather than blocking) input. 2019/07/24 + modify dlg_will_resize() and dlg_result_key() functions to reduce the chance that dialog exits on a SIGWINCH (Debian #930775). > Because of this, the bug can no longer be triggered via msgbox as the only > key event > processed by that cause the program to exit. It's still possible to trigger > the issue > by using > > dialog --yesno Ohno 0 0 > > resizing the window and then pressing <tab> to switch from the yes- to the > no-button. If I resize the window, the dialog doesn't exit by itself. Pressing either enter or space gives an exit-code 1 (which is expected). The original test-case with msgbox also appears to work as expected. -- Thomas E. Dickey <dic...@invisible-island.net> https://invisible-island.net ftp://ftp.invisible-island.net
#!/bin/sh rm -f dialog.log export DIALOGOPTS="--trace dialog.log" dialog --msgbox Text 0 0 echo $?
** opened at Fri Mar 20 15:43:55 2020 ** dialog 1.3-20160828 # Parameters: # argv[0] = --trace # argv[1] = dialog.log # init_result # process_common_options, offset 0 # argv[0] = --trace # ignore extra --trace option # Parameters: # argv[0] = --trace # argv[1] = dialog.log # process_common_options, offset 1 # argv[1] = --msgbox # dlg_default_button() = 0 # dlg_register_window msgbox # key bindings for msgbox widgets bindkey msgbox ^E HELPFILE bindkey msgbox F1 HELPFILE bindkey msgbox HELP HELPFILE bindkey msgbox ^J ENTER bindkey msgbox ^M ENTER bindkey msgbox ENTER ENTER bindkey msgbox \s ENTER bindkey msgbox DOWN FIELD_NEXT bindkey msgbox RIGHT FIELD_NEXT bindkey msgbox ^I FIELD_NEXT bindkey msgbox UP FIELD_PREV bindkey msgbox BTAB FIELD_PREV bindkey msgbox LEFT FIELD_PREV bindkey msgbox DOWN GRID_DOWN bindkey msgbox UP GRID_UP bindkey msgbox HOME PAGE_FIRST bindkey msgbox END PAGE_LAST bindkey msgbox NPAGE PAGE_NEXT bindkey msgbox PPAGE PAGE_PREV bindkey msgbox J GRID_DOWN bindkey msgbox j GRID_DOWN bindkey msgbox K GRID_UP bindkey msgbox k GRID_UP bindkey msgbox g PAGE_FIRST bindkey msgbox G PAGE_LAST bindkey msgbox F PAGE_NEXT bindkey msgbox f PAGE_NEXT bindkey msgbox B PAGE_PREV bindkey msgbox b PAGE_PREV # mouse_mkregion 3,4 1x6 0 (10) # mouse_mkregion 3,4 1x6 0 (0) window 5x16 at 9,31 0:+--------------+ 1:| Text | 2:+--------------+ 3:| < OK > | 4:+--------------+ chr KEY_RESIZE (ch=0x19a, fkey=410) window 5x16 at 9,31 0:+--------------+ 1:| Text | 2:+--------------+ 3:| < OK > | 4:+--------------+ chr KEY_RESIZE (ch=0x19a, fkey=410) window 5x16 at 9,31 0:+--------------+ 1:| Text | 2:+--------------+ 3:| < OK > | 4:+--------------+ chr KEY_RESIZE (ch=0x19a, fkey=410) # mouse_mkregion 3,4 1x6 10 (10) # mouse_mkregion 3,4 1x6 0 (0) window 5x16 at 9,32 0:+--------------+ 1:| Text | 2:+--------------+ 3:| < OK > | 4:+--------------+ chr KEY_RESIZE (ch=0x19a, fkey=410) # mouse_mkregion 3,4 1x6 10 (10) # mouse_mkregion 3,4 1x6 0 (0) window 5x16 at 10,33 0:+--------------+ 1:| Text | 2:+--------------+ 3:| < OK > | 4:+--------------+ chr KEY_RESIZE (ch=0x19a, fkey=410) # mouse_mkregion 3,4 1x6 10 (10) # mouse_mkregion 3,4 1x6 0 (0) window 5x16 at 10,35 0:+--------------+ 1:| Text | 2:+--------------+ 3:| < OK > | 4:+--------------+ chr KEY_RESIZE (ch=0x19a, fkey=410) # mouse_mkregion 3,4 1x6 10 (10) # mouse_mkregion 3,4 1x6 0 (0) window 5x16 at 11,36 0:+--------------+ 1:| Text | 2:+--------------+ 3:| < OK > | 4:+--------------+ chr KEY_RESIZE (ch=0x19a, fkey=410) # mouse_mkregion 3,4 1x6 10 (10) # mouse_mkregion 3,4 1x6 0 (0) window 5x16 at 11,37 0:+--------------+ 1:| Text | 2:+--------------+ 3:| < OK > | 4:+--------------+ chr KEY_RESIZE (ch=0x19a, fkey=410) # mouse_mkregion 3,4 1x6 10 (10) # mouse_mkregion 3,4 1x6 0 (0) window 5x16 at 11,38 0:+--------------+ 1:| Text | 2:+--------------+ 3:| < OK > | 4:+--------------+ chr KEY_RESIZE (ch=0x19a, fkey=410) # mouse_mkregion 3,4 1x6 10 (10) # mouse_mkregion 3,4 1x6 0 (0) window 5x16 at 11,39 0:+--------------+ 1:| Text | 2:+--------------+ 3:| < OK > | 4:+--------------+ chr KEY_RESIZE (ch=0x19a, fkey=410) # mouse_mkregion 3,4 1x6 10 (10) # mouse_mkregion 3,4 1x6 0 (0) window 5x16 at 12,39 0:+--------------+ 1:| Text | 2:+--------------+ 3:| < OK > | 4:+--------------+ chr DLGK_ENTER (ch=0x21d, fkey=541) # dlg_ok_buttoncode(0) = 0 # widget returns 0 ** closed at Fri Mar 20 15:43:59 2020
#!/bin/sh rm -f dialog.log export DIALOGOPTS="--trace dialog.log" dialog --yesno Ohno 0 0 echo $?
** opened at Fri Mar 20 15:42:29 2020 ** dialog 1.3-20160828 # Parameters: # argv[0] = --trace # argv[1] = dialog.log # init_result # process_common_options, offset 0 # argv[0] = --trace # ignore extra --trace option # Parameters: # argv[0] = --trace # argv[1] = dialog.log # process_common_options, offset 1 # argv[1] = --yesno # dlg_default_button() = 0 # dlg_register_window yesno # key bindings for yesno widgets bindkey yesno ^E HELPFILE bindkey yesno F1 HELPFILE bindkey yesno HELP HELPFILE bindkey yesno ^J ENTER bindkey yesno ^M ENTER bindkey yesno ENTER ENTER bindkey yesno \s ENTER bindkey yesno DOWN FIELD_NEXT bindkey yesno RIGHT FIELD_NEXT bindkey yesno ^I FIELD_NEXT bindkey yesno UP FIELD_PREV bindkey yesno BTAB FIELD_PREV bindkey yesno LEFT FIELD_PREV bindkey yesno DOWN GRID_DOWN bindkey yesno UP GRID_UP bindkey yesno HOME PAGE_FIRST bindkey yesno END PAGE_LAST bindkey yesno NPAGE PAGE_NEXT bindkey yesno PPAGE PAGE_PREV bindkey yesno J GRID_DOWN bindkey yesno j GRID_DOWN bindkey yesno K GRID_UP bindkey yesno k GRID_UP bindkey yesno g PAGE_FIRST bindkey yesno G PAGE_LAST bindkey yesno F PAGE_NEXT bindkey yesno f PAGE_NEXT bindkey yesno B PAGE_PREV bindkey yesno b PAGE_PREV # mouse_mkregion 3,6 1x5 0 (0) # mouse_mkregion 3,16 1x5 0 (1) window 5x29 at 9,24 0:+---------------------------+ 1:| Ohno | 2:+---------------------------+ 3:| < Yes > < No > | 4:+---------------------------+ chr KEY_RESIZE (ch=0x19a, fkey=410) # mouse_mkregion 3,6 1x5 0 (0) # mouse_mkregion 3,16 1x5 1 (1) chr KEY_RESIZE (ch=0x19a, fkey=410) chr KEY_RESIZE (ch=0x19a, fkey=410) # mouse_mkregion 3,6 1x5 0 (0) # mouse_mkregion 3,16 1x5 1 (1) chr KEY_RESIZE (ch=0x19a, fkey=410) chr KEY_RESIZE (ch=0x19a, fkey=410) # mouse_mkregion 3,6 1x5 0 (0) # mouse_mkregion 3,16 1x5 1 (1) chr KEY_RESIZE (ch=0x19a, fkey=410) chr KEY_RESIZE (ch=0x19a, fkey=410) # mouse_mkregion 3,6 1x5 0 (0) # mouse_mkregion 3,16 1x5 1 (1) chr KEY_RESIZE (ch=0x19a, fkey=410) chr KEY_RESIZE (ch=0x19a, fkey=410) # mouse_mkregion 3,6 1x5 0 (0) # mouse_mkregion 3,16 1x5 1 (1) chr KEY_RESIZE (ch=0x19a, fkey=410) # mouse_mkregion 3,6 1x5 0 (0) # mouse_mkregion 3,16 1x5 1 (1) chr KEY_RESIZE (ch=0x19a, fkey=410) chr KEY_RESIZE (ch=0x19a, fkey=410) # mouse_mkregion 3,6 1x5 0 (0) # mouse_mkregion 3,16 1x5 1 (1) chr KEY_RESIZE (ch=0x19a, fkey=410) chr KEY_RESIZE (ch=0x19a, fkey=410) chr DLGK_FIELD_NEXT (ch=0x210, fkey=528) chr DLGK_ENTER (ch=0x21d, fkey=541) # widget returns 1 ** closed at Fri Mar 20 15:42:34 2020
signature.asc
Description: PGP signature