...
Code Block |
---|
#! /bin/bash # # Run "java -Xshare:dump" twice. They should generate the exact same classes.jsa. # See https://bugs.openjdk.java.net/browse/JDK-8241071 # # Usage: bash compare_cds_dump.sh $JAVA_HOME # # If "xxd" is not available, use "hexdump" instead. # # "xxd -g 8" is used because most of the time we have mismatched (64-bit) pointers. # you may want to change to "-g 4", etc, if the mismatch is caused by fields # of other sizes. JAVA=$1/bin/java shift ARGS="-Xshare:dump -Xlog:cds=debug -Xmx256m" $JAVA $ARGS -XX:SharedArchiveFile=1.jsa $* | egrep " crc " | cut -b 9- | tee old1.txt cksum 1.jsa | tee -a old 1.txt xxd -e -g 8 1.jsa >> 1.txt hexdump#hexdump -C 1.jsa >> old1.txt $JAVA $ARGS -XX:SharedArchiveFile=2.jsa $* | egrep " crc " | cut -b 9- | tee new2.txt cksum 2.jsa | tee -a new 2.txt xxd -e -g 8 2.jsa >> 2.txt hexdump#hexdump -C 2.jsa >> new2.txt (set -x; diff old1.txt new2.txt | wc ) |
Example
Often time we break reproducibility by writing an unprocessed native pointer into the archive. For example, InstanceKlass::_package_entry should be set to NULL before the InstanceKlass is copied. We can disable this by:
...
Overview
Content Tools
ThemeBuilder