threads / discuss / 51030

not ok 41 - test ident field is working

Subject: not ok 41 - test ident field is working

## tl;dr

2 messages between May 3, 2019 and May 3, 2019.

replies: 1people: 2as markdown or json

Jeffrey Walton· May 3, 2019, 20:18 UTC · lore
Hi Everyone,

I'm catching one failed self test under a sanitizer build. It looks like there's some latent UB present during 'make check'

ok 39 - using --untracked-cache does not fail when core.untrackedCache is false ok 40 - setting core.untrackedCache to keep not ok 41 - test ident field is working # # mkdir ../other_worktree && # cp -R done dthree dtwo four three ../other_worktree && # GIT_WORK_TREE=../other_worktree git status 2>../err && # echo "warning: untracked cache is disabled on this system or location" >../expect && # test_i18ncmp ../expect ../err # ok 42 - untracked cache survives a checkout ok 43 - untracked cache survives a commit

I found one file called 'err' and it has:
$ cat "./t/trash directory.t7063-status-untracked-cache/err"
read-cache.c:1943:22: runtime error: load of misaligned address 0x7fba278d61ab f
or type 'unsigned int', which requires 4 byte alignment
0x7fba278d61ab: note: pointer points here
 55  4e 54 52 00 00 02 9b 76  4c 6f 63 61 74 69 6f 6e  20 2f 68 6f 6d 65 2f 6a
77 61 6c 74 6f 6e 2f
              ^
dir.c:2860:18: runtime error: load of misaligned address 0x7fba278d626e for type
 'unsigned int', which requires 4 byte alignment
0x7fba278d626e: note: pointer points here
 00 00 00 00 00 00  00 06 13 26 3c 09 78 fb  9f ad 16 b2 d5 80 fb 80  0b 6d 81 1
c 3f f0 00 00  00 00
             ^
ewah/ewah_io.c:97:19: runtime error: load of misaligned address 0x7fba278d62f5 f
or type 'unsigned int', which requires 4 byte alignment
0x7fba278d62f5: note: pointer points here
 74 77 6f 00 00 00 00  06 00 00 00 02 00 00 00  02 00 00 00 00 00 00 00  00 00 0
0 00 3f 00 00 00  00
             ^
ewah/ewah_io.c:103:41: runtime error: load of misaligned address 0x7fba278d62f9
for type 'unsigned int', which requires 4 byte alignment
0x7fba278d62f9: note: pointer points here
 00 00 00  06 00 00 00 02 00 00 00  02 00 00 00 00 00 00 00  00 00 00 00 3f 00 0
0 00  00 00 00 00 06
              ^
ewah/ewah_io.c:129:29: runtime error: load of misaligned address 0x7fba278d630d
for type 'unsigned int', which requires 4 byte alignment
0x7fba278d630d: note: pointer points here
 00 00 00 3f 00 00 00  00 00 00 00 06 00 00 00  02 00 00 00 02 00 00 00  00 00 0
0 00 00 00 00 00  3c
             ^
warning: untracked cache is disabled on this system or location
Jeff
Jeff King· May 3, 2019, 20:50 UTC · re: Jeffrey Walton · lore

Re: not ok 41 - test ident field is working

On Fri, May 03, 2019 at 04:18:02PM -0400, Jeffrey Walton wrote:
> I'm catching one failed self test under a sanitizer build. It looks
> like there's some latent UB present during 'make check'

How are you providing sanitizer options? If you're just putting -fsanitize=undefined in the compiler flags, that is known to fail. For example, on some platforms we'll default to unaligned loads when it's faster and well-defined on that platform.

And that's what you're seeing here:
> read-cache.c:1943:22: runtime error: load of misaligned address 0x7fba278d61ab f
> or type 'unsigned int', which requires 4 byte alignment
since this is a get_be32() call.

You can can add -DNO_UNALIGNED_LOADS to fix this. However, we have some Makefile logic for doing this already, and:

  make SANITIZE=undefined test
should work. My normal test for memory problems is:
  make SANITIZE=address,undefined test
-Peff

← back to recent threads