Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WASM hangs when text macro has instruction #1347

Open
OPNA2608 opened this issue Nov 13, 2024 · 3 comments
Open

WASM hangs when text macro has instruction #1347

OPNA2608 opened this issue Nov 13, 2024 · 3 comments
Labels
bug WASM Assembler

Comments

@OPNA2608
Copy link
Contributor

OPNA2608 commented Nov 13, 2024

Building VirtualBox's BIOS files with Open Watcom V2 instead of Open Watcom 1.9 makes the wasm processes hang indefinitely.

An example assembly code, adjusted from VirtualBox's vberom.asm down to just the problematic setup:

; In the original code, this is defined differently according to an ifdef. Using the easier branch's code here
out_dx_ax     EQU     out     dx, ax

VGAROM segment public 'CODE'

; Original label where assembling gets stuck, code reduced to just the problematic line
dispi_get_bpp:
       out_dx_ax

VGAROM ends

       end

With OW 1.9, this assembles fine:

↪ /nix/store/fkzqbai9ns3fd3a87ng0isnk4m5gwpn3-open-watcom-bin-1.9/bin/wasm -fo=/dev/shm/reproduces.obj /dev/shm/reproduces.asm
Open Watcom Assembler Version 1.9
Portions Copyright (c) 1992-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.
See http://www.openwatcom.org/ for details.
/dev/shm/reproduces.asm: 11 lines, 0 warnings, 0 errors

With OW V2, this hangs at 100% thread usage (both from binl and binl64):

↪ /nix/store/g29dxcz52a3yrqc183ilm4wic8sbnd1p-open-watcom-v2-0-unstable-2024-10-13/bin/wasm -fo=/dev/shm/reproduces.obj /dev/shm/reproduc
es.asm
Open Watcom x86 Assembler Version 2.0 beta Jan 01 1980 00:00:00 (64-bit)
Copyright (c) 2002-1980 The Open Watcom Contributors. All Rights Reserved.
Portions Copyright (c) 1992-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.
See https://github.com/open-watcom/open-watcom-v2#readme for details.
^C⏎ 

I don't know when exactly this started happening, but it happens on 8e26693, f0a6465 and d3733a7.

@jmalak
Copy link
Member

jmalak commented Nov 14, 2024

Please do you have some build environment for VirtualBox somewhere?

@OPNA2608
Copy link
Contributor Author

With Nix:

cd somewhere
git clone https://github.com/NixOS/nixpkgs
env NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link -E 'with import ./nixpkgs { }; virtualbox.override { open-watcom-bin = open-watcom-v2; }'

To build a different OW v2 from i.e. a clone with local changes, change this to:

src = /path/to/clone/of/open-watcom-v2;

You can leave version as-is, or change it to something like version = "local"; to signal in the output path that it's different from the regular one. When building this virtualbox, it gets to:

kBuild: Linking VBoxSVC
kBuild: Installing VBoxSVC => /build/VirtualBox-7.0.18/out/linux.amd64/release/bin/VBoxSVC

…and then progress halts, because it's waiting for the outputs of these wasm processes.

image

@jmalak jmalak added bug WASM Assembler labels Nov 14, 2024
@jmalak
Copy link
Member

jmalak commented Nov 14, 2024

It looks like a bug in wasm expression evaluator which is completely reworked in OW 2.0.
It's a little bit strange construct that is more likely to be handled by a multi-line macro or conditional code.
But it is bug and need to be fixed.
Thanks for your bug report and all your info.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug WASM Assembler
Projects
None yet
Development

No branches or pull requests

2 participants