Description
This is one of two ARM related issues that I have isolated, where the output of tidy
is different between two machines.
5 systems under test: 4 on Travis (Mac and Linux, gcc and clang compilers) and 1 on Raspberry Pi 2 (Raspbian/Hypriot with gcc 4.6.3).
The test is 427664 "Missing attr values cause NULL segfault". There is no segfault, but...the output of the tidy
command is different, specifically this test case:
@test "427664: Missing attr values cause NULL segfault: msg" {
run diff -c testbase/msg_427664.txt tmp/msg_427664.txt
[ "$status" -eq 0 ]
}
On all 4 Intel systems under test, this passes. On the Pi 2, I get this diff:
emv@parviflorus:~/src/tidy-html5/test$ diff -c {testbase,tmp}/*msg_427664*
*** testbase/msg_427664.txt 2015-09-12 23:04:21.515581574 -0400
--- tmp/msg_427664.txt 2015-09-12 23:49:58.993100407 -0400
***************
*** 1,5 ****
line 1 column 1 - Warning: missing <!DOCTYPE> declaration
! line 5 column 1 - Warning: <body> attribute name "��1/2" (value="xx") is invalid
line 5 column 1 - Warning: <body> unexpected or duplicate quote mark
line 5 column 1 - Warning: <body> unexpected or duplicate quote mark
line 5 column 1 - Warning: <body> attribute "width" has invalid value "align="""
--- 1,5 ----
line 1 column 1 - Warning: missing <!DOCTYPE> declaration
! line 5 column 1 - Warning: <body> attribute name "Ã1/2" (value="xx") is invalid
line 5 column 1 - Warning: <body> unexpected or duplicate quote mark
line 5 column 1 - Warning: <body> unexpected or duplicate quote mark
line 5 column 1 - Warning: <body> attribute "width" has invalid value "align="""
It looks like a byte ordering issue in the message output. The output is coming from localize.c at https://github.com/htacg/tidy-html5/blob/master/src/localize.c#L85 and it looks like it's triggering it at lexer.c at https://github.com/htacg/tidy-html5/blob/master/src/lexer.c#L3921 .
Again, this all works on all of the 64 bit Intel systems that I have, and fails only on 32 bit ARM. There's nothing obviously wrong in the code, so my next step is to create some more interesting failing test cases.