packages icon indicating copy to clipboard operation
packages copied to clipboard

fish: Fish Shell don't work correctly in OpenWRT 22.03.0 with mipsel_24kc architecture.

Open dainslef opened this issue 2 years ago • 7 comments

Maintainer: @jqqqqqqqqqq @hendrydong Description:

fish shell always crash after upgrading to OpenWRT 22.03.0 (In OpenWRT 21.02, fish shell can work correctly).

$ fish
Assertion failed: (status_.load() & STATUS_NEEDS_WAKEUP) == 0 && "No thread should be waiting" (fish-3.3.1/src/topic_monitor.cpp: try_update_gens_maybe_becoming_reader: 208)
Aborted

This issue seems that happens in all mipsel_24kc architecture devices, I have Redmi Router AC2100(MT7621A), GL.iNet MT1300(MT7621A), Xiaomi Router 4C(MT7628AN) ... All of these devices had this issue.

fish package info:

Package: fish
Version: 3.3.1-2
Depends: libc, libncurses6, libstdcpp6, libatomic1, librt, libpcre2-32
Status: install user installed
Section: utils
Architecture: mipsel_24kc
Size: 2050273
Filename: fish_3.3.1-2_mipsel_24kc.ipk
Description: Fish is a smart and user-friendly command line shell for OS X, Linux, and the
 rest of the family. Fish includes features like syntax highlighting,
 autosuggest-as-you-type, and fancy tab completions that just work, with no
 configuration required.
Installed-Time: 1663171114

Environment (Redmi Router AC2100):

NAME="OpenWrt"
VERSION="22.03.0"
ID="openwrt"
ID_LIKE="lede openwrt"
PRETTY_NAME="OpenWrt 22.03.0"
VERSION_ID="22.03.0"
HOME_URL="https://openwrt.org/"
BUG_URL="https://bugs.openwrt.org/"
SUPPORT_URL="https://forum.openwrt.org/"
BUILD_ID="r19685-512e76967f"
OPENWRT_BOARD="ramips/mt7621"
OPENWRT_ARCH="mipsel_24kc"
OPENWRT_TAINTS=""
OPENWRT_DEVICE_MANUFACTURER="OpenWrt"
OPENWRT_DEVICE_MANUFACTURER_URL="https://openwrt.org/"
OPENWRT_DEVICE_PRODUCT="Generic"
OPENWRT_DEVICE_REVISION="v0"
OPENWRT_RELEASE="OpenWrt 22.03.0 r19685-512e76967f"

dainslef avatar Sep 16 '22 14:09 dainslef

I see in master branch, fish version is 3.5.0 Can you try to compile it from master or get it from snapshot repo and try again?

jqqqqqqqqqq avatar Sep 16 '22 18:09 jqqqqqqqqqq

Otherwise try to build 3.5.1 and see if it works. If not, it is probably an upstream bug https://github.com/openwrt/packages/pull/19388/commits/dea8906ef45cde72bd42d7318f106679978b3874

jqqqqqqqqqq avatar Sep 16 '22 18:09 jqqqqqqqqqq

I see in master branch, fish version is 3.5.0 Can you try to compile it from master or get it from snapshot repo and try again?

I build the fish 3.5.0 ipk from snapshot, after upgrade fish shell to 3.5.0-1, this issue still exists, package info:

root@OpenWrt:~# fish --version
fish, version 3.5.0

root@OpenWrt:~# opkg info fish
Package: fish
Version: 3.3.1-2
Depends: libc, libncurses6, libstdcpp6, libatomic1, librt, libpcre2-32
Status: unknown ok not-installed
Section: utils
Architecture: mipsel_24kc
Size: 2050273
Filename: fish_3.3.1-2_mipsel_24kc.ipk
Description: Fish is a smart and user-friendly command line shell for OS X, Linux, and the
 rest of the family. Fish includes features like syntax highlighting,
 autosuggest-as-you-type, and fancy tab completions that just work, with no
 configuration required.

Package: fish
Version: 3.5.0-1
Depends: libc, libncurses6, libstdcpp6, libatomic1, libpcre2-32
Status: install user installed
Architecture: mipsel_24kc
Installed-Time: 1663396062

dainslef avatar Sep 17 '22 06:09 dainslef

Otherwise try to build 3.5.1 and see if it works. If not, it is probably an upstream bug dea8906

I upgrade to fish 3.5.1, the issue still exists, package info:

root@OpenWrt:~# opkg info fish
Package: fish
Version: 3.3.1-2
Depends: libc, libncurses6, libstdcpp6, libatomic1, librt, libpcre2-32
Status: unknown ok not-installed
Section: utils
Architecture: mipsel_24kc
Size: 2050273
Filename: fish_3.3.1-2_mipsel_24kc.ipk
Description: Fish is a smart and user-friendly command line shell for OS X, Linux, and the
 rest of the family. Fish includes features like syntax highlighting,
 autosuggest-as-you-type, and fancy tab completions that just work, with no
 configuration required.

Package: fish
Version: 3.5.1-1
Depends: libc, libncurses6, libstdcpp6, libatomic1, libpcre2-32
Status: install user installed
Architecture: mipsel_24kc
Installed-Time: 1663398786

root@OpenWrt:~# fish --version
fish, version 3.5.1

root@OpenWrt:~# fish
Welcome to fish, the friendly interactive shell
Type help for instructions on how to use fish
root@OpenWrt ~# 
root@OpenWrt ~# 
root@OpenWrt ~# ls
Assertion failed: (status_.load() & STATUS_NEEDS_WAKEUP) == 0 && "No thread should be waiting" (fish-3.5.1/src/topic_monitor.cpp: try_update_gens_maybe_becoming_reader: 208)
Aborted

dainslef avatar Sep 17 '22 10:09 dainslef

I just found someone had already submited a similar issue in https://github.com/fish-shell/fish-shell/issues/8653

dainslef avatar Sep 17 '22 11:09 dainslef

tested on QEMU mips and mipsel. Only an issue on mipsel. Couldn't test 64-bit as it doesn't even boot.

neheb avatar Sep 17 '22 19:09 neheb

thanks for reproducing! hopefully with qemu, fish people can get a handle on it more easily.

for other users, as a workaround i have been using the 3.1.2 ipk file for 21.02.3 for a few days now.

hdhoang avatar Sep 18 '22 12:09 hdhoang

thanks for reproducing! hopefully with qemu, fish people can get a handle on it more easily.

for other users, as a workaround i have been using the 3.1.2 ipk file for 21.02.3 for a few days now.

Can confirm this working on 22.03.03

1412031 avatar Apr 04 '23 09:04 1412031

Let's close this, and move on with the new fish.

There is some hiccups because this platform doesn't have AtomicU64 support. Replacing that with AtomicU32 at a guess, and converting callsites, I could build a binary that runs. Its commandline reader doesn't work, but argument-parsing does.

> run/fish --version
fish, version 3.1.2
> run/rfish --version
fish, version a29cc8f-dirty
> run/rfish --command 'date'
Sun Mar 31 16:28:23 +07 2024

We can hope for better support for mipsel (it's worse than usual 32-bit) ~along with other 32-bit platforms~.

hdhoang avatar Mar 31 '24 09:03 hdhoang