From: majianpeng <majianpeng@gmail.com>
To: Jens Axboe <JAxboe@fusionio.com>
Cc: fio <fio@vger.kernel.org>
Subject: Re: [PATCH] Add a check avoid segfault.
Date: Thu, 10 Jan 2013 17:39:29 -0700 [thread overview]
Message-ID: <201301110839272022792@gmail.com> (raw)
In-Reply-To: 50EEB1B0.9050007@fusionio.com
>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?
Jianpeng
Thanks!
next prev parent reply other threads:[~2013-01-11 0:39 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 [this message]
2013-01-11 6:55 ` Jens Axboe
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=201301110839272022792@gmail.com \
--to=majianpeng@gmail.com \
--cc=JAxboe@fusionio.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.