Last active
December 18, 2015 08:49
-
-
Save ncanceill/5756997 to your computer and use it in GitHub Desktop.
A bug report for 3 distinct bugs linked to small blocksize in frag_find
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
FF=frag_find | |
#FF=./frag_find/src/frag_find | |
TMP=/tmp | |
#TMP=. | |
dd if=/dev/zero of=$TMP/zero_block_512 bs=512 count=1 | |
dd if=/dev/zero of=$TMP/zero_block_1k bs=512 count=2 | |
dd if=/dev/zero of=$TMP/zero_block_256 bs=256 count=1 | |
$FF $TMP/zero_block_1k $TMP/zero_block_512 | |
#Works as expected | |
# | |
# Bug #1 | |
$FF -b 256 $TMP/zero_block_1k $TMP/zero_block_512 | |
#Uses blocksize 512 for master and report; does not find | |
# | |
# Bug #2 | |
$FF -b 256 $TMP/zero_block_1k $TMP/zero_block_256 | |
#Segmentation fault | |
# | |
# Bug #3 | |
$FF -b 256 $TMP/zero_block_1k $TMP/zero_block_512 | |
#Only prints image blocks 0-1, although 2-3 also match | |
# | |
# Clean | |
rm $TMP/zero_block_* |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How two reproduce three bugs about small
blocksize
infrag_find
This gist presents simple ways to reproduce 2 distinct bugs in
frag_find
, both related to the globalblocksize
variable.The first command works as expected:
blocksize
defaults to 512, and the two blocks composing the image file are found.Bug 1
Report mentions using custom block size can lead to inconsistent results.
The same command with
blocksize
256 does not find any of the four blocks composing the image file. Besides, as output shows, although image file parsing uses the customblocksize
, master file parsing and report printing both seem to be using defaultblocksize
.Bug 2
Report mentions using custom block size combined with a 1-block long (or less) master file can lead to program crash.
The second command with
blocksize
256 demonstrates that behavior.Bug 3
Report mentions using custom block size combined with a 2-block long (or more) master file can lead to incomplete filemap printing.
The third command with
blocksize
256 demonstrates that behavior.