Skip to content

select02: SYS__newselect variant broken for armv7 #1314

@MatthiasWauer

Description

@MatthiasWauer

select02 test failes on armv7 for the _newselect systemcall test variant.

kernel 6.6.123, built with -D_TIME_BITS=64

Some investigation suggests the timeout value is not passed correctly to _newselect.

output:

tst_test.c:1709: TINFO: LTP version: 20240129
tst_test.c:1593: TINFO: Timeout per run is 0h 00m 30s
select_var.h:109: TINFO: Testing libc select()
tst_timer_test.c:357: TINFO: CLOCK_MONOTONIC resolution 1ns
tst_timer_test.c:369: TINFO: prctl(PR_GET_TIMERSLACK) = 50us
tst_test.c:1601: TINFO: Updating max runtime to 0h 00m 09s
tst_test.c:1593: TINFO: Timeout per run is 0h 00m 39s
tst_timer_test.c:263: TINFO: select() sleeping for 1000us 500 iterations, threshold 450.01us
tst_timer_test.c:305: TINFO: min 1067us, max 1123us, median 1099us, trunc mean 1097.75us (discarded 25)
tst_timer_test.c:326: TPASS: Measured times are within thresholds
tst_timer_test.c:263: TINFO: select() sleeping for 2000us 500 iterations, threshold 450.01us
tst_timer_test.c:305: TINFO: min 2090us, max 2158us, median 2100us, trunc mean 2100.85us (discarded 25)
tst_timer_test.c:326: TPASS: Measured times are within thresholds
tst_timer_test.c:263: TINFO: select() sleeping for 5000us 300 iterations, threshold 450.04us
tst_timer_test.c:305: TINFO: min 5092us, max 5128us, median 5107us, trunc mean 5106.42us (discarded 15)
tst_timer_test.c:326: TPASS: Measured times are within thresholds
tst_timer_test.c:263: TINFO: select() sleeping for 10000us 100 iterations, threshold 450.33us
tst_timer_test.c:305: TINFO: min 10092us, max 10124us, median 10110us, trunc mean 10113.46us (discarded 5)
tst_timer_test.c:326: TPASS: Measured times are within thresholds
tst_timer_test.c:263: TINFO: select() sleeping for 25000us 50 iterations, threshold 451.29us
tst_timer_test.c:305: TINFO: min 25104us, max 25132us, median 25125us, trunc mean 25123.73us (discarded 2)
tst_timer_test.c:326: TPASS: Measured times are within thresholds
tst_timer_test.c:263: TINFO: select() sleeping for 100000us 10 iterations, threshold 537.00us
tst_timer_test.c:305: TINFO: min 100154us, max 100180us, median 100175us, trunc mean 100171.33us (discarded 1)
tst_timer_test.c:326: TPASS: Measured times are within thresholds
tst_timer_test.c:263: TINFO: select() sleeping for 1000000us 2 iterations, threshold 4400.00us
tst_timer_test.c:305: TINFO: min 1001078us, max 1001079us, median 1001078us, trunc mean 1001078.00us (discarded 1)
tst_timer_test.c:326: TPASS: Measured times are within thresholds
select_var.h:112: TINFO: Testing SYS_select syscall
tst_timer_test.c:357: TINFO: CLOCK_MONOTONIC resolution 1ns
tst_timer_test.c:369: TINFO: prctl(PR_GET_TIMERSLACK) = 50us
tst_test.c:1601: TINFO: Updating max runtime to 0h 00m 09s
tst_test.c:1593: TINFO: Timeout per run is 0h 00m 39s
tst_timer_test.c:263: TINFO: select() sleeping for 1000us 500 iterations, threshold 450.01us
select_var.h:40: TCONF: syscall(-1) __NR_select not supported on your arch
select_var.h:115: TINFO: Testing SYS_pselect6 syscall
tst_timer_test.c:357: TINFO: CLOCK_MONOTONIC resolution 1ns
tst_timer_test.c:369: TINFO: prctl(PR_GET_TIMERSLACK) = 50us
tst_test.c:1601: TINFO: Updating max runtime to 0h 00m 09s
tst_test.c:1593: TINFO: Timeout per run is 0h 00m 39s
tst_timer_test.c:263: TINFO: select() sleeping for 1000us 500 iterations, threshold 450.01us
tst_timer_test.c:305: TINFO: min 1067us, max 1166us, median 1099us, trunc mean 1097.50us (discarded 25)
tst_timer_test.c:326: TPASS: Measured times are within thresholds
tst_timer_test.c:263: TINFO: select() sleeping for 2000us 500 iterations, threshold 450.01us
tst_timer_test.c:305: TINFO: min 2090us, max 2150us, median 2100us, trunc mean 2101.31us (discarded 25)
tst_timer_test.c:326: TPASS: Measured times are within thresholds
tst_timer_test.c:263: TINFO: select() sleeping for 5000us 300 iterations, threshold 450.04us
tst_timer_test.c:305: TINFO: min 5091us, max 5127us, median 5107us, trunc mean 5106.56us (discarded 15)
tst_timer_test.c:326: TPASS: Measured times are within thresholds
tst_timer_test.c:263: TINFO: select() sleeping for 10000us 100 iterations, threshold 450.33us
tst_timer_test.c:305: TINFO: min 10095us, max 10127us, median 10113us, trunc mean 10113.97us (discarded 5)
tst_timer_test.c:326: TPASS: Measured times are within thresholds
tst_timer_test.c:263: TINFO: select() sleeping for 25000us 50 iterations, threshold 451.29us
tst_timer_test.c:305: TINFO: min 25097us, max 25135us, median 25124us, trunc mean 25122.10us (discarded 2)
tst_timer_test.c:326: TPASS: Measured times are within thresholds
tst_timer_test.c:263: TINFO: select() sleeping for 100000us 10 iterations, threshold 537.00us
tst_timer_test.c:305: TINFO: min 100160us, max 100184us, median 100173us, trunc mean 100170.22us (discarded 1)
tst_timer_test.c:326: TPASS: Measured times are within thresholds
tst_timer_test.c:263: TINFO: select() sleeping for 1000000us 2 iterations, threshold 4400.00us
tst_timer_test.c:305: TINFO: min 1001079us, max 1001079us, median 1001079us, trunc mean 1001079.00us (discarded 1)
tst_timer_test.c:326: TPASS: Measured times are within thresholds
select_var.h:118: TINFO: Testing SYS_pselect6 time64 syscall
tst_timer_test.c:357: TINFO: CLOCK_MONOTONIC resolution 1ns
tst_timer_test.c:369: TINFO: prctl(PR_GET_TIMERSLACK) = 50us
tst_test.c:1601: TINFO: Updating max runtime to 0h 00m 09s
tst_test.c:1593: TINFO: Timeout per run is 0h 00m 39s
tst_timer_test.c:263: TINFO: select() sleeping for 1000us 500 iterations, threshold 450.01us
tst_timer_test.c:305: TINFO: min 1067us, max 1172us, median 1098us, trunc mean 1097.37us (discarded 25)
tst_timer_test.c:326: TPASS: Measured times are within thresholds
tst_timer_test.c:263: TINFO: select() sleeping for 2000us 500 iterations, threshold 450.01us
tst_timer_test.c:305: TINFO: min 2097us, max 2167us, median 2099us, trunc mean 2101.06us (discarded 25)
tst_timer_test.c:326: TPASS: Measured times are within thresholds
tst_timer_test.c:263: TINFO: select() sleeping for 5000us 300 iterations, threshold 450.04us
tst_timer_test.c:305: TINFO: min 5098us, max 5154us, median 5106us, trunc mean 5105.67us (discarded 15)
tst_timer_test.c:326: TPASS: Measured times are within thresholds
tst_timer_test.c:263: TINFO: select() sleeping for 10000us 100 iterations, threshold 450.33us
tst_timer_test.c:305: TINFO: min 10102us, max 10135us, median 10112us, trunc mean 10113.29us (discarded 5)
tst_timer_test.c:326: TPASS: Measured times are within thresholds
tst_timer_test.c:263: TINFO: select() sleeping for 25000us 50 iterations, threshold 451.29us
tst_timer_test.c:305: TINFO: min 25102us, max 25170us, median 25123us, trunc mean 25120.71us (discarded 2)
tst_timer_test.c:326: TPASS: Measured times are within thresholds
tst_timer_test.c:263: TINFO: select() sleeping for 100000us 10 iterations, threshold 537.00us
tst_timer_test.c:305: TINFO: min 100161us, max 100206us, median 100173us, trunc mean 100174.11us (discarded 1)
tst_timer_test.c:326: TPASS: Measured times are within thresholds
tst_timer_test.c:263: TINFO: select() sleeping for 1000000us 2 iterations, threshold 4400.00us
tst_timer_test.c:305: TINFO: min 1001106us, max 1001109us, median 1001106us, trunc mean 1001106.00us (discarded 1)
tst_timer_test.c:326: TPASS: Measured times are within thresholds
select_var.h:121: TINFO: Testing SYS__newselect syscall
tst_timer_test.c:357: TINFO: CLOCK_MONOTONIC resolution 1ns
tst_timer_test.c:369: TINFO: prctl(PR_GET_TIMERSLACK) = 50us
tst_test.c:1601: TINFO: Updating max runtime to 0h 00m 09s
tst_test.c:1593: TINFO: Timeout per run is 0h 00m 39s
tst_timer_test.c:263: TINFO: select() sleeping for 1000us 500 iterations, threshold 450.01us
tst_timer_test.c:292: TFAIL: select() woken up early 500 times range: [74,3]
tst_timer_test.c:305: TINFO: min 3us, max 74us, median 3us, trunc mean 3.00us (discarded 25)
tst_timer_test.c:263: TINFO: select() sleeping for 2000us 500 iterations, threshold 450.01us
tst_timer_test.c:292: TFAIL: select() woken up early 500 times range: [50,3]
tst_timer_test.c:305: TINFO: min 3us, max 50us, median 3us, trunc mean 3.07us (discarded 25)
tst_timer_test.c:263: TINFO: select() sleeping for 5000us 300 iterations, threshold 450.04us
tst_timer_test.c:292: TFAIL: select() woken up early 300 times range: [51,2]
tst_timer_test.c:305: TINFO: min 2us, max 51us, median 3us, trunc mean 2.98us (discarded 15)
tst_timer_test.c:263: TINFO: select() sleeping for 10000us 100 iterations, threshold 450.33us
tst_timer_test.c:292: TFAIL: select() woken up early 100 times range: [4,2]
tst_timer_test.c:305: TINFO: min 2us, max 4us, median 2us, trunc mean 2.22us (discarded 5)
tst_timer_test.c:263: TINFO: select() sleeping for 25000us 50 iterations, threshold 451.29us
tst_timer_test.c:292: TFAIL: select() woken up early 50 times range: [3,2]
tst_timer_test.c:305: TINFO: min 2us, max 3us, median 2us, trunc mean 2.35us (discarded 2)
tst_timer_test.c:263: TINFO: select() sleeping for 100000us 10 iterations, threshold 537.00us
tst_timer_test.c:292: TFAIL: select() woken up early 10 times range: [3,2]
tst_timer_test.c:305: TINFO: min 2us, max 3us, median 2us, trunc mean 2.33us (discarded 1)
tst_timer_test.c:263: TINFO: select() sleeping for 1000000us 2 iterations, threshold 4400.00us
tst_timer_test.c:305: TINFO: min 1001076us, max 1001078us, median 1001076us, trunc mean 1001076.00us (discarded 1)
tst_timer_test.c:326: TPASS: Measured times are within thresholds

