[LU-13546] sanity-pcc test_4: mmap_sanity test failed Created: 11/May/20  Updated: 10/Jan/22

Status: Open
Project: Lustre
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Maloo Assignee: Qian Yingjin
Resolution: Unresolved Votes: 0
Labels: always_except

Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

This issue was created by maloo for S Buisson <sbuisson@ddn.com>

This issue relates to the following test suite run: https://testing.whamcloud.com/test_sets/7e33be5d-a239-48ba-8938-17e0f334cb59

test_4 failed with the following error:

mmap_sanity test failed

This issue happens with client on CentOS 8. The mmap command fails with:

mmap test8: SIGBUS for beyond file size (FAIL, 0.003286s)

VVVVVVV DO NOT REMOVE LINES BELOW, Added by Maloo for auto-association VVVVVVV
sanity-pcc test_4 - mmap_sanity test failed



 Comments   
Comment by Gerrit Updater [ 11/May/20 ]

Sebastien Buisson (sbuisson@ddn.com) uploaded a new patch: https://review.whamcloud.com/38564
Subject: LU-13546 tests: test sanity-pcc on CentOS 8
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 27d41717cc961693b87068c626df1ad0b492b791

Comment by Sebastien Buisson [ 11/May/20 ]

Patch #38564 confirms that sanity-pcc test_4 fails on CentOS 8 with tip of master branch.
I am increasing priority of this ticket. Should we push a patch to skip this test when client runs CentOS 8?

Comment by Qian Yingjin [ 14/May/20 ]

I run the command using mmap_sanity as follows in local Ext4 filesystem, it also can not pass the mmap_sanity tst8 on CentOS 8. 

[root@bing tests]# ./mmap_sanity -d /root/work/debug/ -m /root/work/debug/ -e 1 -e 2 -e 3 -e 4 -e 5 -e 6 -e 7 
mmap test1: basic mmap operation (SKIPPED, 0s)
mmap test2: MAP_PRIVATE not write back (SKIPPED, 0s)
mmap test3: concurrent mmap ops on two nodes (SKIPPED, 0s)
mmap test4: c1 write to f1 from mmapped f2, c2 write to f1 from mmapped f1 (SKIPPED, 0s)
mmap test5: read/write file to/from the buffer which mmapped to just this file (SKIPPED, 0s)
mmap test6: check mmap write/read content on two nodes (SKIPPED, 0s)
mmap test7: file i/o with an unmapped buffer (SKIPPED, 0s)
mmap test8: SIGBUS for beyond file size (FAIL, 0.001586s)

While the result on CentOS 7 with local Ext4 filesystem is as follows:

[root@qian tests]# ./mmap_sanity -d /root/work/debug -m /root/work/debug -e 1 -e 2 -e 3 -e 4 -e 5 -e 6 -e 7
mmap test1: basic mmap operation (SKIPPED, 0s)
mmap test2: MAP_PRIVATE not write back (SKIPPED, 0s)
mmap test3: concurrent mmap ops on two nodes (SKIPPED, 0s)
mmap test4: c1 write to f1 from mmapped f2, c2 write to f1 from mmapped f1 (SKIPPED, 0s)
mmap test5: read/write file to/from the buffer which mmapped to just this file (SKIPPED, 0s)
mmap test6: check mmap write/read content on two nodes (SKIPPED, 0s)
mmap test7: file i/o with an unmapped buffer (SKIPPED, 0s)
mmap test8: SIGBUS for beyond file size (PASS, 0.079921s)
mmap test9: SIGBUS for negative file offset (PASS, 4.1e-05s)

Same results for Lustre with CentOS 8 and CentOS 7:

