Describe the bug
Test_recover_corrupted_swap_file is broken on 32bit systems like x86 and 32bit arm
To Reproduce
run vim testsuite
Expected behaviour
test pass
Screenshots
From test_recover.vim:
�Executed Test_nocatch_process_still_running() in 1.010242 seconds�[m�
Executed Test_noname_buffer() in 0.004784 seconds
Executed Test_recover_corrupted_swap_file() in 0.058540 seconds
Executed Test_recover_empty_swap_file() in 0.005846 seconds
Executed Test_recover_encrypted_swap_file() in 0.115394 seconds�[m�
Executed Test_recover_invalid_cursor_pos() in 0.007951 seconds
Executed Test_recover_multiple_swap_files() in 0.018030 seconds
Executed Test_recover_root_dir() in 0.002785 seconds
Executed Test_recover_symbolic_link() in 0.017381 seconds
Executed Test_recover_unmodified_file() in 0.007047 seconds
Executed Test_recover_unreadble_swap_file() in 0.014217 seconds
Executed Test_swap_file() in 0.809606 seconds�[m�
Executed 12 tests in 2.082277 seconds�[m�
1 FAILED:
Found errors in Test_recover_corrupted_swap_file():
command line..script /home/abuild/rpmbuild/BUILD/vim-8.2.3075/src/testdir/runtest.vim[473]..function RunTheTest[44]..Test_recover_corrupted_swap_file line 69: Expected ['???LINES MISSING'] but got ['???MANY LINES MISSING']
command line..script /home/abuild/rpmbuild/BUILD/vim-8.2.3075/src/testdir/runtest.vim[473]..function RunTheTest[44]..Test_recover_corrupted_swap_file line 95: command did not fail: recover Xfile1
command line..script /home/abuild/rpmbuild/BUILD/vim-8.2.3075/src/testdir/runtest.vim[473]..function RunTheTest[44]..Test_recover_corrupted_swap_file line 97: Expected ['???'] but got ['']
Environment (please complete the following information):
Additional context
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.![]()
I do not have a 32 bit Unix system to try this on. Perhaps you can check the code that's added using "little_endian" and add something similar for 32 bit systems?
I think patch 2981 is the cause of this problem ...
in my builds, 2980 and older run tests without problems, after including 2981 fails in this test
@brammool wrote:
I do not have a 32 bit Unix system to try this on.
For information, I can build for 32-bits x86 on Ubuntu-18.04.05 x86_64 by adding -m32 in CFLAGS and LDFLAGS and by configuring without a few libs (canberra, sodium and acl) for which I do not have 32 bits versions (maybe those libs have 32-bits package, I did not bother checking, I disabled them instead):
$ cd vim/src
$ git diff Makefile
diff --git a/src/Makefile b/src/Makefile
index 0efee5195..53fe66b5d 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -619,7 +619,8 @@ CClink = $(CC)
# Add -Wpedantic to find // comments and other C99 constructs.
# Better disable Perl and Python to avoid a lot of warnings.
#CFLAGS = -g -Wall -Wextra -Wshadow -Wmissing-prototypes -Wpedantic -Wunreachable-code -Wunused-result -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
-#CFLAGS = -g -O2 -Wall -Wextra -Wshadow -Wmissing-prototypes -Wpedantic -Wunreachable-code -Wno-cast-function-type -Wunused-result -Wno-deprecated-declarations -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
+CFLAGS = -g -m32 -O2 -Wall -Wextra -Wshadow -Wmissing-prototypes -Wpedantic -Wunreachable-code -Wno-cast-function-type -Wunused-result -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
+LDFLAGS = -m32
#PYTHON_CFLAGS_EXTRA = -Wno-missing-field-initializers
#MZSCHEME_CFLAGS_EXTRA = -Wno-unreachable-code -Wno-unused-parameter
$ ./configure
CC=gcc ./configure --with-features=huge --enable-gui=none --disable-canberra --disable-libsodium --disable-acl
$ make -j9
$ make test
...snip...
$ Executed: 4072 Tests
Skipped: 66 Tests
FAILED: 1 Tests
Failures:
From test_recover.vim:
Found errors in Test_recover_corrupted_swap_file():
command line..script /home/pel/sb/vim/src/testdir/runtest.vim[473]..function RunTheTest[44]..Test_recover_corrupted_swap_file line 69: Expected ['???LINES MISSING'] but got ['???MANY LINES MISSING']
command line..script /home/pel/sb/vim/src/testdir/runtest.vim[473]..function RunTheTest[44]..Test_recover_corrupted_swap_file line 95: command did not fail: recover Xfile1
command line..script /home/pel/sb/vim/src/testdir/runtest.vim[473]..function RunTheTest[44]..Test_recover_corrupted_swap_file line 97: Expected ['???'] but got ['']
TEST FAILURE
Makefile:43: recipe for target 'report' failed
make: *** [report] Error 1
So I can at least reproduce the issue.
I don't have time to look at it further, but I can look further this coming weekend.
Ondřej Súkup wrote:
> I think patch 2981 is the cause of this problem ...
>
> in my builds, 2980 and older run tests without problems, after
> including 2981 fails in this test
That makes sense, it added the little-endian check. So the solution is
probably to disable little-endian when detecting a 32 bit system.
Not sure how to reliable do that. Or the test for little endian should
check with "!=" instead of "==", instead of:
let little_endian = b[1008:1015] == 0z33323130.00000000
use:
let little_endian = b[1008:1015] != (big-endian value)