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

[lldb][test] Fix some 'import-std-module' tests #122358

Merged
merged 2 commits into from
Jan 13, 2025

Conversation

dzhidzhoev
Copy link
Member

Some tests from 'import-std-module' used to fail on the builder
https://lab.llvm.org/staging/#/builders/195/builds/4470,
since libcxx is set up to be linked statically with test binaries
on it.

Thus, they were temporarily disabled in #112530. Here, this commit
is reverted.

Jitted expressions from the tests try to call __libcpp_verbose_abort
function that is not present in the process image, which causes
the failure.

Here, this symbol is explicitly referenced from the test source files.

@llvmbot
Copy link
Member

llvmbot commented Jan 9, 2025

@llvm/pr-subscribers-lldb

Author: Vladislav Dzhidzhoev (dzhidzhoev)

Changes

Some tests from 'import-std-module' used to fail on the builder
https://lab.llvm.org/staging/#/builders/195/builds/4470,
since libcxx is set up to be linked statically with test binaries
on it.

Thus, they were temporarily disabled in #112530. Here, this commit
is reverted.

Jitted expressions from the tests try to call __libcpp_verbose_abort
function that is not present in the process image, which causes
the failure.

Here, this symbol is explicitly referenced from the test source files.


Full diff: https://github.com/llvm/llvm-project/pull/122358.diff

6 Files Affected:

  • (modified) lldb/test/API/commands/expression/import-std-module/array/TestArrayFromStdModule.py (-1)
  • (modified) lldb/test/API/commands/expression/import-std-module/array/main.cpp (+3)
  • (modified) lldb/test/API/commands/expression/import-std-module/vector-dbg-info-content/TestDbgInfoContentVectorFromStdModule.py (-1)
  • (modified) lldb/test/API/commands/expression/import-std-module/vector-dbg-info-content/main.cpp (+3)
  • (modified) lldb/test/API/commands/expression/import-std-module/vector-of-vectors/TestVectorOfVectorsFromStdModule.py (-1)
  • (modified) lldb/test/API/commands/expression/import-std-module/vector-of-vectors/main.cpp (+3)
diff --git a/lldb/test/API/commands/expression/import-std-module/array/TestArrayFromStdModule.py b/lldb/test/API/commands/expression/import-std-module/array/TestArrayFromStdModule.py
index bafc7628296217..13ab6b0c9ac1fb 100644
--- a/lldb/test/API/commands/expression/import-std-module/array/TestArrayFromStdModule.py
+++ b/lldb/test/API/commands/expression/import-std-module/array/TestArrayFromStdModule.py
@@ -10,7 +10,6 @@
 class TestCase(TestBase):
     @add_test_categories(["libc++"])
     @skipIf(compiler=no_match("clang"))
-    @skipIfLinux  # https://discourse.llvm.org/t/lldb-test-failures-on-linux/80095
     def test(self):
         self.build()
 
diff --git a/lldb/test/API/commands/expression/import-std-module/array/main.cpp b/lldb/test/API/commands/expression/import-std-module/array/main.cpp
index 9bcd0b574042a4..dae5db34b6f794 100644
--- a/lldb/test/API/commands/expression/import-std-module/array/main.cpp
+++ b/lldb/test/API/commands/expression/import-std-module/array/main.cpp
@@ -1,4 +1,7 @@
 #include <array>
+#include <__verbose_abort>
+
+void *libcpp_verbose_abort_ptr = (void *) &std::__libcpp_verbose_abort;
 
 struct DbgInfo {
   int v = 4;
diff --git a/lldb/test/API/commands/expression/import-std-module/vector-dbg-info-content/TestDbgInfoContentVectorFromStdModule.py b/lldb/test/API/commands/expression/import-std-module/vector-dbg-info-content/TestDbgInfoContentVectorFromStdModule.py
index 71eaeef20e792d..1c32222e64f14c 100644
--- a/lldb/test/API/commands/expression/import-std-module/vector-dbg-info-content/TestDbgInfoContentVectorFromStdModule.py
+++ b/lldb/test/API/commands/expression/import-std-module/vector-dbg-info-content/TestDbgInfoContentVectorFromStdModule.py
@@ -14,7 +14,6 @@ class TestDbgInfoContentVector(TestBase):
     @skipIf(compiler="clang", compiler_version=["<", "12.0"])
     @skipIf(macos_version=["<", "14.0"])
     @skipIfDarwin  # https://github.com/llvm/llvm-project/issues/106475
-    @skipIfLinux  # https://discourse.llvm.org/t/lldb-test-failures-on-linux/80095
     def test(self):
         self.build()
 
diff --git a/lldb/test/API/commands/expression/import-std-module/vector-dbg-info-content/main.cpp b/lldb/test/API/commands/expression/import-std-module/vector-dbg-info-content/main.cpp
index 24c3fec75d2f5f..ecb36ef6ccac23 100644
--- a/lldb/test/API/commands/expression/import-std-module/vector-dbg-info-content/main.cpp
+++ b/lldb/test/API/commands/expression/import-std-module/vector-dbg-info-content/main.cpp
@@ -1,4 +1,7 @@
 #include <vector>
+#include <__verbose_abort>
+
+void *libcpp_verbose_abort_ptr = (void *) &std::__libcpp_verbose_abort;
 
 struct Foo {
   int a;
diff --git a/lldb/test/API/commands/expression/import-std-module/vector-of-vectors/TestVectorOfVectorsFromStdModule.py b/lldb/test/API/commands/expression/import-std-module/vector-of-vectors/TestVectorOfVectorsFromStdModule.py
index e9415fd53651f7..a1f33271f39d2f 100644
--- a/lldb/test/API/commands/expression/import-std-module/vector-of-vectors/TestVectorOfVectorsFromStdModule.py
+++ b/lldb/test/API/commands/expression/import-std-module/vector-of-vectors/TestVectorOfVectorsFromStdModule.py
@@ -10,7 +10,6 @@
 class TestVectorOfVectors(TestBase):
     @add_test_categories(["libc++"])
     @skipIf(compiler=no_match("clang"))
-    @skipIfLinux  # https://discourse.llvm.org/t/lldb-test-failures-on-linux/80095
     def test(self):
         self.build()
 
diff --git a/lldb/test/API/commands/expression/import-std-module/vector-of-vectors/main.cpp b/lldb/test/API/commands/expression/import-std-module/vector-of-vectors/main.cpp
index b5ada909e43976..596bbef163df0b 100644
--- a/lldb/test/API/commands/expression/import-std-module/vector-of-vectors/main.cpp
+++ b/lldb/test/API/commands/expression/import-std-module/vector-of-vectors/main.cpp
@@ -1,4 +1,7 @@
 #include <vector>
+#include <__verbose_abort>
+
+void *libcpp_verbose_abort_ptr = (void *) &std::__libcpp_verbose_abort;
 
 int main(int argc, char **argv) {
   std::vector<std::vector<int> > a = {{1, 2, 3}, {3, 2, 1}};

@dzhidzhoev dzhidzhoev changed the title [lldb][test] Link certain libc++ tests with the whole library [lldb][test] Fix some 'import-std-module' tests Jan 9, 2025
@dzhidzhoev dzhidzhoev force-pushed the lldb/import-std-module-3 branch from 48a1874 to 0c88cd4 Compare January 9, 2025 20:07
Copy link

github-actions bot commented Jan 9, 2025

✅ With the latest revision this PR passed the C/C++ code formatter.

Copy link
Collaborator

@labath labath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that's the general idea. Just add a comment about why this is being done.

If this ends up failing in some configuration, there are plenty of other (more indirect) ways of pulling in this symbol that we can try.

@dzhidzhoev dzhidzhoev force-pushed the lldb/import-std-module-3 branch from 0c88cd4 to a15f58a Compare January 13, 2025 20:41
Some tests from 'import-std-module' used to fail on the builder
https://lab.llvm.org/staging/#/builders/195/builds/4470,
since libcxx is set up to be linked statically with test binaries
on it.

Thus, they were temporarily disabled in llvm#112530. Here, this commit
is reverted.

Jitted expressions from the tests try to call __libcpp_verbose_abort
function that is not present in the process image, which causes
the failure.

Here, this symbol is explicitly referenced from the test source files.
@dzhidzhoev dzhidzhoev force-pushed the lldb/import-std-module-3 branch from a15f58a to b5a27fd Compare January 13, 2025 20:44
@dzhidzhoev dzhidzhoev merged commit 61e2841 into llvm:main Jan 13, 2025
5 of 6 checks passed
@Prabhuk
Copy link
Contributor

Prabhuk commented Jan 14, 2025

Hi @dzhidzhoev! I am seeing failures in our lldb builders and from the list of commits that went into the build this PR seems to be the likely cause though I am not completely sure.

This is the builder link: https://luci-milo.appspot.com/ui/p/fuchsia/builders/toolchain.ci/lldb-linux-arm64/b8725815472020390097/overview

Logs: https://logs.chromium.org/logs/fuchsia/buildbucket/cr-buildbucket/8725815472020390097/+/u/test_lldb/check_lldb/stdout

I am working on verifying if our builders pass without your patch from my side.

@labath
Copy link
Collaborator

labath commented Jan 15, 2025

This looks like some sort of a problem with the test infrastructure. It thinks the test "passed unexpectedly" even though it has no "expected failure" annotations and the test itself reports it succeeded.

@Prabhuk
Copy link
Contributor

Prabhuk commented Jan 16, 2025

Verified that the failure in our bots were due to our LLDB recipe and not this patch. Thank you @labath for helping to isolate the problem on our end.

DKLoehr pushed a commit to DKLoehr/llvm-project that referenced this pull request Jan 17, 2025
Some tests from 'import-std-module' used to fail on the builder
https://lab.llvm.org/staging/#/builders/195/builds/4470,
since libcxx is set up to be linked statically with test binaries
on it.

Thus, they were temporarily disabled in llvm#112530. Here, this commit
is reverted.

Jitted expressions from the tests try to call __libcpp_verbose_abort
function that is not present in the process image, which causes
the failure.

Here, this symbol is explicitly referenced from the test source files.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants