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

Release build with clang++12 failed some tests #3323

Closed
sjwsl opened this issue Oct 29, 2021 · 2 comments · Fixed by #6763
Closed

Release build with clang++12 failed some tests #3323

sjwsl opened this issue Oct 29, 2021 · 2 comments · Fixed by #6763
Labels
potential bug Something that looks like a bug but not yet confirmed

Comments

@sjwsl
Copy link
Contributor

sjwsl commented Oct 29, 2021

Describe the bug
Some tests failed after building taichi in release mode with clang++12.

To Reproduce
Set CMAKE_CXX_COMPILER to clang++12

$ git clone https://taichi-dev/taichi
$ cd taichi
$ git submodule update --init --recursive
$ python3 setup.py develop --user
$ ti test -vfr2 -t2 -k "not ndarray and not torch" 
========================================= FAILURES =========================================
__________________________ python/taichi/tests/test_bitmasked.py ___________________________
[gw3] linux -- Python 3.8.10 /usr/bin/python3
worker 'gw3' crashed while running 'python/taichi/tests/test_bitmasked.py::test_basic'
__________________________ python/taichi/tests/test_bitmasked.py ___________________________
[gw6] linux -- Python 3.8.10 /usr/bin/python3
worker 'gw6' crashed while running 'python/taichi/tests/test_bitmasked.py::test_basic_packed'
________________________ python/taichi/tests/test_sparse_basics.py _________________________
[gw9] linux -- Python 3.8.10 /usr/bin/python3
worker 'gw9' crashed while running 'python/taichi/tests/test_sparse_basics.py::test_pointer_is_active'
===================================== warnings summary =====================================
../../.local/lib/python3.8/site-packages/autograd/numpy/numpy_wrapper.py:20: 40 warnings
  /home/taichigraphics/.local/lib/python3.8/site-packages/autograd/numpy/numpy_wrapper.py:20: DeprecationWarning: `np.int` is a deprecated alias for the builtin `int`. To silence this warning, use `int` by itself. Doing this will not modify any behavior and is safe. When replacing `np.int`, you may wish to use e.g. `np.int64` or `np.int32` to specify the precision. If you wish to review your current use, check the release note link for additional information.
  Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
    int_types = {_np.int, _np.int8, _np.int16, _np.int32, _np.int64, _np.integer}

-- Docs: https://docs.pytest.org/en/stable/warnings.html
======================== xdist: maximum crashed workers reached: 8 =========================
================================= short test summary info ==================================
FAILED python/taichi/tests/test_bitmasked.py::test_basic
FAILED python/taichi/tests/test_bitmasked.py::test_basic_packed
FAILED python/taichi/tests/test_sparse_basics.py::test_pointer_is_active
============= 3 failed, 818 passed, 40 warnings, 6 rerun in 1322.51s (0:22:02) =============
>>> Running time: 1322.65s

Also here is a minimal program to reproduce one of the failures which is subtracted from the tests

import taichi as ti

ti.init(arch=ti.cuda)

x = ti.field(ti.i32)
c = ti.field(ti.i32)

bm = ti.root.bitmasked(ti.ij, (3, 6)).bitmasked(ti.i, 5)
bm.place(x)
ti.root.place(c)

@ti.kernel
def sum():
    for i, j in x:
        c[None] += ti.is_active(bm, [i, j])

sum()
[Taichi] version 0.8.4, llvm 10.0.1, commit 3022cf53, linux, python 3.8.10
[Taichi] Starting on arch=cuda
[E 10/29/21 23:57:58.734 816473] Received signal 11 (Segmentation fault)


