All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Srinivasa Chamarthy <chamarthy.raju@gmail.com>, fio@vger.kernel.org
Subject: Re: crash reports while running IO on raid0 btrfs
Date: Fri, 24 Apr 2015 10:39:41 -0600	[thread overview]
Message-ID: <553A71CD.1080505@kernel.dk> (raw)
In-Reply-To: <553A6D62.5070803@kernel.dk>

[-- Attachment #1: Type: text/plain, Size: 1412 bytes --]

On 04/24/2015 10:20 AM, Jens Axboe wrote:
> On 04/17/2015 03:13 AM, Srinivasa Chamarthy wrote:
>> Received the following crash reports:
>>
>> fio: pid=2847, got signal=6
>> Jobs: 3 (f=101), CR=1200MB/0B KB/s: [K(1),W(1),K(1),W(2),K(1)] [80.1%
>> done] [0KB/118.1MB/0KB /s] [0/1814/0 iopJobs: 3 (f=97), CR=1200MB/0B
>> KB/s: [K(1),W(1),K(1),W(2),K(1)] [80.2% done] [0KB/40312KB/0KB /s]
>> [0/583/0 iops]*** Error in `fio':
>> double free or corruption (!prev): 0x000000000114d7b0 ***
>> ======= Backtrace: =========
>> /lib64/libc.so.6(+0x730bf)[0x7fcf25c7e0bf]
>> /lib64/libc.so.6(+0x7892e)[0x7fcf25c8392e]
>> /lib64/libc.so.6(+0x79636)[0x7fcf25c84636]
>> fio(free_io_mem+0x97)[0x42c3e7]
>> fio[0x44dc73]
>> fio[0x450fd9]
>> fio(fio_backend+0xfb)[0x45144b]
>> /lib64/libc.so.6(__libc_start_main+0xf5)[0x7fcf25c2cb05]
>> fio[0x40d3ec]
>>
>> # fio -v
>> fio-2.2.7-9-g4da2
>
> I can't reproduce this. Could you try a make clean and make again?
> Sometimes fio's build system screws up when you pull in changes, some of
> the dependencies are apparently whacked.

Actually, I think I see what it is. It's because your max bs isn't a 
multiple of the min bs, and fio has a bug in where it rounds up the 
blocksize as a multiple of the min bs. So we end up rounding up to 128K, 
where the max should be 124K. This causes us to overwrite allocated 
memory, and madness ensues. Can you test this patch?

-- 
Jens Axboe


[-- Attachment #2: bs-align-down.patch --]
[-- Type: text/x-patch, Size: 409 bytes --]

diff --git a/io_u.c b/io_u.c
index ba3f7ca00fcd..50644850463f 100644
--- a/io_u.c
+++ b/io_u.c
@@ -485,7 +485,7 @@ static unsigned int __get_next_buflen(struct thread_data *td, struct io_u *io_u,
 				~(td->o.verify_interval - 1);
 
 		if (!td->o.bs_unaligned && is_power_of_2(minbs))
-			buflen = (buflen + minbs - 1) & ~(minbs - 1);
+			buflen &= ~(minbs - 1);
 
 	} while (!io_u_fits(td, io_u, buflen));
 

  reply	other threads:[~2015-04-24 16:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-17  9:13 crash reports while running IO on raid0 btrfs Srinivasa Chamarthy
2015-04-17  9:34 ` Srinivasa Chamarthy
2015-04-24 16:20 ` Jens Axboe
2015-04-24 16:39   ` Jens Axboe [this message]
2015-04-25  8:26     ` Srinivasa Chamarthy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=553A71CD.1080505@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=chamarthy.raju@gmail.com \
    --cc=fio@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.