[LTP] [PATCH v2 1/2] Refactoring aio-stress.c using LTP API

Petr Vorel pvorel@suse.cz
Tue Jan 4 13:22:35 CET 2022


Hi Richie,

> Hello Petr,

> Petr Vorel <pvorel@suse.cz> writes:

> > Hi Andrea,

> > ...
> >>  			for (i = 0; i < io->io_oper->reclen; i++) {
> >>  				if (io->buf[i] != verify_buf[i]) {
> >> -					fprintf(stderr, "%d:%c:%c ", i,
> >> -						io->buf[i], verify_buf[i]);
> >> +					ret = asprintf(&msg, "%d:%c:%c ", i, io->buf[i], verify_buf[i]);
> >> +					if (ret < 0)
> >> +						tst_brk(TBROK, "asprintf memory allocation error");
> >> +					ptr += sprintf(ptr, msg);
> > Actually, this is problematic for -Werror=format-security which we use in CI.
> > Simple "%s" fixes that. It can be done before merge.

> > ptr += sprintf(ptr, "%s", msg); 

> > @Richie: I wonder if make check could also actually compile the code with
> > extra CFLAGS from build.sh.

> Compiling during make-check may confuse things; we don't want make-check
> to produce build artifacts. Although I guess you could skip the later
> compilation steps. Also then we could add -fanalyzer on gcc which I have
> done in a test project[1]. Possibly Clang has something similar,
> hhmmmm...

FYI the point is for me to avoid manually pushing changes to github repository,
to speedup review by catching early (and without additional effort from reviewer
side) mostly trivial error detection.

But OTOH we cannot expect users to have it running, thus I should probably force
myself to implement pachwork REST API
https://github.com/linux-test-project/ltp/issues/599

i.e. either we ask patch authors to watch the build status on patchwork or to
run make check (or even both).

Kind regards,
Petr

> Probably this would require different flags on GCC and Clang. We could
> also run both GCC and Clang if they are present. It's probably worth
> experimenting with.

> [1]: https://richiejp.com/zc-data#meson


More information about the ltp mailing list