***********************************
* Taichi Compiler Stack Traceback *
***********************************
/home/taichigraphics/Documents/taichi/python/taichi/lib/taichi_core.so: taichi::Logger::error(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)
/home/taichigraphics/Documents/taichi/python/taichi/lib/taichi_core.so(+0x6151de) [0x7fd0358511de]
/lib/x86_64-linux-gnu/libc.so.6(+0x46210) [0x7fd039ce3210]
/lib/x86_64-linux-gnu/libstdc++.so.6: __dynamic_cast
/home/taichigraphics/Documents/taichi/python/taichi/lib/taichi_core.so(+0x672849) [0x7fd0358ae849]
/home/taichigraphics/Documents/taichi/python/taichi/lib/taichi_core.so: taichi::lang::StmtSearcher::visit(taichi::lang::Stmt*)
/home/taichigraphics/Documents/taichi/python/taichi/lib/taichi_core.so: taichi::lang::BasicStmtVisitor::visit(taichi::lang::Block*)
/home/taichigraphics/Documents/taichi/python/taichi/lib/taichi_core.so: taichi::lang::OffloadedStmt::all_blocks_accept(taichi::lang::IRVisitor*)
/home/taichigraphics/Documents/taichi/python/taichi/lib/taichi_core.so: taichi::lang::StmtSearcher::run(taichi::lang::IRNode*, std::function<bool (taichi::lang::Stmt*)> const&)
/home/taichigraphics/Documents/taichi/python/taichi/lib/taichi_core.so: taichi::lang::irpass::analysis::gather_statements(taichi::lang::IRNode*, std::function<bool (taichi::lang::Stmt*)> const&)
/home/taichigraphics/Documents/taichi/python/taichi/lib/taichi_core.so(+0x670e55) [0x7fd0358ace55]
/home/taichigraphics/Documents/taichi/python/taichi/lib/taichi_core.so: taichi::lang::irpass::make_thread_local(taichi::lang::IRNode*, taichi::lang::CompileConfig const&)
/home/taichigraphics/Documents/taichi/python/taichi/lib/taichi_core.so: taichi::lang::irpass::offload_to_executable(taichi::lang::IRNode*, taichi::lang::CompileConfig const&, taichi::lang::Kernel*, bool, bool, bool, bool, bool)
/home/taichigraphics/Documents/taichi/python/taichi/lib/taichi_core.so: taichi::lang::irpass::compile_to_executable(taichi::lang::IRNode*, taichi::lang::CompileConfig const&, taichi::lang::Kernel*, bool, bool, bool, bool, bool, bool, bool, bool)
/home/taichigraphics/Documents/taichi/python/taichi/lib/taichi_core.so: taichi::lang::Kernel::lower(bool)
/home/taichigraphics/Documents/taichi/python/taichi/lib/taichi_core.so: taichi::lang::LlvmProgramImpl::compile(taichi::lang::Kernel*, taichi::lang::OffloadedStmt*)
/home/taichigraphics/Documents/taichi/python/taichi/lib/taichi_core.so: taichi::lang::Program::compile(taichi::lang::Kernel&, taichi::lang::OffloadedStmt*)
/home/taichigraphics/Documents/taichi/python/taichi/lib/taichi_core.so: taichi::lang::Kernel::compile()
/home/taichigraphics/Documents/taichi/python/taichi/lib/taichi_core.so: taichi::lang::Kernel::operator()(taichi::lang::Kernel::LaunchContextBuilder&)
/home/taichigraphics/Documents/taichi/python/taichi/lib/taichi_core.so(+0x36eeea) [0x7fd0355aaeea]
/home/taichigraphics/Documents/taichi/python/taichi/lib/taichi_core.so(+0x355b47) [0x7fd035591b47]
python3(PyCFunction_Call+0x59) [0x5f5db9]
python3(_PyObject_MakeTpCall+0x29e) [0x5f698e]
python3() [0x50b485]
python3(PyObject_Call+0x1f7) [0x5f56c7]
python3() [0x59cb20]
python3(_PyObject_MakeTpCall+0x29e) [0x5f698e]
python3(_PyEval_EvalFrameDefault+0x59bc) [0x57107c]
python3(_PyEval_EvalCodeWithName+0x26a) [0x56a0ba]
python3(_PyFunction_Vectorcall+0x393) [0x5f6343]
python3(PyObject_Call+0x1f7) [0x5f56c7]
python3(_PyEval_EvalFrameDefault+0x1f36) [0x56d5f6]
python3(_PyEval_EvalCodeWithName+0x26a) [0x56a0ba]
python3(_PyFunction_Vectorcall+0x393) [0x5f6343]
python3(_PyObject_FastCallDict+0x327) [0x5f70f7]
python3(_PyObject_Call_Prepend+0x61) [0x5f50c1]
python3() [0x59cafb]
python3(PyObject_Call+0x27e) [0x5f574e]
python3(_PyEval_EvalFrameDefault+0x1f36) [0x56d5f6]
python3(_PyEval_EvalCodeWithName+0x26a) [0x56a0ba]
python3(_PyFunction_Vectorcall+0x393) [0x5f6343]
python3(_PyEval_EvalFrameDefault+0x71d) [0x56bddd]
python3(_PyEval_EvalCodeWithName+0x26a) [0x56a0ba]
python3(PyEval_EvalCode+0x27) [0x68d5b7]
python3() [0x67cd01]
python3() [0x67cd7f]
python3() [0x67ce21]
python3(PyRun_SimpleFileExFlags+0x197) [0x67ef47]
python3(Py_RunMain+0x212) [0x6b7242]
python3(Py_BytesMain+0x2d) [0x6b75cd]
/lib/x86_64-linux-gnu/libc.so.6: __libc_start_main
python3(_start+0x2e) [0x5fb18e]

Internal error occurred. Check out this page for possible solutions:
https://docs.taichi.graphics/lang/articles/misc/install
@sjwsl sjwsl added the potential bug Something that looks like a bug but not yet confirmed label Oct 29, 2021
@qiao-bo
Copy link
Contributor

qiao-bo commented Oct 30, 2021

i can also reproduce this in a docker container. I installed clang-12 via apt, did you build from source?

@sjwsl
Copy link
Contributor Author

sjwsl commented Oct 30, 2021

i can also reproduce this in a docker container. I installed clang-12 via apt, did you build from source?

Yup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
potential bug Something that looks like a bug but not yet confirmed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants