Skip to content

Conversation

@mleleszi
Copy link
Contributor

@mleleszi mleleszi commented Nov 6, 2025

Looks like #166517 is breaking libc-riscv32-qemu-yocto-fullbuild-dbg build due to failing overflow test for strfrom.
https://lab.llvm.org/buildbot/#/changes/58668

int result = func(buff, sizeof(buff), "%.2147483647f", 1.0f);
EXPECT_LT(result, 0);
ASSERT_ERRNO_FAILURE();
[ RUN      ] LlvmLibcStrfromdTest.CharsWrittenOverflow
/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/test/src/stdlib/StrfromTest.h:493: FAILURE
       Expected: result
       Which is: 0
To be less than: 0
       Which is: 0
/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/test/src/stdlib/StrfromTest.h:494: FAILURE
          Expected: 0
          Which is: 0
To be not equal to: static_cast<int>(libc_errno)
          Which is: 0
[  FAILED  ] LlvmLibcStrfromdTest.CharsWrittenOverflow
Ran 8 tests.  PASS: 7  FAIL: 1

At first glance it seem like there is some kind of overflow in internal::strfromfloat_convert on 32bit archs because the other overflow test case is passing for snprintf. Interestingly, it passes on all other buildbots, including libc-arm32-qemu-debian-dbg.

This issue likely wasn't introduced by #166517 and was probably already present, so I'm not reverting the change just disabling the test case on riscv32 until I can debug properly.

@mleleszi mleleszi marked this pull request as ready for review November 6, 2025 06:49
@llvmbot llvmbot added the libc label Nov 6, 2025
@llvmbot
Copy link
Member

llvmbot commented Nov 6, 2025

@llvm/pr-subscribers-libc

Author: Marcell Leleszi (mleleszi)

Changes

Looks like #166517 is breaking libc-riscv32-qemu-yocto-fullbuild-dbg build due to failing overflow test for strfrom.
https://lab.llvm.org/buildbot/#/changes/58668

Triggered by:

int result = func(buff, sizeof(buff), "%.2147483647f", 1.0f);
[ RUN      ] LlvmLibcStrfromdTest.CharsWrittenOverflow
/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/test/src/stdlib/StrfromTest.h:493: FAILURE
       Expected: result
       Which is: 0
To be less than: 0
       Which is: 0
/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/test/src/stdlib/StrfromTest.h:494: FAILURE
          Expected: 0
          Which is: 0
To be not equal to: static_cast&lt;int&gt;(libc_errno)
          Which is: 0
[  FAILED  ] LlvmLibcStrfromdTest.CharsWrittenOverflow
Ran 8 tests.  PASS: 7  FAIL: 1

At first glance it seem like there i some kind of overflow in internal::strfromfloat_convert on 32bit archs because the other overflow test case is passing for snprintf. Interestingly, it passes on all other buildbots, including libc-arm32-qemu-debian-dbg.

This issue likely wasn't introduced by #166517 and was probably already present, so I'm not reverting the change just commenting the test case out to fix the builds until I can debug properly.


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

1 Files Affected:

  • (modified) libc/test/src/stdlib/StrfromTest.h (+3-3)
diff --git a/libc/test/src/stdlib/StrfromTest.h b/libc/test/src/stdlib/StrfromTest.h
index fd2e0f120e90e..3466a605e2256 100644
--- a/libc/test/src/stdlib/StrfromTest.h
+++ b/libc/test/src/stdlib/StrfromTest.h
@@ -514,6 +514,6 @@ class StrfromTest : public LIBC_NAMESPACE::testing::ErrnoCheckingTest {
     insufficentBufsize(func);                                                  \
   }                                                                            \
   TEST_F(LlvmLibc##name##Test, InfAndNanValues) { infNanValues(func); }        \
-  TEST_F(LlvmLibc##name##Test, CharsWrittenOverflow) {                         \
-    charsWrittenOverflow(func);                                                \
-  }
+  // TEST_F(LlvmLibc##name##Test, CharsWrittenOverflow) { \
+  //   charsWrittenOverflow(func); \
+  // }

@mleleszi
Copy link
Contributor Author

mleleszi commented Nov 6, 2025

@mleleszi mleleszi changed the title [libc] Disable overflow test in strfromtest [libc] Disable overflow test in strfromtest on riscv32 Nov 6, 2025
Copy link
Contributor

@michaelrj-google michaelrj-google left a comment

Choose a reason for hiding this comment

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

LGTM

@michaelrj-google michaelrj-google merged commit 6adf993 into llvm:main Nov 6, 2025
20 checks passed
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