-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
iolog: fix double free when two in-flight verified IOs overlap
When running valgrind ./fio --randseed=1 --ioengine=posixaio --thread --rw=randrw \ --random_distribution=zipf:1.4 --filename=/tmp/fiofile --io_limit=50M \ --verify=crc32c --name=verifyfree --iodepth=32 --bs=64k --size=100M valgrind reports: ==21982== Invalid read of size 4 ==21982== at 0x442DBC: io_completed (io_u.c:1835) ==21982== by 0x442DBC: ios_completed (io_u.c:1924) ==21982== by 0x442DBC: io_u_queued_complete (io_u.c:1983) ==21982== by 0x40D2A5: wait_for_completions (backend.c:455) ==21982== by 0x465041: do_io (backend.c:1003) ==21982== by 0x465041: thread_main (backend.c:1703) ==21982== by 0x576E6B9: start_thread (pthread_create.c:333) ==21982== by 0x5C8E82C: clone (clone.S:109) ==21982== Address 0x62cf7c8 is 72 bytes inside a block of size 88 free'd ==21982== at 0x4C2EDEB: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==21982== by 0x45F461: log_io_piece (iolog.c:286) [...] When __ipo is still in-flight we can't free it when it overlaps because it will be used at I/O completion time so add it to an orphan ipo list which is freed when the job finishes. Fixes axboe#336 . Signed-off-by: Sitsofe Wheeler <sitsofe@yahoo.com>
- Loading branch information
Showing
5 changed files
with
33 additions
and
8 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -187,6 +187,7 @@ enum { | |
IP_F_ONLIST = 2, | ||
IP_F_TRIMMED = 4, | ||
IP_F_IN_FLIGHT = 8, | ||
IP_F_UNLOGGED = 16, | ||
}; | ||
|
||
/* | ||
|
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