tr/xdiff-fast-hash generates warnings and breaks tests

3 messages, 2 authors, 2016-06-15 · open the first message on its own page

tr/xdiff-fast-hash generates warnings and breaks tests

From: Øyvind A. Holm <hidden>
Date: 2016-06-15 22:53:50

On Debian GNU/Linux 6.0.5 (squeeze), the two commits on the
tr/xdiff-fast-hash branch introduces compiler warnings and breaks
t/t0020-crlf.sh and maybe later tests:

6942efc (xdiff: load full words in the inner loop of xdl_hash_record)
  Introduces these compiler warnings (formatted for readability):

  [...]
      CC xdiff/xprepare.o
      CC xdiff/xutils.o
  xdiff/xutils.c: In function `has_zero':
  xdiff/xutils.c:290: warning: integer constant is too large for
                      `unsigned long' type
  xdiff/xutils.c:290: warning: integer constant is too large for
                      `unsigned long' type
  xdiff/xutils.c: In function `xdl_hash_record':
  xdiff/xutils.c:345: warning: integer constant is too large for
                      `unsigned long' type
  xdiff/xutils.c:361: warning: integer constant is too large for
                      `unsigned long' type
      CC xdiff/xemit.o
      CC xdiff/xmerge.o
  [...]

6f1af02 (xdiff: choose XDL_FAST_HASH code on sizeof(long) instead of
        __WORDSIZE)

  Breaks these tests in t/t0020-crlf.sh :

  not ok - 12 apply patch (autocrlf=input)
  not ok - 13 apply patch --cached (autocrlf=input)
  not ok - 14 apply patch --index (autocrlf=input)
  not ok - 15 apply patch (autocrlf=true)
  not ok - 16 apply patch --cached (autocrlf=true)
  not ok - 17 apply patch --index (autocrlf=true)
  # failed 6 among 34 test(s)

Some later tests might also fail, haven't tested that.

Reverting those two commits on current master (6a4a482) fixes both
problems. Tried building on two other systems (Ubuntu 10.04.4 LTS and
Ubuntu 10.10), and these problems don't appear there. Some info:

  $ lsb_release -a
    No LSB modules are available.
    Distributor ID: Debian
    Description:    Debian GNU/Linux 6.0.5 (squeeze)
    Release:        6.0.5
    Codename:       squeeze

  $ gcc --version
    gcc (Debian 4.4.5-8) 4.4.5

  $ ldd --version
    ldd (Debian EGLIBC 2.11.3-3) 2.11.3

  $ uname -a
    Linux shell 2.6.32-5-amd64 #1 SMP Mon Jan 16 17:15:00 UTC 2012
    x86_64 GNU/Linux

  First part of /proc/cpuinfo:
    processor       : 0
    vendor_id       : GenuineIntel
    cpu family      : 6
    model           : 23
    model name      : Intel(R) Xeon(R) CPU           X3350  @ 2.66GHz
    stepping        : 7
    cpu MHz         : 2666.649
    cache size      : 6144 KB
    physical id     : 0
    siblings        : 4
    core id         : 0
    cpu cores       : 4
    apicid          : 0
    initial apicid  : 0
    fpu             : yes
    fpu_exception   : yes
    cpuid level     : 10
    wp              : yes
    flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr
                      pge mca cmov pat pse36 clflush dts acpi mmx fxsr
                      sse sse2 ss ht tm pbe syscall nx lm constant_tsc
                      arch_perfmon pebs bts rep_good aperfmperf pni
                      dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16
                      xtpr pdcm sse4_1 lahf_lm tpr_shadow vnmi
                      flexpriority
    bogomips        : 5333.29
    clflush size    : 64
    cache_alignment : 64
    address sizes   : 36 bits physical, 48 bits virtual
    power management:

Cheers,
Øyvind

Re: tr/xdiff-fast-hash generates warnings and breaks tests

From: René Scharfe <hidden>
Date: 2016-06-15 22:53:50

Am 17.05.2012 01:31, schrieb Øyvind A. Holm:
On Debian GNU/Linux 6.0.5 (squeeze), the two commits on the
tr/xdiff-fast-hash branch introduces compiler warnings and breaks
t/t0020-crlf.sh and maybe later tests:
What does the following short C program report when run (e.g. put it in 
a file named s.c, then run "gcc -o s s.c" and "./s")?

   #include <stdio.h>
   int main(int argc, const char **argv) {
     printf("%u %u %u\n", sizeof(int), sizeof(long), sizeof(void *));
     return 0;
   }

I suspect you run a 32-bit userland on a 64-bit kernel.

On Ubuntu 12.04 x86, t0020 fails for me as well when I compile with 
XDL_FAST_HASH explicitly set (it's off by default).  It succeeds after 
reverting 6f1af02, though, strangely enough.  No compiler warnings are 
printed in either case.

   $ gcc --version
   gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3

   $ uname -a
   Linux ubuntu 3.2.0-24-generic #37-Ubuntu SMP Wed Apr 25 08:43:52 UTC 
2012 i686 i686 i386 GNU/Linux

Also, here are the measurements for master (v1.7.10.2-520-g6a4a482) 
without XDL_FAST_HASH, and with master minus 6f1af02 plus explicitly set 
XDL_FAST_HASH:

   Test                                 master           reverted+FAST
   ---------------------------------------------------------------------
   4000.1: log -3000 (baseline)         0.08(0.05+0.02)  0.08(0.05+0.02)
   4000.2: log --raw -3000 (tree-only)  0.39(0.34+0.04)  0.39(0.32+0.06)
   4000.3: log -p -3000 (Myers)         1.55(1.43+0.11)  1.43(1.29+0.12)
   4000.4: log -p -3000 --histogram     1.63(1.51+0.10)  1.50(1.35+0.14)
   4000.5: log -p -3000 --patience      1.85(1.71+0.13)  1.73(1.62+0.10)

René

Re: tr/xdiff-fast-hash generates warnings and breaks tests

From: Øyvind A. Holm <hidden>
Date: 2016-06-15 22:53:50

On 17 May 2012 09:11, René Scharfe [off-list ref] wrote:
Am 17.05.2012 01:31, schrieb Øyvind A. Holm:
quoted
On Debian GNU/Linux 6.0.5 (squeeze), the two commits on the
tr/xdiff-fast-hash branch introduces compiler warnings and breaks
t/t0020-crlf.sh and maybe later tests:
What does the following short C program report when run (e.g. put it
in a file named s.c, then run "gcc -o s s.c" and "./s")?

 #include <stdio.h>
 int main(int argc, const char **argv) {
   printf("%u %u %u\n", sizeof(int), sizeof(long), sizeof(void *));
   return 0;
 }
The result is "4 4 4".
I suspect you run a 32-bit userland on a 64-bit kernel.
Yes, it looks like that to me, too. FYI, this isn't my computer, but a
login shell at a webhosting provider, so I don't know the exact details
about the installation.

Cheers,
Øyvind
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help