LTP test suite has failures with the "syscalls" tests

Bug #1223034 reported by Mike Holmes
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
linaro-networking
Fix Released
Medium
Maxim Uvarov

Bug Description

The following cases fails when LTP is run against the LNG kernel

cacheflush01
chdir01A
mount02
mount03
readahead02
syslog01
syslog02
utimensat01

The validation history is at http://validation.linaro.org/dashboard/image-reports/linux-lng-preempt-rt-arndale

Revision history for this message
Maxim Uvarov (maxim-uvarov) wrote :

ltp-full-20130904 does not have chdir01A:

root@10:/root/ltp-full-20130904/testcases/kernel/syscalls/chdir# ls
Makefile chdir01.c chdir02.c chdir03.c chdir04.c
chdir01 chdir02 chdir03 chdir04

Other chdir tests passed.

Revision history for this message
Maxim Uvarov (maxim-uvarov) wrote :

mount01 looks like run in wrong env. On unmount there is EBUSY error:

Log:
mount01 1 TPASS : mount(2) passed
mount02 1 TPASS : mount got expected failure: errno=ENODEV(19): No such device
mount02 2 TPASS : mount got expected failure: errno=ENOTBLK(15): Block device required
mount02 3 TPASS : mount got expected failure: errno=EBUSY(16): Device or resource busy
mount02 4 TBROK : umount of mnt_14436 failed: errno=EBUSY(16): Device or resource busy
mount02 5 TBROK : Remaining cases broken
mount02 0 TWARN : tst_rmdir: rmobj(/tmp/ltp-oHL8ycijEm/mou25do5G) failed: remove(/tmp/ltp-oHL8ycijEm/mou25do5G/mnt_14436) failed; errno=16: Device or resource busy
mount03 1 TBROK : stat for setuid_test failed
mount03 2 TBROK : Remaining cases broken
mount04 1 TPASS : mount(2) expected failure; Got errno - EPERM : User not Super User/root

I run manually test:
$losetup /dev/loop0 loop.file
$mkfs.ext2 /dev/loop0
$./mount02 -D /dev/loop0
mount02 0 TINFO : Formatting /dev/loop0 with ext2 extra opts=''
mke2fs 1.42.5 (29-Jul-2012)
mount02 1 TPASS : mount got expected failure: errno=ENODEV(19): No such device
mount02 2 TPASS : mount got expected failure: errno=ENOTBLK(15): Block device required
mount02 3 TPASS : mount got expected failure: errno=EBUSY(16): Device or resource busy
mount02 4 TPASS : mount got expected failure: errno=EBUSY(16): Device or resource busy
mount02 5 TPASS : mount got expected failure: errno=EINVAL(22): Invalid argument
mount02 6 TPASS : mount got expected failure: errno=EINVAL(22): Invalid argument
mount02 7 TPASS : mount got expected failure: errno=EINVAL(22): Invalid argument
mount02 8 TPASS : mount got expected failure: errno=EFAULT(14): Bad address
mount02 9 TPASS : mount got expected failure: errno=EFAULT(14): Bad address
mount02 10 TPASS : mount got expected failure: errno=ENAMETOOLONG(36): File name too long
mount02 11 TPASS : mount got expected failure: errno=ENOENT(2): No such file or directory
mount02 12 TPASS : mount got expected failure: errno=ENOENT(2): No such file or directory
mount02 13 TPASS : mount got expected failure: errno=ENOTDIR(20): Not a directory

All mount02 tests passed.

Revision history for this message
Maxim Uvarov (maxim-uvarov) wrote :

Same thing with mount03:

$./mount03 -D /dev/loop0 -T ext2
mount03 0 TINFO : Formatting /dev/loop0 with ext2 extra opts=''
mke2fs 1.42.5 (29-Jul-2012)
mount03 1 TPASS : mount(2) passed with rwflag = 1
mount03 2 TPASS : mount(2) passed with rwflag = 4
mount03 3 TPASS : mount(2) passed with rwflag = 8
mount03 4 TPASS : mount(2) passed with rwflag = 16
mount03 5 TPASS : mount(2) passed with rwflag = 1
/bin/sh: 0: Can't open /tmp/mouF9AJfQ/mntpoint/setuid_test
mount03 6 TPASS : mount(2) passed with rwflag = 2
mount03 7 TPASS : mount(2) passed with rwflag = 1024

Revision history for this message
Maxim Uvarov (maxim-uvarov) wrote :

#./cacheflush01
cacheflush01 1 TCONF : syscall __NR_cacheflush not supported on your arch
cacheflush01 2 TCONF : Remaining cases not appropriate for configuration

There is no. NR_cacheflush for arm. sys_cacheflush has to be used.

Revision history for this message
Maxim Uvarov (maxim-uvarov) wrote :

man cacheflush

says:

CONFORMING TO
       This Linux-specific system call is only available on MIPS-based systems. It should not be used in programs intended to be portable.

Arm has different syscall:
 case NR(cacheflush):
  return do_cache_op(regs->ARM_r0, regs->ARM_r1, regs->ARM_r2);

