omgovich / colord

👑 A tiny yet powerful tool for high-performance color manipulations and conversions
https://colord.omgovich.ru
MIT License
1.63k stars 48 forks source link

ICC vary from CPU-type #122

Open bmwiedemann opened 7 months ago

bmwiedemann commented 7 months ago

While working on reproducible builds for openSUSE, I found that our colord 1.4.6 build output varied depending on the CPU model.

I collected sets from these runs: https://rb.zq1.de/other/colord-cpu-dependent-output.tar.gz

The 2 one was built on an avx-enabled CPU and the 1 one on a kvm64 model without fancy new instructions.

Such diffs can happen when memcpy or strcpy is used on overlapping memory regions. In that case, one of these result files would contain data corruptions.

bmwiedemann commented 7 months ago

Reproducer

# on old CPU:
cd /home/abuild/rpmbuild/BUILD/colord-1.4.6/x86_64-suse-linux && client/cd-create-profile --output=data/profiles/FOGRA28L_webcoated.icc data/profiles/FOGRA28L_webcoated.iccprofile.xml && md5sum data/profiles/FOGRA28L_webcoated.icc data/profiles/FOGRA28L_webcoated.iccprofile.xml
307d9fb02f1c53d31fb0edc790536b89  data/profiles/FOGRA28L_webcoated.icc
4afa623cc7b59915edec432c87b732b0  data/profiles/FOGRA28L_webcoated.iccprofile.xml

# on new CPU
cd /home/abuild/rpmbuild/BUILD/colord-1.4.6/x86_64-suse-linux && client/cd-create-profile --output=data/profiles/FOGRA28L_webcoated.icc data/profiles/FOGRA28L_webcoated.iccprofile.xml && md5sum data/profiles/FOGRA28L_webcoated.icc data/profiles/FOGRA28L_webcoated.iccprofile.xml
0a20906f8db699cc17b166729570a26c  data/profiles/FOGRA28L_webcoated.icc
4afa623cc7b59915edec432c87b732b0  data/profiles/FOGRA28L_webcoated.iccprofile.xml

both of these are stable, so there is no other randomness involved.