Flexible I/O Tester development
 help / color / mirror / Atom feed
From: Jens Axboe <jaxboe@fusionio.com>
To: majianpeng <majianpeng@gmail.com>
Cc: fio <fio@vger.kernel.org>
Subject: Re: [PATCH] Add a check avoid segfault.
Date: Fri, 11 Jan 2013 07:55:57 +0100	[thread overview]
Message-ID: <50EFB77D.7090102@fusionio.com> (raw)
In-Reply-To: <201301110839272022792@gmail.com>

On 2013-01-11 01:39, majianpeng wrote:
> 
>> On 2013-01-10 12:36, majianpeng wrote:
>>> If new_size was zero or realloc failed, it would be segment fault.
>>> So add a check.
>>
>> It's a drop in the bucket, fio basically does not alloc failure
>> checking. It'd be nice to improve on that, but you'd need a lot more
>> than the below to get near fixing that.
>>
>> -- 
>> Jens Axboe
>>
> yes, why did i sent this patch?Because i set nrfiles=-1,fio would be segfault.
> I viewed the code about judging nrfiles, the code did not check this condition.
> Anthor case can cause this bug if nrfiles=0xffffffff.
> 
> There are many parameters like nrfiles.So they should do same check.
> Maybe add those check is better rather than check alloc fail or success?

OK, you should have mentioned that. Segfaults that are easily caused by
invalid parameters being specified should of course be fixed.

-- 
Jens Axboe


      reply	other threads:[~2013-01-11  6:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-10 11:36 [PATCH] Add a check avoid segfault majianpeng
2013-01-10 12:18 ` Jens Axboe
2013-01-11  0:39   ` majianpeng
2013-01-11  6:55     ` Jens Axboe [this message]

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=50EFB77D.7090102@fusionio.com \
    --to=jaxboe@fusionio.com \
    --cc=fio@vger.kernel.org \
    --cc=majianpeng@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox