Bug 210326

Summary: Multiple errors in libxo ATF tests on i386
Product: Base System Reporter: Alan Somers <asomers>
Component: binAssignee: Phil Shafer <phil>
Status: Closed FIXED    
Severity: Affects Many People CC: asomers, i386, marklmi26-fbsd
Priority: ---    
Version: CURRENT   
Hardware: i386   
OS: Any   
See Also: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=210560

Description Alan Somers freebsd_committer freebsd_triage 2016-06-16 17:03:33 UTC
The libxo ATF tests all pass on amd64, but they have multiple errors on i386.  Some tests give the wrong output, and others segfault.  From inspection, I believe that the errors lie in libxo itself, not in the tests.  Here are two examples.  The first gives wrong output and the second segfaults.

$ kyua debug functional_test:test_02__E
Executing command [ env LC_ALL=en_US.UTF-8 LIBXO_OPTIONS=warn,encoder=test TZ=EST /usr/tests/lib/libxo/test_02 ]
Fail: stdout does not match golden output
--- /usr/tests/lib/libxo/test_02.E.out  2016-06-11 01:25:13.000000000 +0000
+++ /tmp/kyua.atf-tester.wD9FcQ/check.KQCiwT/stdout     2016-06-16 17:01:58.283775000 +0000
@@ -9,9 +9,9 @@
 op content: [fd] [-1]
 op string: [error] [Bad fi]
 op string: [test] [good]
-op content: [lines] [20]
-op content: [words] [30]
-op content: [characters] [40]
+op content: [lines] [128849018900]
+op content: [words] [577747258217332776]
+op content: [characters] [0]
 op open_leaf_list: [bytes] []
 op content: [bytes] [0]
 op content: [bytes] [1]
functional_test:test_02__E  ->  failed: atf-check failed; see the output of the test for details


$ kyua debug functional_test:test_02__H
Executing command [ env LC_ALL=en_US.UTF-8 LIBXO_OPTIONS=:WH TZ=EST /usr/tests/lib/libxo/test_02 ]
Fail: program did not exit cleanly
stdout:
<div class="line"><div class="text">We are </div><div class="text">{emit}</div><div class="text">{ting}</div><div class="text"> some </div><div class="data" data-tag="what">braces</div></div><div class="line"><div class="message">abcdef
</div></div><div class="line"><div class="message">abcdef: Bad file descriptor
</div></div><div class="line"><div class="message">improper use of profanity; ten yard penalty; first down
</div></div><div class="line"><div class="text">length </div><div class="data" data-tag="length">abcdef</div></div><div class="line"><div class="text">close </div><div class="data" data-tag="fd">-1</div><div class="text"> returned </div><div class="data" data-tag="error">Bad file descriptor</div><div class="text"> </div><div class="data" data-tag="test">good</div></div><div class="line"><div class="text">close </div><div class="data" data-tag="fd">-1</div><div class="text"> returned </div><div class="data" data-tag="error">Bad fi</div><div class="text"> </div><div class="data" data-tag="test">good</div></div><div class="line"><div class="message">improper use of profanity; ten yard penalty; first down
</div></div>
stderr:

functional_test:test_02__H  ->  failed: atf-check failed; see the output of the test for details
Comment 1 Alan Somers freebsd_committer freebsd_triage 2016-06-16 17:04:36 UTC
$ uname -a
FreeBSD alans-fbsd-head-i386.eng.sldomain.com 11.0-ALPHA3 FreeBSD 11.0-ALPHA3 #0 r301815: Sat Jun 11 00:55:35 UTC 2016     root@releng2.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC  i386
Comment 2 Phil Shafer freebsd_committer freebsd_triage 2016-06-29 01:35:49 UTC
Turns out the test driver was using "%ju" and not casting the arguments.  Fix is:

diff --git a/tests/core/test_02.c b/tests/core/test_02.c
index 9a02680..cf98d34 100644
--- a/tests/core/test_02.c
+++ b/tests/core/test_02.c
@@ -70,7 +70,7 @@ main (int argc, char **argv)

     xo_emit(" {:lines/%7ju} {:words/%7ju} "
             "{:characters/%7ju} {d:filename/%s}\n",
-            20, 30, 40, "file");
+            (uintmax_t) 20, (uintmax_t) 30, (uintmax_t) 40, "file");

     int i;
     for (i = 0; i < 5; i++)

The fix is in github.  I'll spin a release and then import it to freebsd.

Thanks,
 Phil
Comment 3 Mark Millard 2016-07-05 17:33:06 UTC
*** Bug 210560 has been marked as a duplicate of this bug. ***
Comment 4 Alan Somers freebsd_committer freebsd_triage 2016-12-29 23:11:33 UTC
Fixed by r302321

r302321 | ngie | 2016-07-02 19:35:27 -0600 (Sat, 02 Jul 2016) | 13 lines

Update libxo to 0.6.3

This fixes the 02 testcases on i386 (at least), and may fix the testcases
in general on 32-bit platforms

Differential Revision: https://reviews.freebsd.org/D7052
Approved by: phil (maintainer)
Approved by: re (gjb)
Reported by: asomers
Reviewed by: phil
Submitted by: phil
Sponsored by: EMC / Isilon Storage Division