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

RISC-V: unit test failures on GCC #1833

Closed
namhyung opened this issue Oct 15, 2023 · 1 comment
Closed

RISC-V: unit test failures on GCC #1833

namhyung opened this issue Oct 15, 2023 · 1 comment

Comments

@namhyung
Copy link
Owner

Like in this comment, currently uftrace gets SIG failure (meaning it's terminated by a signal) for every unit test function on RISC-V when it's built by gcc. Clang built versions are fine, so it should be a compiler issue.

The assembly output shows that the uftrace.unit_test section didn't have any data and filled with 0s. This info is needed for the unittest binary to find the test name and function address to run. We can skip the test with 0 value to prevent the segfault, but it'd be meaningless when it cannot run any tests. So I'd like to keep this issue open and to track any progress on it.

$ nm tests/unittest | grep framework
000000000000eef4 T func_unittest_framework
00000000000940c8 D test_unittest_framework

$ hexdump -C -s 0x940c8 -n 16 tests/unittest
000940c8  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
000940d8
namhyung added a commit that referenced this issue Dec 21, 2023
On RISC-V, at least some GCC doesn't set the uftrace test data in
the uftrace.unit_test section.  I'm not sure what's the problem
exactly but we can handle that by filling the symbol and string from
the binary.

Fixed: #1833
Signed-off-by: Namhyung Kim <[email protected]>
@namhyung
Copy link
Owner Author

I've updated it to run unit tests on RISC-V. Please check check/riscv-test branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant