I noticed that the zlibCompressionTest loops endlessly in case r is set to 0x3dd0def3 in the randData method of the CompressionTest class.
In this case the decompress method of the CompressionTest class does not get a Z_STREAM_END (=1) from the inflate function (Source/zlib/INFBLOCK.C).
I run scons test-code (as described below) on subversion revision 6782 with the following change of Source/Tests/compression.cpp.
Index: Source/Tests/compression.cpp =================================================================== --- Source/Tests/compression.cpp (revision 6782) +++ Source/Tests/compression.cpp (working copy) @@ -18,7 +18,7 @@ srand(time(0)); for (int i = 0; i < kb; i++) { - int r = rand(); + int r = 0x3dd0def3 /* rand() */; for (size_t j = 0; j < 1024/sizeof(int); j++) { buf.add(&r, sizeof(int)); }
scons UNICODE=yes SKIPUTILS=zip2exe test-code
That might explain why drone.io builds sometimes hang on that step. Do you have any idea why this is happening?
I enabled the traces in the INFBLOCK.C source file and set a break point at the inflate_flush function.
Only the following trace was received:
For each iteration the inflate function returned Z_OK via the macro NEEDBITS (->NEEDBYTE->LEAVE(Z_OK)->UPDATE->inflate_flush->return Z_OK) in line 596.
I have not been able to figure out what the exact pattern is but it has something to do with setting the top bit in a byte, possibly just the low byte.