<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - LLDB import std module tests crash with segmentation fault"
   href="https://bugs.llvm.org/show_bug.cgi?id=51446">51446</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>LLDB import std module tests crash with segmentation fault
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>lldb
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>12.0
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>All Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>lldb-dev@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>omair.javaid@linaro.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>jdevlieghere@apple.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>This came up during release testing on x86_64 and AArch64 but reproducible with
tot.

** Build instructions:

CC=/home/omair.javaid/work/lldb-dev/clang+llvm-11.0.1-aarch64-linux-gnu/bin/clang
CXX=/home/omair.javaid/work/lldb-dev/clang+llvm-11.0.1-aarch64-linux-gnu/bin/clang++

cmake -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_ENABLE_PROJECTS="llvm;clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;test-suite;openmp;lld;lldb;polly;mlir;flang"
\
-DLLVM_ENABLE_ASSERTIONS=OFF \
-DLLVM_LIT_ARGS=-svj4 \
-DCMAKE_C_COMPILER=$CC \
-DCMAKE_CXX_COMPILER=$CXX \
$LLDB_HOME/llvm-project/llvm

ninja

ninja check-lldb

** Failures:
  lldb-api ::
commands/expression/import-std-module/array/TestArrayFromStdModule.py
  lldb-api ::
commands/expression/import-std-module/basic/TestImportStdModule.py
  lldb-api ::
commands/expression/import-std-module/conflicts/TestStdModuleWithConflicts.py
  lldb-api ::
commands/expression/import-std-module/deque-basic/TestDequeFromStdModule.py
  lldb-api ::
commands/expression/import-std-module/deque-dbg-info-content/TestDbgInfoContentDequeFromStdModule.py
  lldb-api ::
commands/expression/import-std-module/forward_list-dbg-info-content/TestDbgInfoContentForwardListFromStdModule.py
  lldb-api ::
commands/expression/import-std-module/forward_list/TestForwardListFromStdModule.py
  lldb-api ::
commands/expression/import-std-module/iterator/TestIteratorFromStdModule.py
  lldb-api ::
commands/expression/import-std-module/list-dbg-info-content/TestDbgInfoContentListFromStdModule.py
  lldb-api ::
commands/expression/import-std-module/list/TestListFromStdModule.py
  lldb-api ::
commands/expression/import-std-module/non-module-type-separation/TestNonModuleTypeSeparation.py
  lldb-api ::
commands/expression/import-std-module/queue/TestQueueFromStdModule.py
  lldb-api ::
commands/expression/import-std-module/retry-with-std-module/TestRetryWithStdModule.py
  lldb-api ::
commands/expression/import-std-module/shared_ptr-dbg-info-content/TestSharedPtrDbgInfoContentFromStdModule.py
  lldb-api ::
commands/expression/import-std-module/shared_ptr/TestSharedPtrFromStdModule.py
  lldb-api ::
commands/expression/import-std-module/sysroot/TestStdModuleSysroot.py
  lldb-api ::
commands/expression/import-std-module/vector-bool/TestVectorBoolFromStdModule.py
  lldb-api ::
commands/expression/import-std-module/vector-dbg-info-content/TestDbgInfoContentVectorFromStdModule.py
  lldb-api ::
commands/expression/import-std-module/vector-of-vectors/TestVectorOfVectorsFromStdModule.py
  lldb-api ::
commands/expression/import-std-module/vector/TestVectorFromStdModule.py
  lldb-api ::
commands/expression/import-std-module/weak_ptr-dbg-info-content/TestDbgInfoContentWeakPtrFromStdModule.py
  lldb-api ::
commands/expression/import-std-module/weak_ptr/TestWeakPtrFromStdModule.py


** Example Errors:

Fatal Python error: Segmentation fault

Thread 0x0000ffffa8055010 (most recent call first):
  File
"/home/omair.javaid/work/lldb-dev/build/release/aarch64/lib/python3/dist-packages/lldb/__init__.py",
line 6002 in EvaluateExpression
  File
"/home/omair.javaid/work/lldb-dev/llvm-project/lldb/packages/Python/lldbsuite/test/lldbtest.py",
line 2586 in expect_expr
  File
"/home/omair.javaid/work/lldb-dev/llvm-project/lldb/test/API/commands/expression/import-std-module/weak_ptr/TestWeakPtrFromStdModule.py",
line 28 in test
  File
"/home/omair.javaid/work/lldb-dev/llvm-project/lldb/packages/Python/lldbsuite/test/decorators.py",
line 149 in wrapper
  File
"/home/omair.javaid/work/lldb-dev/llvm-project/lldb/packages/Python/lldbsuite/test/lldbtest.py",
line 1834 in test_method
  File
"/home/omair.javaid/work/lldb-dev/llvm-project/lldb/third_party/Python/module/unittest2/unittest2/case.py",
line 413 in runMethod
  File
"/home/omair.javaid/work/lldb-dev/llvm-project/lldb/third_party/Python/module/unittest2/unittest2/case.py",
line 383 in run
  File
"/home/omair.javaid/work/lldb-dev/llvm-project/lldb/third_party/Python/module/unittest2/unittest2/case.py",
line 458 in __call__
  File
"/home/omair.javaid/work/lldb-dev/llvm-project/lldb/third_party/Python/module/unittest2/unittest2/suite.py",
line 117 in _wrapped_run
  File
"/home/omair.javaid/work/lldb-dev/llvm-project/lldb/third_party/Python/module/unittest2/unittest2/suite.py",
line 115 in _wrapped_run
  File
"/home/omair.javaid/work/lldb-dev/llvm-project/lldb/third_party/Python/module/unittest2/unittest2/suite.py",
line 85 in run
  File
"/home/omair.javaid/work/lldb-dev/llvm-project/lldb/third_party/Python/module/unittest2/unittest2/suite.py",
line 66 in __call__
  File
"/home/omair.javaid/work/lldb-dev/llvm-project/lldb/third_party/Python/module/unittest2/unittest2/runner.py",
line 165 in run
  File
"/home/omair.javaid/work/lldb-dev/llvm-project/lldb/packages/Python/lldbsuite/test/dotest.py",
line 1017 in run_suite
  File "/home/omair.javaid/work/lldb-dev/llvm-project/lldb/test/API/dotest.py",
line 7 in <module>



** Further comments:

I did a bit of investigation and found that crash emerges from
clang/lib/Parse/ParseAST.cpp
in clang::ParseAST(Sema &S, bool PrintStats, bool SkipFunctionBodies) function.

Its called from
lldb/source/Plugin/ExpressionParser/Clang/ClangExpressionParser.cpp in function
ClangExpressionParser::ParseInternal at line no  1179  
ParseAST(m_compiler->getSema(), false, false);</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>