// CentOS8 on Luste
[root@bing tests]# ./mmap_sanity -d /mnt/lustre -m /mnt/lustre -e 1 -e 2 -e 3 -e 4 -e 5 -e 6 -e 7 
mmap test1: basic mmap operation (SKIPPED, 0s)
mmap test2: MAP_PRIVATE not write back (SKIPPED, 0s)
mmap test3: concurrent mmap ops on two nodes (SKIPPED, 0s)
mmap test4: c1 write to f1 from mmapped f2, c2 write to f1 from mmapped f1 (SKIPPED, 0s)
mmap test5: read/write file to/from the buffer which mmapped to just this file (SKIPPED, 0s)
mmap test6: check mmap write/read content on two nodes (SKIPPED, 0s)
mmap test7: file i/o with an unmapped buffer (SKIPPED, 0s)
mmap test8: SIGBUS for beyond file size (FAIL, 0.009503s)
[root@bing tests]# df
Filesystem                  1K-blocks      Used Available Use% Mounted on
devtmpfs                      3975676         0   3975676   0% /dev
tmpfs                         3988784         0   3988784   0% /dev/shm
tmpfs                         3988784      9140   3979644   1% /run
tmpfs                         3988784         0   3988784   0% /sys/fs/cgroup
/dev/sda1                    46183252  10919180  32888392  25% /
vmhgfs-fuse                 488245288 238522632 249722656  49% /mnt/hgfs
tmpfs                          797756         0    797756   0% /run/user/0
/dev/mapper/mds1_flakey        125368      1956    112176   2% /mnt/lustre-mds1
/dev/mapper/ost1_flakey        325368     13508    284700   5% /mnt/lustre-ost1
/dev/mapper/ost2_flakey        325368     13508    284700   5% /mnt/lustre-ost2
192.168.150.131@tcp:/lustre    650736     27016    569400   5% /mnt/lustre
[root@bing tests]# 
// CentOS7 on Lustre
[root@qian tests]# ./mmap_sanity -d /mnt/lustre -m /mnt/lustre -e 1 -e 2 -e 3 -e 4 -e 5 -e 6 -e 7
mmap test1: basic mmap operation (SKIPPED, 0s)
mmap test2: MAP_PRIVATE not write back (SKIPPED, 0s)
mmap test3: concurrent mmap ops on two nodes (SKIPPED, 0s)
mmap test4: c1 write to f1 from mmapped f2, c2 write to f1 from mmapped f1 (SKIPPED, 0s)
mmap test5: read/write file to/from the buffer which mmapped to just this file (SKIPPED, 0s)
mmap test6: check mmap write/read content on two nodes (SKIPPED, 0s)
mmap test7: file i/o with an unmapped buffer (SKIPPED, 0s)
mmap test8: SIGBUS for beyond file size (PASS, 0.026712s)
mmap test9: SIGBUS for negative file offset (PASS, 0.004452s)
[root@qian tests]# df
Filesystem                  1K-blocks      Used Available Use% Mounted on
/dev/sda1                    52507040  18504952  31311836  38% /
devtmpfs                      1920116         0   1920116   0% /dev
tmpfs                         1930752         0   1930752   0% /dev/shm
tmpfs                         1930752     11764   1918988   1% /run
tmpfs                         1930752         0   1930752   0% /sys/fs/cgroup
.host:/                     488245288 238528028 249717260  49% /mnt/hgfs
tmpfs                          386152         0    386152   0% /run/user/0
/dev/mapper/mds1_flakey        125368      1956    112176   2% /mnt/lustre-mds1
/dev/mapper/ost1_flakey        325368     13508    284700   5% /mnt/lustre-ost1
/dev/mapper/ost2_flakey        325368     13508    284700   5% /mnt/lustre-ost2
192.168.150.128@tcp:/lustre    650736     27016    569400   5% /mnt/lustre

It seems In CentOS8 kernel, if the file rang is unmapped, it will not trigger SIGBUS when reading beyond file size.

 

I will exclude sanity_mmap tst8 from the  testing list.

 

Comment by Qian Yingjin [ 14/May/20 ]

It seems that the current Linux kernel does not follow POSIX syntax:

https://pubs.opengroup.org/onlinepubs/9699919799/

The mmap() function can be used to map a region of memory that is larger than the current size of the object. Memory access within the mapping but beyond the current end of the underlying objects may result in SIGBUS signals being sent to the process.
The mmap() function can be used to map a region of memory that is larger than the current size of the object. Memory access within the mapping but beyond the current end of the underlying objects may result in SIGBUS signals being sent to the process. The reason for this is that the size of the object can be manipulated by other processes and can change at any moment. The implementation should tell the application that a memory reference is outside the object where this can be detected; otherwise, written data may be lost and read data may not reflect actual data in the object.
Comment by Qian Yingjin [ 14/May/20 ]

It also failed mmap_sanity tst 9 for the PCC backend formatted as Ext4 due to the too large offset.

[root@bing tests]# ./mmap_sanity -d /root/work/debug -m /root/work/debug -e 7 -e 8 
mmap test1: basic mmap operation (PASS, 9e-05s)
mmap test2: MAP_PRIVATE not write back (PASS, 5.2e-05s)
mmap test3: concurrent mmap ops on two nodes (PASS, 2.002s)
mmap test4: c1 write to f1 from mmapped f2, c2 write to f1 from mmapped f1 (PASS, 2.0027s)
mmap test5: read/write file to/from the buffer which mmapped to just this file (PASS, 0.000589s)
mmap test6: check mmap write/read content on two nodes (PASS, 0.00016s)
mmap test7: file i/o with an unmapped buffer (SKIPPED, 0s)
mmap test8: SIGBUS for beyond file size (SKIPPED, 0s)
mmap: Value too large for defined data type
mmap test9: SIGBUS for negative file offset (FAIL, 4.9e-05s)
Comment by Gerrit Updater [ 14/May/20 ]

Yingjin Qian (qian@ddn.com) uploaded a new patch: https://review.whamcloud.com/38598
Subject: LU-13546 pcc: exclude mmap_sanity tst8/tst9 from test list
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 11f9c5e7d8454a6e4d47b6ebb3f9c01d97544b58

Comment by Gerrit Updater [ 02/Jun/20 ]

Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/38598/
Subject: LU-13546 pcc: exclude mmap_sanity tst8/tst9 from test list
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 9611b3c3f47a486adc41b2d5370561e94dcea753

Generated at Sat Feb 10 03:02:11 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.