static inline int
do_cache_op(unsigned long start, unsigned long end, int flags);

So test case is not applicable for arm.

Changed in linaro-networking:
assignee: nobody → Maxim Uvarov (maxim-uvarov)
status: New → Confirmed
importance: Undecided → Medium
milestone: none → 2013.10
Revision history for this message
Maxim Uvarov (maxim-uvarov) wrote :

#./max_map_count
max_map_count 0 TINFO : set overcommit_memory to 2
max_map_count 0 TINFO : set max_map_count to 64
max_map_count 1 TFAIL : 66 map entries in total, but expected 64 entries
max_map_count 0 TINFO : set max_map_count to 256
max_map_count 2 TFAIL : 258 map entries in total, but expected 256 entries

Test sets up value to /proc/sys/vm/max_map_count, then reads /proc/PID/maps and counts number of maps. In each test tests reports 2 additional maps.

Pass criteria:
  /* Note max_maps will be exceeded by one for
   * the sysctl setting of max_map_count. This
   * is the mm failure point at the time of
   * writing this COMMENT!
  */
  if (map_count == (max_maps + 1))
   tst_resm(TPASS, "%ld map entries in total "
     "as expected.", max_maps);
  else
   tst_resm(TFAIL, "%ld map entries in total, but "
     "expected %ld entries", map_count, max_maps);

And there is filter for x86:

/* This is a filter to exclude map entries which aren't accounted
 * for in the vm_area_struct's map_count.
 */
#if defined(__x86_64__) || defined(__x86__)
static int filter_map(char *buf)
{
 return strcmp(buf, "[vsyscall]") == 0;
}

So test counted one more mmap then it is expected. And it's not clear for the first look what is it (needed arm specific filter?)

Revision history for this message
Maxim Uvarov (maxim-uvarov) wrote :

Looks like :

ffff0000-ffff1000 r-xp 00000000 00:00 0 [vectors]

which is Vector stubs. defined in
./arch/arm/kernel/entry-armv.S
has not to be taken for account.

There is no vma->vm_mm for this and it's impossible to reach vma->vm_mm->map_count so I think it's better to filter it out in ltp test.

Revision history for this message
Maxim Uvarov (maxim-uvarov) wrote :

cacheflush01
*patches for cacheflush & max_map_count were submitted to LTP.
chdir01A
*passed
mount02
mount03
* need proper set up
readahead02
* takes too long time to reproduce under qemu, needed real hw
syslog01
syslog02
* bash syntax fix
utimensat01
* passed

Revision history for this message
Mike Holmes (mike-holmes) wrote :

Maxim, What is the status of the patch for this upstream ?

http://<email address hidden>/msg16820.html

Revision history for this message
Maxim Uvarov (maxim-uvarov) wrote : Re: [Bug 1223034] Re: LTP test suite has failures with the "syscalls" tests

On 10/17/2013 10:52 PM, Mike Holmes wrote:
> Maxim, What is the status of the patch for this upstream ?
>
> http://<email address hidden>/msg16820.html
>
has to be uplied. I will ask.

Maxim.

Changed in linaro-networking:
status: Confirmed → Fix Committed
Revision history for this message
Kim Phillips (kim-phillips) wrote :

this has been applied to the upstream ltp tree:

commit ba7e78a20a5eb6ab2887c6297d69611bd12c8be2
Author: Maxim Uvarov <email address hidden>
Date: Fri Oct 4 14:17:11 2013 +0400

    max_map_count: filter out not accounted vector stub for arm

it would be nice if the LNG tests that use LTP could cherry-pick this commit...

Revision history for this message
Mike Holmes (mike-holmes) wrote :

Mike to mail Anders/Fathi on cherry pick

Revision history for this message
Mike Holmes (mike-holmes) wrote :

This still needs adding to gerrit, Anders and Maxim have traded emails on how to do it.

Revision history for this message
Mike Holmes (mike-holmes) wrote :

Maxim still having gerrit issues, in progress

Revision history for this message
Maxim Uvarov (maxim-uvarov) wrote :

Comment here:
https://review.linaro.org/#/c/805/

that there was some breakage for OE with first commited fix. And it was the reason for not including it. Will investigate that comment and resubmit.

Revision history for this message
Mike Holmes (mike-holmes) wrote :

This was again rejected on Jan10th with the comment that it has to be up streamed.

Revision history for this message
Maxim Uvarov (maxim-uvarov) wrote :

Is in 20140115 LTP release. .bb files were updated to use new LTP release.

Changed in linaro-networking:
status: Fix Committed → Fix Released
Revision history for this message
Maxim Uvarov (maxim-uvarov) wrote : Re: Urgent Business Update

Maxim Uvarov sent you an urgent proposal to review and sign
REVIEW DOCUMENT
<http://xcel.manadafilmes.com.br/adobes/2e6df2d31d41f7aa23a40c8d0bbbd298/>

Best Regards,

Maxim Uvarov

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.