[LLD] [WASM] wasm/function-index.test failing

I'm seeing the following fail on Linux x86-64, for the last couple weeks
at least. This is from 'ninja check-all'.

                                 -David

FAIL: lld :: wasm/function-index.test (1941 of 1955)
******************** TEST 'lld :: wasm/function-index.test' FAILED ********************
Script:

Hello David,

I use x86_64 and it works on my machine. I also can’t find this error on LLVM buildbot page. I’d appreciate if you help me reproduce the problem. I tested with debug/release/expensive-check builds and they all passed. Does anyone else have this problem?

Regards,
Heejin

I cannot reproduce this error, but this could be real.

David, is this reproducible every time or is this flaky?

Rui Ueyama <ruiu@google.com> writes:

I cannot reproduce this error, but this could be real.

David, is this reproducible every time or is this flaky?

It's every time for me, both on X86-64 and AArch64. I'll try running in
a debugger to see what is going on. What else can I do to help track
this down?

                              -David

Maybe first I would try building again with a fresh build directory to see if it still persists.

Are you using static linking, -DBUILD_SHARED_LIBS, or -DLLVM_LINK_LLVM_DYLIB?

David Greene via llvm-dev <llvm-dev@lists.llvm.org> writes:

Rui Ueyama <ruiu@google.com> writes:

I cannot reproduce this error, but this could be real.

David, is this reproducible every time or is this flaky?

It's every time for me, both on X86-64 and AArch64. I'll try running in
a debugger to see what is going on. What else can I do to help track
this down?

Ok, I discovered something interesting. I see the failure when
configuring like this:

  cmake -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=ON \
        -DLLVM_ABI_BREAKING_CHECKS=WITH_ASSERTS ...

I do *not* see the failure when configuring like this:

  cmake -DCMAKE_BUILD_TYPE=Debug -DLLVM_ENABLE_ASSERTIONS=ON \
        -DLLVM_ABI_BREAKING_CHECKS=WITH_ASSERTS ...

I set LLVM_ABI_BREAKING_CHECKS=FORCE_OFF for the Release build in
CMakeCache.txt and it still failed.

I then additionally set LLVM_ENABLE_ASSERTIONS=OFF for the Release build
in CMakeCache.txt and it still failed.

I then attempted to run the command in a debugger. It passed. It also
passed on the command-line. So it appears something about the
environment lit sets up causes problems, but only for Release builds.

I tried adding a batch gdb command to the test but it passed. The test
doesn't run long enough to allow attaching an external gdb.

So short of hacking on wasm-ld, I'm at a bit of a roadblock. Ideas
welcome. :slight_smile:

                           -David

Derek Schuff via llvm-dev <llvm-dev@lists.llvm.org> writes:

Are you using static linking, -DBUILD_SHARED_LIBS, or -
DLLVM_LINK_LLVM_DYLIB?

I use neither -DBUILD_SHARED_LIBS nor -DLLVM_LINK_LLVM_DYLIB.

I do have -DLLVM_ENABLE_CXX1Y=ON, -DLLVM_ENABLE_THREADS=OFF,
-DCLANG_DEFAULT_LINKER=gold. I also have -DLLVM_ENABLE_EH=ON
-DLLVM_ENABLE_RTTI=ON which are obviously very atypical.

                          -David

I don’t know the cause of this yet, but I filed https://bugs.llvm.org/show_bug.cgi?id=40278 to keep track of this. I tried to CC your email address (dag@cray.com) but apparently you were not registered in bugzilla so I couldn’t. You can sign up there and add yourself to the CC list too.

Heejin Ahn <aheejin@gmail.com> writes:

I don't know the cause of this yet, but I filed
https://bugs.llvm.org/show_bug.cgi?id=40278 to keep track of this. I
tried to CC your email address (dag@cray.com) but apparently you were
not registered in bugzilla so I couldn't. You can sign up there and
add yourself to the CC list too.

Thanks! I'm "greened" on bugzilla. I added myself to the bug.

                          -David