WheezyE / Winelink

Installation scripts for running Winlink (RMS Express/Trimode & VARA) on non-Windows computers. Wine & Box86 make this project possible.
72 stars 19 forks source link

VARA HF TCP broken in box86 >12/09/21 #41

Closed WheezyE closed 1 year ago

WheezyE commented 2 years ago

We are currently stuck using box86 builds from before apx Dec 10, 2021 since a regression was introduced later.

Once this bug fixed, we can fix other bugs (like VARA's waterfall & 'monitor mode' both freezing https://github.com/WheezyE/Winelink/issues/32, RMS Trimode crashing https://github.com/WheezyE/Winelink/issues/38, and possibly add VarAC https://github.com/WheezyE/Winelink/issues/27)

Bisecting commits

System/Software: RPi4B (2GB), RPiOS Bullseye 32-bit (armv7l), wine-7.1, mono, RMS Express 1.7.0.0, VARA 4.6.3 (install script)

Bug: VARA cannot talk to RMS Express over TCP in newer versions of box86 (says it connects though) - freezes after pushing the "start" button in RMS

01/01/21 VARA works
12/01/21 works
12/07/21 works
12/09/21 (ed8e01ea) works
12/10/21 (ed8e01ea) works
    *12/11/21 (a1aac43a) unrelated wine error (happens in wine-devel-6.19 & wine-devel-7.1)
    *12/13/21 unrelated wine error
    *12/14/21 unrelated wine error
12/15/21 (07166e59) nope
01/01/22 nope
01/17/22 (16b8657a) nope
02/01/22 (60078852) nope
02/05/22 nope
04/01/22 (dc461d4d) nope
04/15/22 (aa3474d0) nope
04/24/22 (d45aa0da) nope
07/31/22 (fa8355ec) nope
08/26/22 (e9fcef3d) nope
08/31/22 (a25c32a6) nope
    09/04/22 (76a86e2e4565e88d482dace2f2b115b39ba72313) RMS Express only starts with Dynarec off (but then freezes)
09/15/22 (bb692f26) RMS Express only starts with Dynarec off (but then freezes) [Dynarec on + different strongmem & bigblock settings still don't run]

The breaking commits are near here

Analysis

This bug is embedded within another regression that causes wine to not run. So finding the breaking commit might involve cherry-picking and editing code.

There are MANY changes between the last commit that works for VARA TCP & the commit where VARA TCP doesn't work: link.

WheezyE commented 2 years ago

Pic of VARA connecting (KI7POL is shown in address bar of VARA, VARA also works with RMS Express) image

Pic of VARA not connecting (no KI7POL is in VARA's address bar, VARA also doesn't work with RMS Express) image

WheezyE commented 2 years ago

Bisecting commits methods (just writing them down here for future reference)

Installing pre-compiled box86's

Downloading & installing pre-compiled box86 binaries takes much less time than compiling commits. [Download/install takes about 20 seconds]

Itai's repo provides these older box86 bins too (after April 15, 2022) ``` apt-cache showpkg box86 ... Provides: 0.2.7+20220918.bb692f26-1 - 0.2.7+20220904.a25c32a6-1 - 0.2.7+20220828.e9fcef3d-1 - 0.2.7+20220826.e9fcef3d-1 - 0.2.7+20220821.e9fcef3d-1 - 0.2.7+20220814.9c300292-1 - 0.2.7+20220807.9c300292-1 - 0.2.7+20220731.fa8355ec-1 - 0.2.7+20220724.fa8355ec-1 - 0.2.7+20220717.fa8355ec-1 - 0.2.7+20220710.3c8bd9c0-1 - 0.2.7+20220703.1bc817c4-1 - 0.2.7+20220626.b629bd40-1 - 0.2.7+20220619.9a7fe334-1 - 0.2.7+20220612.734aa879-1 - 0.2.7+20220605.c1c36745-1 - 0.2.7+20220508.44ee38a8-1 - 0.2.7+20220501.8d609ed8-1 - 0.2.7+20220430.8d609ed8-1 - 0.2.7+20220424.d45aa0da-1 - 0.2.6+20220417.41749db0-1 - ... ```

Compiling box86 from a commit

If the bug is probably between pre-compiled box86 binaries, we can then start compiling box86's until we find the breaking commit. [Compiling with -j3 on RPi4B (2GB) takes about 12 minutes]

function run_buildbox86()  # Build & install Box86. (This function needs a commit hash passed to it)
{
    sudo apt-get install cmake git -y
    local commit="$1"

    echo -e "\n${GREENTXT}Building and installing Box86 . . .${NORMTXT}\n"
    mkdir downloads 2>/dev/null; cd downloads
        mkdir box86; cd box86
            rm -rf box86-builder; mkdir box86-builder && cd box86-builder/
                git clone https://github.com/ptitSeb/box86 && cd box86/
                    git checkout "$commit"
                    mkdir build; cd build
                        cmake .. -DRPI4=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo
                        make -j3 #-j4 may cause crashes in some builds of box86 due to high cpu load
                        sudo make install # copies box86 files into their directories (/usr/local/bin/box86, /usr/lib/i386-linux-gnu/, /etc/binfmt.d/)
                        sudo systemctl restart systemd-binfmt # must be run after first installation of box86 (initializes binfmt configs so any encountered i386 binaries are sent to box86)
                    cd ..
                cd ..
            cd ..
        cd ..
    cd ..
}

run_buildbox86 <commit_hash_here>
# commit hashes can be found here: https://github.com/ptitSeb/box86/commits/master
WheezyE commented 2 years ago

VARAtcpworking_07166e59_TOCONNECTIONFAIL.txt VARAtcpworking_ed8e01ea_TOCONNECTION.txt

EDIT: This section may be interesting (using compare plugin with notepad++):

Dynarec for ARM, with extension: HALF FAST_MULT EDSP NEON VFPv4 IDIVA PageSize:4096
Box86 with Dynarec v0.2.5 ed8e01ea built on Dec 10 2021 23:45:16
BOX86: Wine detected, WINEPRELOADRESERVE="000400000-000518000"
Using default BOX86_LD_LIBRARY_PATH: ./:lib/:lib32/:x86/
Using default BOX86_PATH: ./:bin/
Counted 48 Env var
Looking for /home/pi/wine/bin/wine
argv[1]="C:\VARA\Vara.exe"
argv[2]="TCPIP"
argv[3]="127.0.0.1"
argv[4]="8300"
Using native(wrapped) libpthread.so.0
...

EDIT2: The logs looks basically the same to me :(

WheezyE commented 1 year ago

Seb fixed this in box86 with https://github.com/ptitSeb/box86/commit/26a6eb192231410772bf3c4aefaa4e05fe0c6949 Thank you, Seb!