Closed suominen closed 2 years ago
Is this still a problem?
The segmentation fault no longer happens since commit 1a9cf9aae4674b93f163a81ffab5457299fb10e1.
However, tcsh will still silently discard 4 additional bytes from input. This can be confusing to the user. In comparison, bash and zsh output two invalid character symbols. This seems better, as the shell won't appear "stuck" to the user.
No SIGSEGV, and the "stuck waiting for 4 more bytes" should probably be a separate issue, so closing this.
I recently switched from ISO-8859-1 (a single byte character set) to UTF-8 (a multibyte character set) and ran into a problem with tcsh dying with SIGSEGV on occasion. This happens both on Debian Linux and on NetBSD. (The tcsh shipped with macOS doesn't crash.)
I realised this happens when all of the following are true:
For example, press
C-a
followed by€
and four spaces.What happens is that screen eats the first byte of the euro sign character (\342) and the remaining two go to tcsh (\202 and \254). Those two bytes by themselves or combined with the spaces do not form a valid UTF-8 character.
Compiling tcsh with "-g" (i.e. without the "-O2" optimisation that
configure
puts in) still has this problem.