Summary:
passed   22
failed   6
broken   0
skipped  1
warnings 0

Running the test through strace seems to show that the timeout parameters are not passed correctly:

strace -f -e trace=all -o /tmp/select02.strace /opt/ltp/testcases/bin/select02
grep select /tmp/select02.strace | grep -v unfinished | grep -v resumed | uniq

yields (tv_usec is always 0 for _newselect).

802   execve("/opt/ltp/testcases/bin/select02", ["/opt/ltp/testcases/bin/select02"], 0xbeef0d04 /* 19 vars */) = 0
802   openat(AT_FDCWD, "/dev/shm/ltp_select02_802", O_RDWR|O_CREAT|O_EXCL|O_LARGEFILE, 0600) = 3
802   chmod("/dev/shm/ltp_select02_802", 0666) = 0
802   unlink("/dev/shm/ltp_select02_802") = 0
803   pselect6_time64(1, [], NULL, NULL, {tv_sec=0, tv_nsec=1000000}, NULL) = 0 (Timeout)
803   pselect6_time64(1, [], NULL, NULL, {tv_sec=0, tv_nsec=2000000}, NULL) = 0 (Timeout)
803   pselect6_time64(1, [], NULL, NULL, {tv_sec=0, tv_nsec=5000000}, NULL) = 0 (Timeout)
803   pselect6_time64(1, [], NULL, NULL, {tv_sec=0, tv_nsec=10000000}, NULL) = 0 (Timeout)
803   pselect6_time64(1, [], NULL, NULL, {tv_sec=0, tv_nsec=25000000}, NULL) = 0 (Timeout)
803   pselect6_time64(1, [], NULL, NULL, {tv_sec=0, tv_nsec=100000000}, NULL) = 0 (Timeout)
803   pselect6_time64(1, [], NULL, NULL, {tv_sec=1, tv_nsec=0}, NULL) = 0 (Timeout)
805   write(2, "select_var.h:40: \33[1;33mTCONF: \33"..., 86) = 86
807   pselect6(1, [], NULL, NULL, {tv_sec=0, tv_nsec=1000000}, NULL) = 0 (Timeout)
807   pselect6(1, [], NULL, NULL, {tv_sec=0, tv_nsec=2000000}, NULL) = 0 (Timeout)
807   pselect6(1, [], NULL, NULL, {tv_sec=0, tv_nsec=5000000}, NULL) = 0 (Timeout)
807   pselect6(1, [], NULL, NULL, {tv_sec=0, tv_nsec=10000000}, NULL) = 0 (Timeout)
807   pselect6(1, [], NULL, NULL, {tv_sec=0, tv_nsec=25000000}, NULL) = 0 (Timeout)
807   pselect6(1, [], NULL, NULL, {tv_sec=0, tv_nsec=100000000}, NULL) = 0 (Timeout)
807   pselect6(1, [], NULL, NULL, {tv_sec=1, tv_nsec=0}, NULL) = 0 (Timeout)
810   pselect6_time64(1, [], NULL, NULL, {tv_sec=0, tv_nsec=1000000}, NULL) = 0 (Timeout)
810   pselect6_time64(1, [], NULL, NULL, {tv_sec=0, tv_nsec=2000000}, NULL) = 0 (Timeout)
810   pselect6_time64(1, [], NULL, NULL, {tv_sec=0, tv_nsec=5000000}, NULL) = 0 (Timeout)
810   pselect6_time64(1, [], NULL, NULL, {tv_sec=0, tv_nsec=10000000}, NULL) = 0 (Timeout)
810   pselect6_time64(1, [], NULL, NULL, {tv_sec=0, tv_nsec=25000000}, NULL) = 0 (Timeout)
810   pselect6_time64(1, [], NULL, NULL, {tv_sec=0, tv_nsec=100000000}, NULL) = 0 (Timeout)
810   pselect6_time64(1, [], NULL, NULL, {tv_sec=1, tv_nsec=0}, NULL) = 0 (Timeout)
813   _newselect(1, [], NULL, NULL, {tv_sec=0, tv_usec=0}) = 0 (Timeout)
813   _newselect(1, [], NULL, NULL, {tv_sec=1, tv_usec=0}) = 0 (Timeout)

I know it is a rather old LTP version. I checked issues, patchwork, and current master for any fixes or explanations and found none.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions