Bug 7700 - Installer can crash if resizing terminal
Summary: Installer can crash if resizing terminal
Status: NEW
Alias: None
Product: ThinLinc
Classification: Unclassified
Component: Server Installer (show other bugs)
Version: trunk
Hardware: PC Unknown
: P2 Normal
Target Milestone: LowPrio
Assignee: Bugzilla mail exporter
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-05-04 14:50 CEST by Pierre Ossman
Modified: 2021-08-24 12:54 CEST (History)
0 users

See Also:
Acceptance Criteria:


Attachments

Description Pierre Ossman cendio 2021-05-04 14:50:40 CEST
With a bit of bad luck tl-setup (and likely the installer) can crash if you resize the terminal where you run it. The problem is that this sends a SIGWINCH which in turn can abort system calls with EINTR. This can happen anywhere in the code where a system call is used, but in my case I got:

> 2021-05-04 14:38:36,687: Traceback (most recent call last):
> 2021-05-04 14:38:36,688:   File "/opt/thinlinc/sbin/../libexec/tl-setup.py", line 315, in <module>
> 2021-05-04 14:38:36,688:     Oo0O0OOOoo ( )
> 2021-05-04 14:38:36,688:   File "/opt/thinlinc/sbin/../libexec/tl-setup.py", line 268, in Oo0O0OOOoo
> 2021-05-04 14:38:36,688:     o00oooO0Oo = o0O00o . run ( )
> 2021-05-04 14:38:36,688:   File "/opt/thinlinc/modules/thinlinc/wizard.py", line 100, in run
> 2021-05-04 14:38:36,688:     return self . _run_text ( )
> 2021-05-04 14:38:36,688:   File "/opt/thinlinc/modules/thinlinc/wizard.py", line 118, in _run_text
> 2021-05-04 14:38:36,688:     oOOO00o ( )
> 2021-05-04 14:38:36,688:   File "/opt/thinlinc/modules/thinlinc/tlsetup/gtk.py", line 81, in <lambda>
> 2021-05-04 14:38:36,688:     IiIiI11iIi )
> 2021-05-04 14:38:36,688:   File "/opt/thinlinc/modules/thinlinc/tlsetup/pkginsthelp.py", line 75, in generic_text_installer
> 2021-05-04 14:38:36,689:     i1Ii = iiIIi1IiIi11 . run ( )
> 2021-05-04 14:38:36,689:   File "/opt/thinlinc/modules/thinlinc/tlsetup/pkginsthelp.py", line 482, in run
> 2021-05-04 14:38:36,689:     o0oOO000oO0oo = self . __backend . install ( )
> 2021-05-04 14:38:36,689:   File "/opt/thinlinc/modules/thinlinc/packageinstaller/dnfbackend.py", line 67, in install
> 2021-05-04 14:38:36,689:     callback = self . _dnf_callback )
> 2021-05-04 14:38:36,689:   File "/opt/thinlinc/modules/thinlinc/packageinstaller/dnfbackend.py", line 121, in iIiiiI
> 2021-05-04 14:38:36,689:     ( I11II1i , IIIII , ooooooO0oo ) = select . select ( [ oOOO00o . stdout , oOOO00o . stderr ] , [ ] , [ ] )
> 2021-05-04 14:38:36,689: error: (4, 'Interrupted system call')

Fixing this is a pain unfortunately as it means doing this annoying construct around all system calls:

> while True:
>   try:
>     call()
>   except OSError as e:
>     if e.errno == errno.EINTR:
>       continue
>     else:
>       raise

Fortunately upstream Python has apparently realized what an unmaintainable mess this is:

https://www.python.org/dev/peps/pep-0475/

TL;DR; It's fixed in Python 3.5


If we want to fix this for earlier versions we'll need to start adding wrappers. A middle ground could be to only add wrappers for long running system calls such as select().

Note You need to log in before you can comment on or make changes to this bug.