On 04/01/2014 09:56 AM, Andrey Kuzmin wrote: > Thanks. On a separate (or may be related) note, shared files handling > in dup_files seems to be broken (unless I'm missing the logic behind > dropping non-shared files). The patch below has fixed it for me. > > diff --git a/init.c b/init.c > index 9b0666d..99038b2 100644 > --- a/init.c > +++ b/init.c > @@ -1160,17 +1161,20 @@ static int add_job(struct thread_data *td, const char *j > td_new->o.new_group = 0; > > if (file_alloced) { > - td_new->files_index = 0; > - td_new->files_size = 0; > if (td_new->files) { > struct fio_file *f; > for_each_file(td_new, f, i) { > if (f->file_name) > - free(f->file_name); > - free(f); > + sfree(f->file_name); > + sfree(f); > } > + free(td_new->files); > td_new->files = NULL; > } > + td_new->files_index = 0; > + td_new->files_size = 0; > if (td_new->o.filename) { > free(td_new->o.filename); > td_new->o.filename = NULL; Thanks, I'll add this, definitely looks like a missing conversion at some point... And while this isn't the bug, I think it's touching in the right area. Can you try with this one-liner and see if that fixes your issues with EBADF? -- Jens Axboe