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

Test failure: API/misc/debug #1390

Closed
floppym opened this issue Sep 1, 2019 · 3 comments
Closed

Test failure: API/misc/debug #1390

floppym opened this issue Sep 1, 2019 · 3 comments
Assignees
Labels

Comments

@floppym
Copy link
Contributor

@floppym floppym commented Sep 1, 2019

Description of problem:
The API/misc/debug test fails on Gentoo Linux.

Ksh version:
2020.0.0-beta1

system-info.txt

 21/287 API/misc/debug                          FAIL     0.13 s (exit status 1)

--- command ---
/bin/sh /x/portage/app-shells/ksh-2020.0.0_beta1/work/ksh-2020.0.0-beta1/src/lib/libast/tests/run_test.sh src/lib/libast/tests/misc/debug /x/portage/app-shells/ksh-2020.0.0_beta1/work/ksh-2020.0.0-beta1/src/lib/libast/tests/misc
--- stdout ---
<I> run_test[69]: TEST_DIR=/x/portage/app-shells/ksh-2020.0.0_beta1/temp/api.debug.0KDbVg
--- stderr ---
<E> run_test[116]: Stderr for debug had unexpected differences:
--- /x/portage/app-shells/ksh-2020.0.0_beta1/work/ksh-2020.0.0-beta1/src/lib/libast/tests/misc/debug.err        2019-08-30 08:32:36.000000000 -0400
+++ debug.err   2019-09-01 10:05:08.106623197 -0400
@@ -2,16 +2,16 @@
 -p 666
 addr2info(): hello unit test
 ### 666 Function backtrace:
-1   test_backtrace + 0
-2   main + 0
+1   __libc_start_main + 0
+2   (null) + 0
 ### 666 Function backtrace:
-1   test_backtrace + 0
-2   main + 0
+1   __libc_start_main + 0
+2   (null) + 0
 ### 666 Function backtrace:
-1   test_backtrace + 0
-2   main + 0
+1   __libc_start_main + 0
+2   (null) + 0
 ### 666 Function backtrace:
-1   test_backtrace + 0
-2   main + 0
+1   __libc_start_main + 0
+2   (null) + 0
 ### 666   0.000 debug.c:987                   main() 01234567890123456789012...
 ### 666   0.000 debug.c:987                   main() 0123456789012...

@floppym

This comment has been minimized.

Copy link
Contributor Author

@floppym floppym commented Sep 1, 2019

This seems to be triggered by running meson configure with CFLAGS="-O2" set in the environment.

CFLAGS="-O2" meson build
@krader1961 krader1961 self-assigned this Sep 1, 2019
@krader1961

This comment has been minimized.

Copy link
Collaborator

@krader1961 krader1961 commented Sep 1, 2019

The problem is that enabling optimizations enables features like function inlining and eliding frame pointers. All of which will affect the backtrace provided by the libc backtrace() function. The same problem occurs if you use the preferred way to enable an optimized build: meson --buildtype=release. From the meson docs where it talks about the use of env vars like CFLAGS:

It is recommended that you do not use these. They are provided purely to for backwards compatibility with other build systems. There are many caveats to their use, especially when rebuilding the project. It is highly recommended that you use the command line arguments instead.

I've added a configure time check to skip that test if buildtype != debug. But I don't see anyway to do the same if you use CFLAGS=-O2.

@krader1961 krader1961 closed this in d89753b Sep 1, 2019
@floppym

This comment has been minimized.

Copy link
Contributor Author

@floppym floppym commented Sep 1, 2019

I've added a configure time check to skip that test if buildtype != debug. But I don't see anyway to do the same if you use CFLAGS=-O2.

That should work fine. Gentoo builds with buildtype = plain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.