termux / termux-packages

A package build system for Termux.
https://termux.dev
Other
13.4k stars 3.09k forks source link

[Bug]: mono corrupting console when using Console.Readline() #19591

Open harieamjari opened 8 months ago

harieamjari commented 8 months ago

Problem description

After a C# program exit with calls to Console.ReadLine(), console now fails to echo characters. (The console's echoing can be restored with reset.)

One temporary remedy is to redirect to stdout to /dev/null or pipe it cat.

What steps will reproduce the bug?

~ $ cat t.cs
using System;

public class Test {
  static int Main(string[] args) {
    Console.Write("Type some characters: ");
    string s = Console.ReadLine();
    return 0;
  }
}
~ $ mcs t.cs
t.cs(8,12): warning CS0219: The variable `s' is assigned but its value is never used
Compilation succeeded - 1 warning(s)
~ $ mono t.exe
Type some characters: kdkd kdkd
~ $
No command lskw found, did you mean:
 Command ls in package coreutils
 Command lsb in package lrzsz
 Command lsd in package lsd
 Command lsix in package lsix
 Command lsof in package lsof
 Command lsrc in package rcm
 Command lsar in package unar
 Command lsfd in package util-linux
~ $
No command nn found, did you mean:
 Command nm in package binutils
 Command nm in package binutils-is-llvm
 Command ln in package coreutils
 Command gn in package gn
 Command sn in package mono
 Command ne in package ne
 Command nc in package netcat-openbsd
 Command nnn in package nnn
 Command nu in package nushell
 Command nx in package nxengine
 Command nns in package tcllib
 Command sn in package tin-summer
~ $
Erase is delete.
Interrupt is control-C (^C).
~ $ mono t.exe | cat
Type some characters: hi
~ $ echo test
test
~ $

What is the expected behavior?

Console must be restored to its original echoing state.

System information

termux-info:

Termux Variables:
TERMUX_API_VERSION=0.50.1
TERMUX_APK_RELEASE=F_DROID
TERMUX_APP_PACKAGE_MANAGER=apt
TERMUX_APP_PID=18652
TERMUX_IS_DEBUGGABLE_BUILD=0
TERMUX_MAIN_PACKAGE_FORMAT=debian
TERMUX_VERSION=0.118.0
Packages CPU architecture:
aarch64
Subscribed repositories:
# sources.list
deb https://mirrors.ustc.edu.cn/termux/apt/termux-main stable main
# x11-repo (sources.list.d/x11.list)
deb https://mirrors.ustc.edu.cn/termux/apt/termux-x11 x11 main
Updatable packages:
adwaita-icon-theme/x11 46.0 all [upgradable from: 45.0]
apt/stable 2.7.10 aarch64 [upgradable from: 2.7.2]
aria2/stable 1.37.0 aarch64 [upgradable from: 1.36.0-7]
at-spi2-core/stable 2.52.0 aarch64 [upgradable from: 2.50.1]
attr/stable 2.5.2 aarch64 [upgradable from: 2.5.1]
bash-completion/stable 2.12.0 all [upgradable from: 2.11-2]
bash/stable 5.2.26 aarch64 [upgradable from: 5.2.15-1]
binutils-bin/stable 2.42 aarch64 [upgradable from: 2.40]
binutils-gold/stable 2.42 aarch64 [upgradable from: 2.40]
binutils-libs/stable 2.42 aarch64 [upgradable from: 2.40]
binutils/stable 2.42 aarch64 [upgradable from: 2.40]
brotli/stable 1.1.0 aarch64 [upgradable from: 1.0.9-1]
c-ares/stable 1.27.0 aarch64 [upgradable from: 1.19.1]
ca-certificates-java/stable 1:2024.03.11 all [upgradable from: 1:2023.08.22]
ca-certificates/stable 1:2024.03.11 all [upgradable from: 1:2023.08.22]
clang/stable 18.1.2 aarch64 [upgradable from: 17.0.6]
cmake/stable 3.29.0 aarch64 [upgradable from: 3.26.4-2]
command-not-found/stable 2.4.0-17 aarch64 [upgradable from: 2.2.0-10]
coreutils/stable 9.4 aarch64 [upgradable from: 9.3]
curl/stable 8.7.1 aarch64 [upgradable from: 8.6.0-1]
debianutils/stable 5.17 aarch64 [upgradable from: 5.7-1]
dialog/stable 1.3-20240307-0 aarch64 [upgradable from: 1.3-20230209-0]
dos2unix/stable 7.5.2 aarch64 [upgradable from: 7.5.0]
dpkg/stable 1.22.2 aarch64 [upgradable from: 1.21.22]
ed/stable 1.20.1 aarch64 [upgradable from: 1.19]
exiftool/stable 12.80 all [upgradable from: 12.64-1]
file/stable 5.45 aarch64 [upgradable from: 5.44]
freetype/stable 2.13.2 aarch64 [upgradable from: 2.13.1]
gawk/stable 5.3.0 aarch64 [upgradable from: 5.2.2]
gdb/stable 14.2 aarch64 [upgradable from: 13.2-1]
ghostscript/stable 10.02.1 aarch64 [upgradable from: 10.02.0]
giflib/stable 5.2.2 aarch64 [upgradable from: 5.2.1-2]
git/stable 2.44.0 aarch64 [upgradable from: 2.41.0]
glib-bin/stable 2.80.0 aarch64 [upgradable from: 2.78.4]
glib-networking/stable 2.80.0 aarch64 [upgradable from: 2.78.0]
glib/stable 2.80.0 aarch64 [upgradable from: 2.78.4]
gnuplot/stable 6.0.0 aarch64 [upgradable from: 5.4.8]
gpgv/stable 2.4.4 aarch64 [upgradable from: 2.4.3]
gst-plugins-base/stable 1.24.1 aarch64 [upgradable from: 1.22.4-1]
gstreamer/stable 1.24.1 aarch64 [upgradable from: 1.22.4]
hicolor-icon-theme/x11 0.17-29 all [upgradable from: 0.17-28]
jq/stable 1.7.1 aarch64 [upgradable from: 1.6-3]
ldd/stable 0.3 aarch64 [upgradable from: 0.2]
libaom/stable 3.7.0-1 aarch64 [upgradable from: 3.6.1]
libarchive/stable 3.7.2 aarch64 [upgradable from: 3.7.1]
libblocksruntime/stable 1:5.10 aarch64 [upgradable from: 1:5.8]
libc++/stable 26b aarch64 [upgradable from: 25c]
libcairo/stable 1.18.0 aarch64 [upgradable from: 1.17.8]
libcap-ng/stable 2:0.8.4 aarch64 [upgradable from: 2:0.8.3]
libcompiler-rt/stable 18.1.2 aarch64 [upgradable from: 17.0.6]
libcurl/stable 8.7.1 aarch64 [upgradable from: 8.6.0-1]
libdav1d/stable 1.4.1 aarch64 [upgradable from: 1.2.1]
libde265/stable 1.0.15 aarch64 [upgradable from: 1.0.12]
libdrm/stable 2.4.120 aarch64 [upgradable from: 2.4.115]
libdw/stable 0.190 aarch64 [upgradable from: 0.189]
libelf/stable 0.190 aarch64 [upgradable from: 0.189]
libexpat/stable 2.6.2 aarch64 [upgradable from: 2.5.0-1]
libffi/stable 3.4.6 aarch64 [upgradable from: 3.4.4-1]
libfontenc/x11 1.1.8 aarch64 [upgradable from: 1.1.7]
libgc/stable 8.2.6 aarch64 [upgradable from: 8.2.4]
libgcrypt/stable 1.10.3 aarch64 [upgradable from: 1.10.2]
libgd/stable 1:2.3.3-4 aarch64 [upgradable from: 1:2.3.3-3]
libglvnd-dev/stable 1.7.0 all [upgradable from: 1.6.0-1]
libglvnd/stable 1.7.0 aarch64 [upgradable from: 1.6.0-1]
libgmp/stable 6.3.0 aarch64 [upgradable from: 6.2.1-2]
libgnutls/stable 3.8.3 aarch64 [upgradable from: 3.8.0-1]
libgpg-error/stable 1.48 aarch64 [upgradable from: 1.47]
libgrpc/stable 1.62.1 aarch64 [upgradable from: 1.60.0-pre1-0]
libheif/stable 1.17.6 aarch64 [upgradable from: 1.16.2-1]
libicu/stable 74.2-1 aarch64 [upgradable from: 74.1+real74.1]
libjpeg-turbo/stable 3.0.2 aarch64 [upgradable from: 3.0.0]
libjxl/stable 0.10.2 aarch64 [upgradable from: 0.8.2-1]
libksba/stable 1.6.6 aarch64 [upgradable from: 1.6.4]
libllvm/stable 18.1.2 aarch64 [upgradable from: 17.0.6]
libltdl/stable 2.4.7-1 aarch64 [upgradable from: 2.4.7]
liblzma/stable 5.6.1 aarch64 [upgradable from: 5.4.3]
libmicrohttpd/stable 1.0.1 aarch64 [upgradable from: 0.9.77]
libmpfr/stable 4.2.1 aarch64 [upgradable from: 4.2.0-p9-0]
libnfs/stable 5.0.3 aarch64 [upgradable from: 5.0.2]
libnghttp2/stable 1.60.0 aarch64 [upgradable from: 1.58.0]
libnpth/stable 1.6-2 aarch64 [upgradable from: 1.6-1]
libopenmpt/stable 0.7.6 aarch64 [upgradable from: 0.7.5]
liborc/stable 0.4.38 aarch64 [upgradable from: 0.4.34]
libpaper/stable 2.2.5 aarch64 [upgradable from: 2.1.2]
libpng/stable 1.6.43 aarch64 [upgradable from: 1.6.40]
libprotobuf-c/stable 1.5.0 aarch64 [upgradable from: 1.4.1-8]
libprotobuf/stable 2:25.1 aarch64 [upgradable from: 2:22.4-2]
librav1e/stable 0.7.1 aarch64 [upgradable from: 0.6.6]
libre2/stable 2024.03.01 aarch64 [upgradable from: 2023.07.01-1]
librsvg/stable 2.58.0 aarch64 [upgradable from: 2.56.3]
libsmartcols/stable 2.39.3-4 aarch64 [upgradable from: 2.39.1]
libsndfile/stable 1.2.2 aarch64 [upgradable from: 1.2.0]
libsoxr/stable 0.1.3-5 aarch64 [upgradable from: 0.1.3-4]
libsqlite/stable 3.45.2 aarch64 [upgradable from: 3.42.0]
libsrt/stable 1.5.3 aarch64 [upgradable from: 1.5.2]
libssh/stable 0.10.6 aarch64 [upgradable from: 0.10.5]
libtiff/stable 4.6.0 aarch64 [upgradable from: 4.5.1-1]
libtirpc/stable 1.3.4 aarch64 [upgradable from: 1.3.3]
libunbound/stable 1.19.3 aarch64 [upgradable from: 1.17.1-2]
libusb/stable 1.0.27 aarch64 [upgradable from: 1.0.26-1]
libuuid/stable 2.39.3-4 aarch64 [upgradable from: 2.39.1]
libuv/stable 1.48.0 aarch64 [upgradable from: 1.46.0]
libvpx/stable 1:1.14.0-1 aarch64 [upgradable from: 1:1.13.0]
libwayland/stable 1.22.0-1 aarch64 [upgradable from: 1.21.0-2]
libwebp/stable 1.3.2 aarch64 [upgradable from: 1.3.1-2]
libx11/stable 1.8.8 aarch64 [upgradable from: 1.8.6]
libxcb/stable 1.16.1 aarch64 [upgradable from: 1.15]
libxcursor/stable 1.2.2 aarch64 [upgradable from: 1.2.1-1]
libxdmcp/stable 1.1.5 aarch64 [upgradable from: 1.1.4]
libxext/stable 1.3.6 aarch64 [upgradable from: 1.3.5]
libxkbcommon/x11 1.7.0 aarch64 [upgradable from: 1.6.0-1]
libxkbfile/x11 1.1.3 aarch64 [upgradable from: 1.1.2]
libxml2/stable 2.12.6 aarch64 [upgradable from: 2.11.4-2]
libxrandr/stable 1.5.4 aarch64 [upgradable from: 1.5.3]
littlecms/stable 2.16 aarch64 [upgradable from: 2.15-1]
lld/stable 18.1.2 aarch64 [upgradable from: 17.0.6]
lldb/stable 18.1.2 aarch64 [upgradable from: 17.0.6]
llvm/stable 18.1.2 aarch64 [upgradable from: 17.0.6]
lsof/stable 4.99.3 aarch64 [upgradable from: 4.98.0]
mesa-dev/stable 24.0.3 all [upgradable from: 23.1.4]
mesa/stable 24.0.3 aarch64 [upgradable from: 23.1.4]
mono-libs/stable 6.12.0.199-1 all [upgradable from: 6.12.0.199]
ndk-sysroot/stable 26b-2 aarch64 [upgradable from: 25c]
netcat-openbsd/stable 1.226-1-0 aarch64 [upgradable from: 1.219-1-0]
nginx/stable 1.25.4 aarch64 [upgradable from: 1.25.3]
ngspice/stable 42 aarch64 [upgradable from: 39.3]
ocl-icd/stable 2.3.2 aarch64 [upgradable from: 2.3.1-3]
oniguruma/stable 6.9.9 aarch64 [upgradable from: 6.9.8]
openjdk-17-x/stable 17.0-29 aarch64 [upgradable from: 17.0-27]
openjdk-17/stable 17.0-29 aarch64 [upgradable from: 17.0-27]
openjpeg/stable 2.5.2 aarch64 [upgradable from: 2.5.0-1]
pcre2/stable 10.43 aarch64 [upgradable from: 10.42]
perl/stable 5.38.2-2 aarch64 [upgradable from: 5.38.0]
poppler/stable 23.10.0-1 aarch64 [upgradable from: 23.07.0]
procps/stable 3.3.17-5 aarch64 [upgradable from: 3.3.17-2]
protobuf-dev/stable 2:25.1 aarch64 [upgradable from: 2:22.4-2]
protobuf/stable 2:25.1 aarch64 [upgradable from: 2:22.4-2]
psmisc/stable 23.6-2 aarch64 [upgradable from: 23.6-1]
pulseaudio/stable 17.0-1 aarch64 [upgradable from: 16.1-4]
python-ensurepip-wheels/stable 3.11.8 all [upgradable from: 3.11.4-2]
python-numpy/stable 1.26.4-1 aarch64 [upgradable from: 1.26.4]
python-pip/stable 24.0-1 all [upgradable from: 23.2.1]
python/stable 3.11.8 aarch64 [upgradable from: 3.11.4-2]
qemu-common/stable 1:8.0.2-1 aarch64 [upgradable from: 1:8.0.2]
qemu-system-x86-64-headless/stable 1:8.0.2-1 aarch64 [upgradable from: 1:8.0.2]
qemu-user-x86-64/stable 1:8.0.2-1 aarch64 [upgradable from: 1:8.0.2]
strace/stable 6.8 aarch64 [upgradable from: 6.4]
termux-am/stable 0.8.0 all [upgradable from: 0.4]
termux-api/stable 0.58.0-1 aarch64 [upgradable from: 0.57]
termux-tools/stable 1.41.2 all [upgradable from: 1.38.3]
traceroute/stable 2.1.5 aarch64 [upgradable from: 2.1.3]
unbound/stable 1.19.3 aarch64 [upgradable from: 1.17.1-2]
util-linux/stable 2.39.3-4 aarch64 [upgradable from: 2.39.1]
vim-runtime/stable 9.1.0100 all [upgradable from: 9.0.1650]
vim/stable 9.1.0100 aarch64 [upgradable from: 9.0.1650]
whois/stable 5.5.21 aarch64 [upgradable from: 5.5.20]
xkeyboard-config/x11 2.41 all [upgradable from: 2.39]
xorg-xkbcomp/x11 1.4.7 aarch64 [upgradable from: 1.4.6]
xz-utils/stable 5.6.1 aarch64 [upgradable from: 5.4.3]
zbar/stable 0.23.93 aarch64 [upgradable from: 0.23.92-1]
zsh-completions/stable 0.35.0 all [upgradable from: 0.34.0]
zsh/stable 5.9-3 aarch64 [upgradable from: 5.9-2]
zstd/stable 1.5.6 aarch64 [upgradable from: 1.5.5-1]
zziplib/stable 0.13.74 aarch64 [upgradable from: 0.13.72-1]
termux-tools version:
1.38.3
Android version:
9
Kernel build information:
Linux localhost 4.4.111-21427293 #1 SMP PREEMPT Mon Jul 25 18:15:22 KST 2022 aarch64 Android
Device manufacturer:
samsung
Device model:
SM-G955F
LD Variables:
LD_LIBRARY_PATH=:/data/data/com.termux/files/usr/lib/clang/17/lib/linux
LD_PRELOAD=/data/data/com.termux/files/usr/lib/libtermux-exec.so
Installed termux plugins:
com.termux.api versionCode:51
harieamjari commented 8 months ago

https://github.com/mono/mono/issues/21758