`tiffcp` output changes per run (even the size). MemorySanitizer: use-of-uninitialized-value in libtiff/tif_packbits.c:86
Summary
For the given input, tiffcp
would emit different results per run.
MemorySanitizer reports:
==3156679==WARNING: MemorySanitizer: use-of-uninitialized-value
#0 0x6d1c34 in PackBitsEncode /libtiff/repo/clang13-mem-O0/libtiff/tif_packbits.c:86:3
#1 0x6d3cd4 in PackBitsEncodeChunk /libtiff/repo/clang13-mem-O0/libtiff/tif_packbits.c:205:7
#2 0x5d96c1 in TIFFWriteEncodedTile /libtiff/repo/clang13-mem-O0/libtiff/tif_write.c:481:10
#3 0x5d7477 in TIFFWriteTile /libtiff/repo/clang13-mem-O0/libtiff/tif_write.c:373:10
#4 0x4b0784 in writeBufferToContigTiles /libtiff/repo/clang13-mem-O0/tools/tiffcp.c:1737:8
#5 0x4af5c7 in cpImage /libtiff/repo/clang13-mem-O0/tools/tiffcp.c:1420:14
#6 0x4a8f03 in cpContigStrips2ContigTiles /libtiff/repo/clang13-mem-O0/tools/tiffcp.c:1835:9
#7 0x4a443b in tiffcp /libtiff/repo/clang13-mem-O0/tools/tiffcp.c:979:15
#8 0x49d6bc in main /libtiff/repo/clang13-mem-O0/tools/tiffcp.c:334:9
#9 0x7fa1472a30b2 in __libc_start_main /build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:308:16
#10 0x41d6bd in _start (/shared/targets/libtiff/repo/clang13-mem-O0/tools/tiffcp+0x41d6bd)
SUMMARY: MemorySanitizer: use-of-uninitialized-value /libtiff/repo/clang13-mem-O0/libtiff/tif_packbits.c:86:3 in PackBitsEncode
Version
libtiff 4.3.0 (commit 4002ca1c)
Steps to reproduce
- Run
tiffcp -i -c packbits issue- tmp.out
a few times and you'll observe that the content oftmp.out
is changing. - Compile with
-fsanitize=memory
if you wish to see MemorySanitizer report. - issue-375
Platform
Ubuntu 20.04.4 LTS, x86_64