shmget02 / shmget03 in ubuntu_ltp_syscalls failed on F-oem-5.10

Bug #1934432 reported by Po-Hsu Lin
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
ubuntu-kernel-tests
In Progress
Undecided
Thadeu Lima de Souza Cascardo

Bug Description

Issue found on 5.10.0-1035.36 with node spitfire.

 tst_test.c:1311: TINFO: Timeout per run is 0h 05m 00s
 shmget02.c:69: TPASS: shmget(1644298264, 2048, 1024): ENOENT (2)
 shmget02.c:69: TPASS: shmget(1627521048, 2048, 1536): EEXIST (17)
 shmget02.c:69: TPASS: shmget(1644298264, 0, 1536): EINVAL (22)
 shmget02.c:69: TPASS: shmget(1644298264, 18446744073692774400, 1536): EINVAL (22)
 shmget02.c:69: TPASS: shmget(1627521048, 4096, 1024): EINVAL (22)
 shmget02.c:81: TPASS: shmget(1627521048, 2048, 256): EACCES (13)
 shmget02.c:81: TFAIL: shmget(1644298264, 2048, 2560) expected EPERM: ENOMEM (12)
 shmget02.c:69: TPASS: shmget(1644298264, 2048, 2560): ENOMEM (12)

 Summary:
 passed 7
 failed 1
 broken 0
 skipped 0
 warnings 0
 tag=shmget02 stime=1624946043 dur=0 exit=exited stat=1 core=no cu=0 cs=0

 startup='Tue Jun 29 05:54:03 2021'
 tst_test.c:1311: TINFO: Timeout per run is 0h 05m 00s
 shmget03.c:46: TBROK: shmget failed unexpectedly: ENOSPC (28)

 Summary:
 passed 0
 failed 0
 broken 1
 skipped 0
 warnings 0
 tag=shmget03 stime=1624946043 dur=0 exit=exited stat=2 core=no cu=0 cs=2

Po-Hsu Lin (cypressyew)
tags: added: 5.10 focal oem sru-20210621 ubuntu-ltp-syscalls
Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

This issue does not exist with 5.10.0-1032.33-oem with LTP head e84209b8d

Bisect shows this is caused by:
4dc493b44a85ee0dfd5785f60acd4597dcff0075 is the first bad commit
commit 4dc493b44a85ee0dfd5785f60acd4597dcff0075
Author: Yang Xu <email address hidden>
Date: Thu Jun 24 13:33:47 2021 +0800

    syscalls/shmget*: Convert into new api

    1) merge shmget05.c into shmget02.c
    2) Use SHMMIN -1 and SHMMAX + 1 to trigger EINVAL error
    3) Use SHM_RD, SHM_WR, SHM_RW to trigger EACCES error under unpriviledged user
    4) add EPERM error test
    5) add ENOMEM error test
    6) Use TST_EXP_FAIL2 macro

    Signed-off-by: Yang Xu <email address hidden>
    Reviewed-by: Cyril Hrubis <email address hidden>

 include/lapi/shm.h | 14 ++
 runtest/syscalls | 1 -
 runtest/syscalls-ipc | 1 -
 testcases/kernel/syscalls/ipc/shmget/.gitignore | 1 -
 testcases/kernel/syscalls/ipc/shmget/Makefile | 4 +-
 testcases/kernel/syscalls/ipc/shmget/shmget02.c | 248 +++++++++---------------
 testcases/kernel/syscalls/ipc/shmget/shmget03.c | 199 +++++--------------
 testcases/kernel/syscalls/ipc/shmget/shmget04.c | 188 +++++-------------
 testcases/kernel/syscalls/ipc/shmget/shmget05.c | 185 ------------------
 9 files changed, 207 insertions(+), 634 deletions(-)
 delete mode 100644 testcases/kernel/syscalls/ipc/shmget/shmget05.c

tags: added: 5.11 aws azure groovy hirsute oracle
Revision history for this message
Thadeu Lima de Souza Cascardo (cascardo) wrote :
Revision history for this message
Krzysztof Kozlowski (krzk) wrote :

Found on groovy/azure 5.8.0-1038.40

tags: added: 5.8
Changed in ubuntu-kernel-tests:
assignee: nobody → Thadeu Lima de Souza Cascardo (cascardo)
status: New → In Progress
Revision history for this message
Ian May (ian-may) wrote :

Found on focal/gcp 5.11.0-1013.14~20.04.1

Looking deeper at this I noticed that running shmget03 on a clean boot worked fine, but would fail when running all ltp/ipc tests. I found a shared segment leak after running shmctl05

$ ipcs -m

------ Shared Memory Segments --------
key shmid owner perms bytes nattch status
0x0000f00f 629964859 ubuntu 700 4096 0

This causes shmget03 to fail since it can't create maxshms segments.

I submitted the fix to upstream LTP

Revision history for this message
Po-Hsu Lin (cypressyew) wrote :
Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

And Thadeu's commits:
https://kernel.ubuntu.com/git/ubuntu/ltp.git/commit/?h=sru&id=e7dd11662b9c84c6ba2a3760fff714144a45bcec

Looks like Alexey's commit is still in progress.

Revision history for this message
Guilherme G. Piccoli (gpiccoli) wrote :

Thanks for the fix cascardo! And for the investigation cypressyew.

Observed in G/Oracle, cycle sru-20210621 .

Revision history for this message
Guilherme G. Piccoli (gpiccoli) wrote :

Observed in G/aws, cycle sru-20210621 .

Revision history for this message
Guilherme G. Piccoli (gpiccoli) wrote :

Observed in B/aws-5.4, cycle sru-20210621.

tags: added: 5.4 bionic
Revision history for this message
Guilherme G. Piccoli (gpiccoli) wrote :

Observed this on B/oracle-5.4, cycle sru-20210621 .

Revision history for this message
Guilherme G. Piccoli (gpiccoli) wrote :

Observed in B/aws (kernel 4.15), cycle sru-20210621.

tags: added: 4.15
Revision history for this message
Guilherme G. Piccoli (gpiccoli) wrote :

Observed in B/aws-fips (kernel 4.15), cycle sru-20210621.

tags: added: fips
Revision history for this message
Tim Gardner (timg-tpi) wrote :

Observed in hirsute:linux-oracle, sru-20210719

Revision history for this message
Stefan Bader (smb) wrote :

Observed as well (no surprise) on impish:linux-oracle, sru-20210719

Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

shmget02 failed on F-OEM-5.14, linux-oem-5.14/5.14.0-1004.4:
  shmget02.c:83: TFAIL: shmget(1644298262, 2048, 2560) succeeded

tags: added: 5.14 sru-20210906
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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