deislabs / mystikos

Tools and runtime for launching unmodified container images in Trusted Execution Environments
142 stars 49 forks source link

Failing libcxx tests (alpine & ubuntu) #238

Open salsal97 opened 3 years ago

salsal97 commented 3 years ago

These errors are observed from built libcxx tests that fail on ALPINE Source code for this suite is here -

eg: looking for test built as /app/llvm-project/libcxx/test/libcxx/containers/sequences/deque/pop_back_empty.pass.cpp.exe

git clone -b LibOS_v10.0.1 --single-branch https://github.com/salsal97/llvm-project.git
cd llvm-project/libcxx/test/libcxx/containers/sequences/deque

Revisions -

1.1: This issue was updated to remove the tests that failed to run outside of mystikos.
1.2: Issue updated to add tests that fail when compiled in ubuntu and run in mystikos
1.3 Removed tests that failed outside of mystikos on _alpine_
1.4 updated issue with full pathname for the tests
1.5 Updated some of the failing tests that now pass

eg:

  1. /app/llvm-project/libcxx/test/std/numerics/complex.number/complex.transcendentals/acos.pass.cpp.exe
  2. /app/llvm-project/libcxx/test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/allocate.pass.cpp.exe
  3. /app/llvm-project/libcxx/test/std/numerics/complex.number/complex.transcendentals/asinh.pass.cpp.exe

Built binaries are in this container - docker pull mystikos/libcxx_11x:0.1 You can build the binaries again in a new container by following the steps in the Dockerfile in this suite.

/app/llvm-project/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.copy/copy.pass.cpp.exe: Uses a named pipe

Failing libcxx tests on UBUNTU:

Built binaries are in this container - docker pull mystikos/libcxx2_11x:0.1 You can build the binaries again in a new container by following the steps in the Dockerfile in this suite.

# runs in gdb 
/app/llvm-project/libcxx/test/libcxx/containers/sequences/deque/pop_back_empty.pass.cpp.exe
/app/llvm-project/libcxx/test/libcxx/containers/sequences/vector/pop_back_empty.pass.cpp.exe

# timeout 30
/app/llvm-project/libcxx/test/libcxx/containers/sequences/list/list.ops/db_splice_pos_list_iter_iter.pass.cpp.exe
/app/llvm-project/libcxx/test/std/containers/sequences/deque/deque.modifiers/insert_iter_iter.pass.cpp.exe

# Fails to handle wide characters, file with wchars are not traversed as expected
/app/llvm-project/libcxx/test/std/input.output/file.streams/fstreams/filebuf.assign/member_swap.pass.cpp.exe
/app/llvm-project/libcxx/test/std/input.output/file.streams/fstreams/filebuf.assign/move_assign.pass.cpp.exe
/app/llvm-project/libcxx/test/std/input.output/file.streams/fstreams/filebuf.assign/nonmember_swap.pass.cpp.exe
/app/llvm-project/libcxx/test/std/input.output/file.streams/fstreams/filebuf.cons/move.pass.cpp.exe
/app/llvm-project/libcxx/test/std/input.output/file.streams/fstreams/fstream.assign/member_swap.pass.cpp.exe
/app/llvm-project/libcxx/test/std/input.output/file.streams/fstreams/fstream.assign/move_assign.pass.cpp.exe
/app/llvm-project/libcxx/test/std/input.output/file.streams/fstreams/fstream.assign/nonmember_swap.pass.cpp.exe
/app/llvm-project/libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/move.pass.cpp.exe
/app/llvm-project/libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/pointer.pass.cpp.exe
/app/llvm-project/libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/string.pass.cpp.exe
/app/llvm-project/libcxx/test/std/input.output/file.streams/fstreams/fstream.members/open_pointer.pass.cpp.exe
/app/llvm-project/libcxx/test/std/input.output/file.streams/fstreams/fstream.members/open_string.pass.cpp.exe
/app/llvm-project/libcxx/test/std/input.output/file.streams/fstreams/ofstream.assign/member_swap.pass.cpp.exe
/app/llvm-project/libcxx/test/std/input.output/file.streams/fstreams/ofstream.assign/move_assign.pass.cpp.exe
/app/llvm-project/libcxx/test/std/input.output/file.streams/fstreams/ofstream.assign/nonmember_swap.pass.cpp.exe
/app/llvm-project/libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/move.pass.cpp.exe
/app/llvm-project/libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/pointer.pass.cpp.exe
/app/llvm-project/libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/string.pass.cpp.exe
/app/llvm-project/libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/open_pointer.pass.cpp.exe
/app/llvm-project/libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/open_string.pass.cpp.exe

# small isolated failures (not a big group)
/app/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_encoding.pass.cpp.exe
/app/llvm-project/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_max_length.pass.cpp.exe

# complex number operations fail
/app/llvm-project/libcxx/test/std/numerics/complex.number/complex.transcendentals/acos.pass.cpp.exe
/app/llvm-project/libcxx/test/std/numerics/complex.number/complex.transcendentals/asinh.pass.cpp.exe
/app/llvm-project/libcxx/test/std/numerics/complex.number/complex.transcendentals/atanh.pass.cpp.exe
/app/llvm-project/libcxx/test/std/numerics/complex.number/complex.value.ops/proj.pass.cpp.exe

# occasional futex retry and threading issues
/app/llvm-project/libcxx/test/std/thread/futures/futures.async/async_race.pass.cpp.exe
/app/llvm-project/libcxx/test/std/thread/futures/futures.promise/set_rvalue.pass.cpp.exe
/app/llvm-project/libcxx/test/std/thread/futures/futures.promise/set_value_const.pass.cpp.exe
/app/llvm-project/libcxx/test/std/thread/thread.mutex/thread.lock.algorithm/lock.pass.cpp.exe
/app/llvm-project/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_until_deadlock_bug.pass.cpp.exe
/app/llvm-project/libcxx/test/std/thread/thread.mutex/thread.once/thread.once.callonce/call_once.pass.cpp.exe
bodzhang commented 3 years ago

@salsal97 , can you trace down the "Can't find file" failures?

salsal97 commented 3 years ago

Hi Bo, updated the issue with the latest failure logs. Tests that fail with no error message are either timing out (3 seconds) or have a segfault

paulcallen commented 3 years ago

the locale issues are probably looking for a localization file that is not present. This may need to be part of the test image. It may also be an environment variable that is not set to point to the file location. The environment variable inherited from the host may also not be correct for the alpine image that the test is using.

jxyang commented 3 years ago

line 1 and line 3 (and a few others) are with complex number calculations. There maybe bugs in MUSL's libm implementation.

Would be interesting to see if they passes when compiled with gcc instead of musl-gcc.

salsal97 commented 3 years ago

Update: /app/acos.pass.cpp.exe does not work in MUSL-GCC

jxyang commented 3 years ago

For failures like: terminate called after throwing an instance of ...

The tests throw an exception on purpose and then ignore it in a catch block. This way they tests the functionality during stack unwinding.

Unfortunately Mystikos takes the exception too literally. It decides to crash on any exception before it gives the C++ runtime a chance to handle it.