Giter Site home page Giter Site logo

2 tests fail on RiscV about mold HOT 6 CLOSED

ausil avatar ausil commented on September 18, 2024
2 tests fail on RiscV

from mold.

Comments (6)

rui314 avatar rui314 commented on September 18, 2024

I cannot debug it myself because Fedora doesn't provide a Docker image for riscv64.

Can you run the failing tests as bash -x test/elf/static-pie.sh and bash -x test/elf/ifunc-static-pie.sh and copy-n-paste the output?

from mold.

ausil avatar ausil commented on September 18, 2024

running the tests alone they pass okay, but as part of the rpm build they fail

The following tests FAILED:
	122 - riscv64-ifunc-static-pie (Failed)
	225 - riscv64-static-pie (Failed)
Errors while running CTest
error: Bad exit status from /var/tmp/rpm-tmp.aoysuV (%check)

RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.aoysuV (%check) 
[mockbuild@a460513229fd4580ab9226e651e0bfbe ~]$ cd /builddir/build/BUILD/mold-2.32.0/
[mockbuild@a460513229fd4580ab9226e651e0bfbe mold-2.32.0]$ bash -x test/elf/static-pie.sh
++ dirname test/elf/static-pie.sh
+ . test/elf/common.inc
++ export LC_ALL=C
++ LC_ALL=C
++ '[' -z '' ']'
++++ uname -m
+++ canonical_name riscv64
+++ case $1 in
+++ echo riscv64
++ MACHINE=riscv64
++ '[' -z '' ']'
++ TESTDIR=out/test/elf/riscv64
++ CC=cc
++ CXX=c++
++ GCC=gcc
++ GXX=g++
++ OBJDUMP=objdump
++ OBJCOPY=objcopy
++ STRIP=strip
++ QEMU=
++ '[' riscv64 = x86_64 -o riscv64 = i686 -o riscv64 = arm ']'
++ '[' riscv64 = aarch64 ']'
++ trap 'on_error $LINENO' ERR
++ trap on_exit EXIT
+++ basename test/elf/static-pie.sh .sh
++ testname=static-pie
++ echo -n 'Testing static-pie ... '
Testing static-pie ... ++ t=out/test/elf/riscv64/static-pie
++ mkdir -p out/test/elf/riscv64/static-pie
+ test_cflags -static-pie
+ echo 'int main() {}'
+ cc -static-pie -o /dev/null -xc -
+ cat
+ cc -o out/test/elf/riscv64/static-pie/a.o -c -xc - -fPIE
+ cc -B. -o out/test/elf/riscv64/static-pie/exe1 out/test/elf/riscv64/static-pie/a.o -static-pie
+ out/test/elf/riscv64/static-pie/exe1
+ grep -q 'Hello world'
+ cc -B. -o out/test/elf/riscv64/static-pie/exe2 out/test/elf/riscv64/static-pie/a.o -static-pie -Wl,--no-relax
+ out/test/elf/riscv64/static-pie/exe2
+ grep -q 'Hello world'
+ on_exit
+ echo OK
OK
+ exit 0
[mockbuild@a460513229fd4580ab9226e651e0bfbe mold-2.32.0]$ bash -x test/elf/ifunc-static-pie.sh
++ dirname test/elf/ifunc-static-pie.sh
+ . test/elf/common.inc
++ export LC_ALL=C
++ LC_ALL=C
++ '[' -z '' ']'
++++ uname -m
+++ canonical_name riscv64
+++ case $1 in
+++ echo riscv64
++ MACHINE=riscv64
++ '[' -z '' ']'
++ TESTDIR=out/test/elf/riscv64
++ CC=cc
++ CXX=c++
++ GCC=gcc
++ GXX=g++
++ OBJDUMP=objdump
++ OBJCOPY=objcopy
++ STRIP=strip
++ QEMU=
++ '[' riscv64 = x86_64 -o riscv64 = i686 -o riscv64 = arm ']'
++ '[' riscv64 = aarch64 ']'
++ trap 'on_error $LINENO' ERR
++ trap on_exit EXIT
+++ basename test/elf/ifunc-static-pie.sh .sh
++ testname=ifunc-static-pie
++ echo -n 'Testing ifunc-static-pie ... '
Testing ifunc-static-pie ... ++ t=out/test/elf/riscv64/ifunc-static-pie
++ mkdir -p out/test/elf/riscv64/ifunc-static-pie
+ test_cflags -static-pie
+ echo 'int main() {}'
+ cc -static-pie -o /dev/null -xc -
+ supports_ifunc
+ is_musl
+ ldd --version
+ grep -q musl
+ echo 'void x() __attribute__((ifunc("y"))); void *y() { return 0; }'
+ cc -c -o /dev/null -xc -
+ cat
+ cc -o out/test/elf/riscv64/ifunc-static-pie/a.o -c -xc - -fPIC
+ cc -B. -o out/test/elf/riscv64/ifunc-static-pie/exe2 out/test/elf/riscv64/ifunc-static-pie/a.o -static-pie
+ out/test/elf/riscv64/ifunc-static-pie/exe2
+ grep -q 'Hello world'
+ on_exit
+ echo OK
OK
+ exit 0

from mold.

