Describe the bug
Hotspot v1.6.0 fails to build due to test failures on powerpc 64-bit little endian (ppc64el/ppc64le).
See https://buildd.debian.org/status/package.php?p=hotspot and https://buildd.debian.org/status/fetch.php?pkg=hotspot&arch=ppc64el&ver=1.6.0-0.1&stamp=1772570960&raw=0 .
To Reproduce
Run testsuites post-build on ppc64el machines.
Expected behavior
The test finishes successfully.
Screenshots
As discussed by a powerpc porter in https://bugs.debian.org/1129621#17 :
The failure happens in the test testDetectBranches() in tests/modeltests/tst_disassemblyoutput.cpp.
There are two issues.
-
The regex used to parse the readelf -s output does not match the format produced on ppc64el.
Replacing the restrictive character class with [^\n]+ fixes this.
-
The test assumes that every disassembly line contains branch visualisation output.
This assumption is not always true on ppc64el. Wrapping the check
with if (!line.branchVisualisation.isEmpty())
fixes the problem.
Version Info (please complete the following information):
- Linux Kernel version: Debian Sid/Unstable
- perf version: 6.18.15
- hotspot version (appimage? selfcompiled?): 1.6.0 selfcompiled
- if self-compiled hotspot, what version of elfutils: 0.194-1
Additional context
The proposed patch from by powerpc porter is as follows:
--- hotspot-1.6.0.orig/tests/modeltests/tst_disassemblyoutput.cpp
+++ hotspot-1.6.0/tests/modeltests/tst_disassemblyoutput.cpp
@@ -263,11 +263,12 @@ private slots:
};
for (const auto& line : result.disassemblyLines) {
- QVERIFY(!line.branchVisualisation.isEmpty());
-
- // check that we only captures valid visualisation characters
- QVERIFY(std::all_of(line.branchVisualisation.cbegin(), line.branchVisualisation.cend(),
+ // not every architecture emits branch visualisation for every line
+ if (!line.branchVisualisation.isEmpty()) {
+ // check that we only capture valid visualisation characters
+ QVERIFY(std::all_of(line.branchVisualisation.cbegin(), line.branchVisualisation.cend(),
isValidVisualisationCharacter));
+ }
QVERIFY(std::all_of(line.hexdump.cbegin(), line.hexdump.cend(), isValidHexdumpCharacter));
@@ -392,8 +393,7 @@ private:
};
static FunctionData findAddressAndSizeOfFunc(const QString& library, const QString& name)
{
- QRegularExpression regex(QStringLiteral("[ ]+[0-9]+: ([0-9a-f]+)[ ]+([0-9]+)[0-9 a-zA-Z]+%1\\n").arg(name));
-
+ QRegularExpression regex(QStringLiteral("[ ]+[0-9]+: ([0-9a-f]+)[ ]+([0-9]+)[^\\n]+%1").arg(name));
const auto readelfBinary = QStandardPaths::findExecutable(QStringLiteral("readelf"));
VERIFY_OR_THROW(!readelfBinary.isEmpty());
Describe the bug
Hotspot v1.6.0 fails to build due to test failures on powerpc 64-bit little endian (ppc64el/ppc64le).
See https://buildd.debian.org/status/package.php?p=hotspot and https://buildd.debian.org/status/fetch.php?pkg=hotspot&arch=ppc64el&ver=1.6.0-0.1&stamp=1772570960&raw=0 .
To Reproduce
Run testsuites post-build on ppc64el machines.
Expected behavior
The test finishes successfully.
Screenshots
As discussed by a powerpc porter in https://bugs.debian.org/1129621#17 :
Version Info (please complete the following information):
Additional context
The proposed patch from by powerpc porter is as follows: