[LTP] [PATCH] hugeshmctl02: Skipped EFAULT tests for libc variant

Petr Vorel pvorel@suse.cz
Tue Jun 27 15:50:04 CEST 2023


Hi all,

> On Mon, Jun 26, 2023 at 5:22 PM Cyril Hrubis <chrubis@suse.cz> wrote:

> > Hi!
> > > You pointed the segment fault only exists on 32bit when use
> > > libc wrapper, but this condition skips for both 64and32 bits,
> > > isn't it?

> > > I guess the strict condition should be as below?

> > >     if (tcases[i].error == EFAULT && tv->shmctl == libc_shmctl &&
> > > tst_kernel_bits() == 32) {
> > >     ...
> > >     }

> > Actually I think that it may be safer to skip libc version regardless,
> > as long as we have the raw syscall test in place we are not getting any
> > more coverage from passing invalid address to the libc call, since
> > either the libc call is thin wrapper, i.e. equivalent to the syscall()
> > call which we already test, or it does something to the arguments, in
> > which case it's possible to trigger segfault, if not now in some future
> > libc versions.

Good to know. Because at least of some of the tests modified by Vinay Kumar
(which Dylan is referring) aren't able to run on 32bit libc if we skip with
&& tst_kernel_bits() == 32, e.g.

./msgctl04
tst_test.c:1558: TINFO: Timeout per run is 0h 00m 30s
msgctl04.c:103: TINFO: Testing variant: libc msgctl()
msgctl04.c:79: TPASS: msgctl(32816, 2, 0x565e4700) : EACCES (13)
tst_kernel.c:87: TINFO: uname.machine=x86_64 kernel is 64bit
tst_test.c:1618: TBROK: Test killed by SIGSEGV!

> Okay, sounds reasonable. I agree with this.

BTW I also get ENOMEM on my laptop (currently 1G free space):
hugeshmctl02.c:119: TBROK: shmget #1: ENOMEM (12)

Should we handle it somehow?

Kind regards,
Petr



More information about the ltp mailing list