From: Jens Axboe Date: Tue, 29 Mar 2016 14:28:56 +0000 (-0600) Subject: Fix crash with group_reporting and one group member that never started X-Git-Tag: fio-2.9~14 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=dedb88eb2e4f074fd969133dbdc38ef3be64800b;p=fio.git Fix crash with group_reporting and one group member that never started If we have a job that nevers gets started, then we crash in setting up the group stats, if group_reporting is enabled. This can be reproduced like this: fio --name=iwontstart --name=null --ioengine=null --size=1g --group_reporting=1 Starting 2 processes iwontstart: you need to specify size= fio: pid=0, err=22/file:filesetup.c:828, func=total_file_size, error=Invalid argument Segmentation fault (core dumped) Check for -1 groupid, and just skip the job if so. Signed-off-by: Jens Axboe --- diff --git a/stat.c b/stat.c index d2720a4b..6d8d4d06 100644 --- a/stat.c +++ b/stat.c @@ -1580,6 +1580,8 @@ void __show_run_stats(void) unsigned long long bw; ts = &threadstats[i]; + if (ts->groupid == -1) + continue; rs = &runstats[ts->groupid]; rs->kb_base = ts->kb_base; rs->unit_base = ts->unit_base;