rui314 avatar rui314 commented on September 18, 2024

ctest runs the scripts just like you manually did, so it is odd that the scripts failed only for the rpm build. I'm not familiar with the RPM packaging system. Can you debug a little bit to see which command in the scripts failed?

from mold.

ausil avatar ausil commented on September 18, 2024

rpmbuild output the full failure

125/338 Test #122: riscv64-ifunc-static-pie ....................***Failed    3.05 sec
++ dirname /builddir/build/BUILD/mold-2.32.0/test/elf/ifunc-static-pie.sh
+ . /builddir/build/BUILD/mold-2.32.0/test/elf/common.inc
++ export LC_ALL=C
++ LC_ALL=C
++ '[' -z riscv64 ']'
++ '[' -z '' ']'
++ TESTDIR=out/test/elf/riscv64
++ CC=cc
++ CXX=c++
++ GCC=gcc
++ GXX=g++
++ OBJDUMP=objdump
++ OBJCOPY=objcopy
++ STRIP=strip
++ QEMU=
++ '[' riscv64 = x86_64 -o riscv64 = i686 -o riscv64 = arm ']'
++ '[' riscv64 = aarch64 ']'
++ trap 'on_error $LINENO' ERR
++ trap on_exit EXIT
+++ basename /builddir/build/BUILD/mold-2.32.0/test/elf/ifunc-static-pie.sh .sh
++ testname=ifunc-static-pie
++ echo -n 'Testing ifunc-static-pie ... '
Testing ifunc-static-pie ... ++ t=out/test/elf/riscv64/ifunc-static-pie
++ mkdir -p out/test/elf/riscv64/ifunc-static-pie
+ test_cflags -static-pie
+ echo 'int main() {}'
+ cc -static-pie -o /dev/null -xc -
+ supports_ifunc
+ is_musl
+ ldd --version
+ grep -q musl
+ echo 'void x() __attribute__((ifunc("y"))); void *y() { return 0; }'
+ cc -c -o /dev/null -xc -
+ cat
+ cc -o out/test/elf/riscv64/ifunc-static-pie/a.o -c -xc - -fPIC
+ cc -B. -o out/test/elf/riscv64/ifunc-static-pie/exe2 out/test/elf/riscv64/ifunc-static-pie/a.o -static-pie
+ out/test/elf/riscv64/ifunc-static-pie/exe2
+ grep -q 'Hello world'
++ on_error 27
++ code=1
++ echo 'command failed: 27: grep -q '\''Hello world'\'''
command failed: 27: grep -q 'Hello world'
++ trap - EXIT
++ exit 1

231/338 Test #225: riscv64-static-pie ..........................***Failed    2.81 sec
++ dirname /builddir/build/BUILD/mold-2.32.0/test/elf/static-pie.sh
+ . /builddir/build/BUILD/mold-2.32.0/test/elf/common.inc
++ export LC_ALL=C
++ LC_ALL=C
++ '[' -z riscv64 ']'
++ '[' -z '' ']'
++ TESTDIR=out/test/elf/riscv64
++ CC=cc
++ CXX=c++
++ GCC=gcc
++ GXX=g++
++ OBJDUMP=objdump
++ OBJCOPY=objcopy
++ STRIP=strip
++ QEMU=
++ '[' riscv64 = x86_64 -o riscv64 = i686 -o riscv64 = arm ']'
++ '[' riscv64 = aarch64 ']'
++ trap 'on_error $LINENO' ERR
++ trap on_exit EXIT
+++ basename /builddir/build/BUILD/mold-2.32.0/test/elf/static-pie.sh .sh
++ testname=static-pie
++ echo -n 'Testing static-pie ... '
Testing static-pie ... ++ t=out/test/elf/riscv64/static-pie
++ mkdir -p out/test/elf/riscv64/static-pie
+ test_cflags -static-pie
+ echo 'int main() {}'
+ cc -static-pie -o /dev/null -xc -
+ cat
+ cc -o out/test/elf/riscv64/static-pie/a.o -c -xc - -fPIE
+ cc -B. -o out/test/elf/riscv64/static-pie/exe1 out/test/elf/riscv64/static-pie/a.o -static-pie
+ out/test/elf/riscv64/static-pie/exe1
+ grep -q 'Hello world'
++ on_error 14
++ code=1
++ echo 'command failed: 14: grep -q '\''Hello world'\'''
command failed: 14: grep -q 'Hello world'
++ trap - EXIT
++ exit 1

from mold.

ausil avatar ausil commented on September 18, 2024

the rpmbuild puts its output in a slightly different location. The binaries segfault from those two tests

[mockbuild@a460513229fd4580ab9226e651e0bfbe mold-2.32.0]$  redhat-linux-build/out/test/elf/riscv64/static-pie/exe1 
Segmentation fault (core dumped)
[mockbuild@a460513229fd4580ab9226e651e0bfbe mold-2.32.0]$  redhat-linux-build/out/test/elf/riscv64/ifunc-static-pie/exe2 
Segmentation fault (core dumped)

from mold.

ausil avatar ausil commented on September 18, 2024

http://fedora.riscv.rocks:3000/davidlt/-/packages/container/fedora-generic/40 has info on getting a fedora container image

from mold.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.