Flexible I/O Tester development
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Hong Zhiguo <honkiko@gmail.com>, fio@vger.kernel.org
Cc: jaxboe@fusionio.com, Hong Zhiguo <zhiguohong@tencent.com>
Subject: Re: [PATCH] fix crash: free of wrong pointer in bssplit_ddir
Date: Tue, 8 Oct 2013 08:48:14 -0600	[thread overview]
Message-ID: <52541B2E.70806@kernel.dk> (raw)
In-Reply-To: <1381215745-15813-1-git-send-email-zhiguohong@tencent.com>

On 10/08/2013 01:02 AM, Hong Zhiguo wrote:
> From: Hong Zhiguo <zhiguohong@tencent.com>
> 
> I got SIGABRT when I passed "bssplit=4k/10:64k/50:/40" to fio.
> It should be "bssplit=4k/10:64k/50:32k/40" but I missed "32k" in
> my typing. The bug turns out to be another typo just like mine:)
> 
> *** glibc detected *** /viki/lkml/fio/fio: free(): invalid pointer:
> 0x000000000071fd30 ***
> ======= Backtrace: =========
> /lib/libc.so.6(+0x78bb6)[0x7ffff700cbb6]
> /lib/libc.so.6(cfree+0x73)[0x7ffff7013483]
> /viki/lkml/fio/fio[0x42c108]
> /viki/lkml/fio/fio[0x42c475]
> /viki/lkml/fio/fio[0x429194]
> /viki/lkml/fio/fio[0x42a888]
> /viki/lkml/fio/fio(parse_option+0x101)[0x42ac47]
> /viki/lkml/fio/fio(fio_options_parse+0x95)[0x42e5b3]
> /viki/lkml/fio/fio(parse_jobs_ini+0x3ae)[0x4103ae]
> /viki/lkml/fio/fio(parse_options+0x112)[0x41198a]
> /viki/lkml/fio/fio(main+0x3b)[0x460f5b]
> /lib/libc.so.6(__libc_start_main+0xfd)[0x7ffff6fb2c4d]
> /viki/lkml/fio/fio[0x40a7c9]
> 
> Signed-off-by: Hong Zhiguo <zhiguohong@tencent.com>
> Tested-by: Hong Zhiguo <zhiguohong@tencent.com>
> ---
>  options.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/options.c b/options.c
> index a064764..4b91f52 100644
> --- a/options.c
> +++ b/options.c
> @@ -104,7 +104,7 @@ static int bssplit_ddir(struct thread_options *o, int ddir, char *str)
>  
>  		if (str_to_decimal(fname, &val, 1, o)) {
>  			log_err("fio: bssplit conversion failed\n");
> -			free(o->bssplit);
> +			free(bssplit);
>  			return 1;
>  		}

Nice catch! Thanks, applied.

-- 
Jens Axboe



      reply	other threads:[~2013-10-08 14:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-08  7:02 [PATCH] fix crash: free of wrong pointer in bssplit_ddir Hong Zhiguo
2013-10-08 14:48 ` 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=52541B2E.70806@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=fio@vger.kernel.org \
    --cc=honkiko@gmail.com \
    --cc=jaxboe@fusionio.com \
    --cc=zhiguohong@tencent.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