wazero: error compiling wasm func ... failed to compile: BUG: relative jump offset

Describe the bug Ran a program with the most recent tagged version of wazero, which failed with this error:

error: error compiling wasm func[.github.com_zonedb_zonedb.init]: failed to compile: BUG: relative jump offset -2097240/4(=-524310) must be within -524288 and 524287

https://github.com/tetratelabs/wazero/blob/b01ba67fdcf32997d22a0f56b723a71c1c40cd75/internal/asm/arm64/impl.go#L864

Prior to upgrading wazero, the program ran correctly.

To Reproduce I was compiling a program that imports https://github.com/zonedb/zonedb.

Expected behavior For the program to compile and run.

Environment (please complete the relevant information):

  • Go version: gotip as of 2023-06-15
  • wazero version: v1.2.1
  • Host architecture: arm64
  • Runtime mode: compiler

Additional context Using wasirun from https://github.com/stealthrocket/wasi-go

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 19 (9 by maintainers)

Commits related to this issue

Most upvoted comments

cool, thank you for confirmation!

No, thank you for writing this! Between y’all and @stealthrocket, I’ve been able to port a relatively complex network service to wasip1 in a few days.

Thanks, everyone. I appreciate all the attention you’ve given this!

Right. That’s the immediate fix, if you feel that it’s important to roll out a patch. That, or revert #1516.

I confirmed the error occurs with wazero @ f3858732 (#1516), but not in the immediate parent commit 26eae5756.

Sorry I don’t have an amd64 machine to test this on right now, just my M2 MacBook.

https://github.com/tetratelabs/wazero/pull/1516 I think this is the root cause since this only happens in v1.2.1 cc @evacchi @ncruces