Skip to content

Instantly share code, notes, and snippets.

@lucaswiman
Created February 11, 2016 07:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lucaswiman/f2f993c9a50f053aed25 to your computer and use it in GitHub Desktop.
Save lucaswiman/f2f993c9a50f053aed25 to your computer and use it in GitHub Desktop.
Output from diagnosing a race condition

This gist contains the output from validating that this commit: actually fixes the race condition manifested in the unpatched.output file. See the commit message for more information.

The outputs were generated using the following bash commands:

(for i in `seq 1 10`;
do
    java -jar /tmp/bad-jar.jar text1.png text1-symlink.png --multi
done) > /tmp/unpatched.output

(for i in `seq 1 10`;
do
    java -jar target/javase-3.2.2-SNAPSHOT-jar-with-dependencies.jar text1.png text1-symlink.png --multi
done) > /tmp/patched.output

Here bad-jar.jar was generated with a fresh compilation of zxing commit 1fbefcac3146bf61efadb2d5da428b0f559d630c, and both jar files were generated using the following commands:

mvn package -DskipTests
cd javase
mvn -DskipTests package assembly:single

text1.png was generated on https://www.the-qrcode-generator.com/ and is a QR code encoding "text1". text1-symlink.png is a symlink to text1.png. System information:

  • OS X El Capitan 10.11.2
  • Java version:
$ java -version
java version "1.7.0_65"
Java(TM) SE Runtime Environment (build 1.7.0_65-b17)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)
file:///Users/lucaswiman/opensource/zxing/javase/text1.png (format: QR_CODE, type: TEXT):
Raw result:
text1
Parsed result:
text1
Found 3 result points.
Point 0: (44.0,156.0)
Point 1: (44.0,44.0)
Point 2: (156.0,44.0)
file:///Users/lucaswiman/opensource/zxing/javase/text1-symlink.png (format: QR_CODE, type: TEXT):
Raw result:
text1
Parsed result:
text1
Found 3 result points.
Point 0: (44.0,156.0)
Point 1: (44.0,44.0)
Point 2: (156.0,44.0)
Decoded 2 files out of 2 successfully (100%)
file:///Users/lucaswiman/opensource/zxing/javase/text1-symlink.png (format: QR_CODE, type: TEXT):
Raw result:
text1
Parsed result:
text1
Found 3 result points.
Point 0: (44.0,156.0)
Point 1: (44.0,44.0)
Point 2: (156.0,44.0)
file:///Users/lucaswiman/opensource/zxing/javase/text1.png (format: QR_CODE, type: TEXT):
Raw result:
text1
Parsed result:
text1
Found 3 result points.
Point 0: (44.0,156.0)
Point 1: (44.0,44.0)
Point 2: (156.0,44.0)
Decoded 2 files out of 2 successfully (100%)
file:///Users/lucaswiman/opensource/zxing/javase/text1.png (format: QR_CODE, type: TEXT):
Raw result:
text1
Parsed result:
text1
Found 3 result points.
Point 0: (44.0,156.0)
Point 1: (44.0,44.0)
Point 2: (156.0,44.0)
file:///Users/lucaswiman/opensource/zxing/javase/text1-symlink.png (format: QR_CODE, type: TEXT):
Raw result:
text1
Parsed result:
text1
Found 3 result points.
Point 0: (44.0,156.0)
Point 1: (44.0,44.0)
Point 2: (156.0,44.0)
Decoded 2 files out of 2 successfully (100%)
file:///Users/lucaswiman/opensource/zxing/javase/text1-symlink.png (format: QR_CODE, type: TEXT):
Raw result:
text1
Parsed result:
text1
Found 3 result points.
Point 0: (44.0,156.0)
Point 1: (44.0,44.0)
Point 2: (156.0,44.0)
file:///Users/lucaswiman/opensource/zxing/javase/text1.png (format: QR_CODE, type: TEXT):
Raw result:
text1
Parsed result:
text1
Found 3 result points.
Point 0: (44.0,156.0)
Point 1: (44.0,44.0)
Point 2: (156.0,44.0)
Decoded 2 files out of 2 successfully (100%)
file:///Users/lucaswiman/opensource/zxing/javase/text1-symlink.png (format: QR_CODE, type: TEXT):
Raw result:
text1
Parsed result:
text1
Found 3 result points.
Point 0: (44.0,156.0)
Point 1: (44.0,44.0)
Point 2: (156.0,44.0)
file:///Users/lucaswiman/opensource/zxing/javase/text1.png (format: QR_CODE, type: TEXT):
Raw result:
text1
Parsed result:
text1
Found 3 result points.
Point 0: (44.0,156.0)
Point 1: (44.0,44.0)
Point 2: (156.0,44.0)
Decoded 2 files out of 2 successfully (100%)
file:///Users/lucaswiman/opensource/zxing/javase/text1-symlink.png (format: QR_CODE, type: TEXT):
Raw result:
text1
Parsed result:
text1
Found 3 result points.
Point 0: (44.0,156.0)
Point 1: (44.0,44.0)
Point 2: (156.0,44.0)
file:///Users/lucaswiman/opensource/zxing/javase/text1.png (format: QR_CODE, type: TEXT):
Raw result:
text1
Parsed result:
text1
Found 3 result points.
Point 0: (44.0,156.0)
Point 1: (44.0,44.0)
Point 2: (156.0,44.0)
Decoded 2 files out of 2 successfully (100%)
file:///Users/lucaswiman/opensource/zxing/javase/text1-symlink.png (format: QR_CODE, type: TEXT):
Raw result:
text1
Parsed result:
text1
Found 3 result points.
Point 0: (44.0,156.0)
Point 1: (44.0,44.0)
Point 2: (156.0,44.0)
file:///Users/lucaswiman/opensource/zxing/javase/text1.png (format: QR_CODE, type: TEXT):
Raw result:
text1
Parsed result:
text1
Found 3 result points.
Point 0: (44.0,156.0)
Point 1: (44.0,44.0)
Point 2: (156.0,44.0)
Decoded 2 files out of 2 successfully (100%)
file:///Users/lucaswiman/opensource/zxing/javase/text1-symlink.png (format: QR_CODE, type: TEXT):
Raw result:
text1
Parsed result:
text1
Found 3 result points.
Point 0: (44.0,156.0)
Point 1: (44.0,44.0)
Point 2: (156.0,44.0)
file:///Users/lucaswiman/opensource/zxing/javase/text1.png (format: QR_CODE, type: TEXT):
Raw result:
text1
Parsed result:
text1
Found 3 result points.
Point 0: (44.0,156.0)
Point 1: (44.0,44.0)
Point 2: (156.0,44.0)
Decoded 2 files out of 2 successfully (100%)
file:///Users/lucaswiman/opensource/zxing/javase/text1.png (format: QR_CODE, type: TEXT):
Raw result:
text1
Parsed result:
text1
Found 3 result points.
Point 0: (44.0,156.0)
Point 1: (44.0,44.0)
Point 2: (156.0,44.0)
file:///Users/lucaswiman/opensource/zxing/javase/text1-symlink.png (format: QR_CODE, type: TEXT):
Raw result:
text1
Parsed result:
text1
Found 3 result points.
Point 0: (44.0,156.0)
Point 1: (44.0,44.0)
Point 2: (156.0,44.0)
Decoded 2 files out of 2 successfully (100%)
file:///Users/lucaswiman/opensource/zxing/javase/text1-symlink.png (format: QR_CODE, type: TEXT):
Raw result:
text1
Parsed result:
text1
Found 3 result points.
Point 0: (44.0,156.0)
Point 1: (44.0,44.0)
Point 2: (156.0,44.0)
file:///Users/lucaswiman/opensource/zxing/javase/text1.png (format: QR_CODE, type: TEXT):
Raw result:
text1
Parsed result:
text1
Found 3 result points.
Point 0: (44.0,156.0)
Point 1: (44.0,44.0)
Point 2: (156.0,44.0)
Decoded 2 files out of 2 successfully (100%)
file:///Users/lucaswiman/opensource/zxing/javase/text1.png (format: QR_CODE, type: TEXT):
Raw result:
text1
Parsed result:
text1
Found 3 result points.
Point 0: (44.0,156.0)
Point 1: (44.0,44.0)
Point 2: (156.0,44.0)
file:///Users/lucaswiman/opensource/zxing/javase/text1-symlink.png (format: QR_CODE, type: TEXT):
Raw result:
text1
Parsed result:
text1
Found 3 result points.
Point 0: (44.0,156.0)
Point 1: (44.0,44.0)
Point 2: (156.0,44.0)
Decoded 2 files out of 2 successfully (100%)
file:///Users/lucaswiman/opensource/zxing/javase/text1.png (format: QR_CODE, type: TEXT):
Raw result:
text1
Parsed result:
text1
Found 3 result points.
Point 0: (44.0,156.0)
Point 1: (44.0,44.0)
Point 2: (156.0,44.0)
file:///Users/lucaswiman/opensource/zxing/javase/text1-symlink.png (format: QR_CODE, type: TEXT):
Raw result:
text1
Parsed result:
text1
Found 3 result points.
Point 0: (44.0,156.0)
Point 1: (44.0,44.0)
Point 2: (156.0,44.0)
Decoded 2 files out of 2 successfully (100%)
file:///Users/lucaswiman/opensource/zxing/javase/text1.png (format: QR_CODE, type: TEXT):
Raw result:
text1
Parsed result:
text1
Found 3 result points.
Point 0: (44.0,156.0)
Point 1: (44.0,44.0)
Point 2: (156.0,44.0)
file:///Users/lucaswiman/opensource/zxing/javase/text1-symlink.png (format: QR_CODE, type: TEXT):
Raw result:
text1
Parsed result:
text1
Found 3 result points.
Point 0: (44.0,156.0)
Point 1: (44.0,44.0)
Point 2: (156.0,44.0)
Decoded 2 files out of 2 successfully (100%)
file:///Users/lucaswiman/opensource/zxing/javase/text1-symlink.png (format: QR_CODE, type: TEXT):
Raw result:
text1
Parsed result:
text1
Found 3 result points.
Point 0: (44.0,156.0)
Point 1: (44.0,44.0)
Point 2: (156.0,44.0)
file:///Users/lucaswiman/opensource/zxing/javase/text1.png (format: QR_CODE, type: TEXT):
Raw result:
text1
Parsed result:
text1
Found 3 result points.
Point 0: (44.0,156.0)
Point 1: (44.0,44.0)
Point 2: (156.0,44.0)
Decoded 2 files out of 2 successfully (100%)
file:///Users/lucaswiman/opensource/zxing/javase/text1.png (format: QR_CODE, type: TEXT):
Raw result:
text1
Parsed result:
text1
Found 3 result points.
Point 0: (44.0,156.0)
file:///Users/lucaswiman/opensource/zxing/javase/text1-symlink.png (format: QR_CODE, type: TEXT):
Raw result:
text1
Parsed result:
text1
Point 1: (44.0,44.0)
Found 3 result points.
Point 2: (156.0,44.0)
Point 0: (44.0,156.0)
Point 1: (44.0,44.0)
Point 2: (156.0,44.0)
Decoded 2 files out of 2 successfully (100%)
file:///Users/lucaswiman/opensource/zxing/javase/text1-symlink.png (format: QR_CODE, type: TEXT):
Raw result:
text1
Parsed result:
text1
file:///Users/lucaswiman/opensource/zxing/javase/text1.png (format: QR_CODE, type: TEXT):
Raw result:
text1
Parsed result:
text1
Found 3 result points.
Found 3 result points.
Point 0: (44.0,156.0)
Point 0: (44.0,156.0)
Point 1: (44.0,44.0)
Point 1: (44.0,44.0)
Point 2: (156.0,44.0)
Point 2: (156.0,44.0)
Decoded 2 files out of 2 successfully (100%)
file:///Users/lucaswiman/opensource/zxing/javase/text1-symlink.png (format: QR_CODE, type: TEXT):
Raw result:
text1
Parsed result:
text1
Found 3 result points.
Point 0: (44.0,156.0)
Point 1: (44.0,44.0)
Point 2: (156.0,44.0)
file:///Users/lucaswiman/opensource/zxing/javase/text1.png (format: QR_CODE, type: TEXT):
Raw result:
text1
Parsed result:
text1
Found 3 result points.
Point 0: (44.0,156.0)
Point 1: (44.0,44.0)
Point 2: (156.0,44.0)
Decoded 2 files out of 2 successfully (100%)
file:///Users/lucaswiman/opensource/zxing/javase/text1.png (format: QR_CODE, type: TEXT):
Raw result:
text1
Parsed result:
text1
Found 3 result points.
Point 0: (44.0,156.0)
Point 1: (44.0,44.0)
file:///Users/lucaswiman/opensource/zxing/javase/text1-symlink.png (format: QR_CODE, type: TEXT):
Raw result:
text1
Parsed result:
text1
Point 2: (156.0,44.0)
Found 3 result points.
Point 0: (44.0,156.0)
Point 1: (44.0,44.0)
Point 2: (156.0,44.0)
Decoded 2 files out of 2 successfully (100%)
file:///Users/lucaswiman/opensource/zxing/javase/text1-symlink.png (format: QR_CODE, type: TEXT):
Raw result:
text1
Parsed result:
text1
Found 3 result points.
Point 0: (44.0,156.0)
Point 1: (44.0,44.0)
Point 2: (156.0,44.0)
file:///Users/lucaswiman/opensource/zxing/javase/text1.png (format: QR_CODE, type: TEXT):
Raw result:
text1
Parsed result:
text1
Found 3 result points.
Point 0: (44.0,156.0)
Point 1: (44.0,44.0)
Point 2: (156.0,44.0)
Decoded 2 files out of 2 successfully (100%)
file:///Users/lucaswiman/opensource/zxing/javase/text1-symlink.png (format: QR_CODE, type: TEXT):
Raw result:
text1
Parsed result:
text1
Found 3 result points.
Point 0: (44.0,156.0)
Point 1: (44.0,44.0)
Point 2: (156.0,44.0)
file:///Users/lucaswiman/opensource/zxing/javase/text1.png (format: QR_CODE, type: TEXT):
Raw result:
text1
Parsed result:
text1
Found 3 result points.
Point 0: (44.0,156.0)
Point 1: (44.0,44.0)
Point 2: (156.0,44.0)
Decoded 2 files out of 2 successfully (100%)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment