Subject: tests/cp/proc-short-read.sh fails in modern build environment
From: Kamil Dudka <[email-masked]>
To: [email-masked]
Date: Thu, 30 Jan 2020 14:53:54 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

tests/cp/proc-short-read.sh expects that a pair of subsequent reads from
/proc/kallsyms will always return the same content.  This does not seem to
be a safe assumption any more.  The test has started to fail in our build
environment.  I am not sure how to fix the test.  We could probably make
it use another file from /proc but most of them are much smaller than
kallsyms and/or suffer from the same problem.  Output of the failing test
follows.

Kamil

FAIL: tests/cp/proc-short-read
==============================
++ initial_cwd_=/builddir/build/BUILD/coreutils-8.31/separate
+++ testdir_prefix_
+++ printf gt
++ pfx_=gt
+++ mktempd_ /builddir/build/BUILD/coreutils-8.31/separate gt-proc-short-read.sh.XXXX
+++ case $# in
+++ destdir_=/builddir/build/BUILD/coreutils-8.31/separate
+++ template_=gt-proc-short-read.sh.XXXX
+++ MAX_TRIES_=4
+++ case $destdir_ in
+++ destdir_slash_=/builddir/build/BUILD/coreutils-8.31/separate/
+++ case $template_ in
++++ unset TMPDIR
+++ d=/builddir/build/BUILD/coreutils-8.31/separate/gt-proc-short-read.sh.lINR
+++ case $d in
+++ :
+++ test -d /builddir/build/BUILD/coreutils-8.31/separate/gt-proc-short-read.sh.lINR
++++ ls -dgo /builddir/build/BUILD/coreutils-8.31/separate/gt-proc-short-read.sh.lINR
+++ perms='drwx------. 2 4096 Jan 29 12:04 /builddir/build/BUILD/coreutils-8.31/separate/gt-proc-short-read.sh.lINR'
+++ case $perms in
+++ :
+++ echo /builddir/build/BUILD/coreutils-8.31/separate/gt-proc-short-read.sh.lINR
+++ return
++ test_dir_=/builddir/build/BUILD/coreutils-8.31/separate/gt-proc-short-read.sh.lINR
++ cd /builddir/build/BUILD/coreutils-8.31/separate/gt-proc-short-read.sh.lINR
++ gl_init_sh_nl_='
'
++ IFS=' 	
'
++ for sig_ in 1 2 3 13 15
+++ expr 1 + 128
++ eval 'trap '\''Exit 129'\'' 1'
+++ trap 'Exit 129' 1
++ for sig_ in 1 2 3 13 15
+++ expr 2 + 128
++ eval 'trap '\''Exit 130'\'' 2'
+++ trap 'Exit 130' 2
++ for sig_ in 1 2 3 13 15
+++ expr 3 + 128
++ eval 'trap '\''Exit 131'\'' 3'
+++ trap 'Exit 131' 3
++ for sig_ in 1 2 3 13 15
+++ expr 13 + 128
++ eval 'trap '\''Exit 141'\'' 13'
+++ trap 'Exit 141' 13
++ for sig_ in 1 2 3 13 15
+++ expr 15 + 128
++ eval 'trap '\''Exit 143'\'' 15'
+++ trap 'Exit 143' 15
++ trap remove_tmp_ 0
+ path_prepend_ ./src
+ test 1 '!=' 0
+ path_dir_=./src
+ case $path_dir_ in
+ abs_path_dir_=/builddir/build/BUILD/coreutils-8.31/separate/./src
+ case $abs_path_dir_ in
+ PATH=/builddir/build/BUILD/coreutils-8.31/separate/./src:/builddir/build/BUILD/coreutils-8.31/separate/src:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin
+ create_exe_shims_ /builddir/build/BUILD/coreutils-8.31/separate/./src
+ case $EXEEXT in
+ return 0
+ shift
+ test 0 '!=' 0
+ export PATH
+ print_ver_ cp
+ require_built_ cp
+ skip_=no
+ for i in "$@"
+ case " $built_programs " in
+ test no = yes
+ test yes = yes
+ local i
+ for i in $*
+ env cp --version
cp (GNU coreutils) 8.31
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by Torbjorn Granlund, David MacKenzie, and Jim Meyering.
+ kall=/proc/kallsyms
+ test -r /proc/kallsyms
+ cp /proc/kallsyms 1
+ cat /proc/kallsyms
+ compare 1 2
+ compare_dev_null_ 1 2
+ test 2 = 2
+ test x1 = x/dev/null
+ test x2 = x/dev/null
+ return 2
+ case $? in
+ compare_ 1 2
+ diff -u 1 2
--- 1	2020-01-29 12:04:36.923963121 +0000
+++ 2	2020-01-29 12:04:37.026963484 +0000
@@ -114819,81 +114819,132 @@
 0000000000000000 t nfs_file_direct_read.cold	[nfs]
 0000000000000000 t nfs_file_direct_write.cold	[nfs]
 0000000000000000 r .LC0	[nfs]
-0000000000000000 r .LC2	[nfs]
-0000000000000000 r __ksymtab_nfs_pgio_current_mirror	[nfs]
-0000000000000000 r __kstrtab_nfs_pgio_current_mirror	[nfs]
-0000000000000000 r __ksymtab_nfs_pgheader_init	[nfs]
-0000000000000000 r __kstrtab_nfs_pgheader_init	[nfs]
-0000000000000000 r __ksymtab_nfs_async_iocounter_wait	[nfs]
-0000000000000000 r __kstrtab_nfs_async_iocounter_wait	[nfs]
-0000000000000000 r __ksymtab_nfs_release_request	[nfs]
-0000000000000000 r __kstrtab_nfs_release_request	[nfs]
-0000000000000000 r __ksymtab_nfs_wait_on_request	[nfs]
-0000000000000000 r __kstrtab_nfs_wait_on_request	[nfs]
-0000000000000000 r __ksymtab_nfs_generic_pg_test	[nfs]
-0000000000000000 r __kstrtab_nfs_generic_pg_test	[nfs]
-0000000000000000 r __ksymtab_nfs_pgio_header_alloc	[nfs]
-0000000000000000 r __kstrtab_nfs_pgio_header_alloc	[nfs]
-0000000000000000 r __ksymtab_nfs_pgio_header_free	[nfs]
-0000000000000000 r __kstrtab_nfs_pgio_header_free	[nfs]
-0000000000000000 r __ksymtab_nfs_initiate_pgio	[nfs]
-0000000000000000 r __kstrtab_nfs_initiate_pgio	[nfs]
-0000000000000000 r __ksymtab_nfs_generic_pgio	[nfs]
-0000000000000000 r __kstrtab_nfs_generic_pgio	[nfs]
-0000000000000000 r __ksymtab_nfs_pageio_resend	[nfs]
-0000000000000000 r __kstrtab_nfs_pageio_resend	[nfs]
-0000000000000000 t nfs_pgio_release	[nfs]
-0000000000000000 t nfs_initiate_pgio.cold	[nfs]
-0000000000000000 t nfs_pgio_prepare	[nfs]
-0000000000000000 t kmalloc_array	[nfs]
-0000000000000000 t nfs_pageio_error_cleanup.part.0	[nfs]
-0000000000000000 t nfs_pageio_doio	[nfs]
-0000000000000000 t __nfs_create_request.part.0	[nfs]
-0000000000000000 b nfs_page_cachep	[nfs]
-0000000000000000 r nfs_pgio_common_ops	[nfs]
-0000000000000000 t nfs_generic_pg_pgios	[nfs]
-0000000000000000 t nfs_create_subreq	[nfs]
-0000000000000000 t nfs_pgio_result	[nfs]
-0000000000000000 t nfs_pgio_result.cold	[nfs]
-0000000000000000 r __func__.77615	[nfs]
-0000000000000000 t __nfs_pageio_add_request	[nfs]
-0000000000000000 t nfs_do_recoalesce	[nfs]
-0000000000000000 t nfs_unlock_request.cold	[nfs]
-0000000000000000 t nfs_page_group_destroy	[nfs]
-0000000000000000 r .LC2	[nfs]
-0000000000000000 r .LC3	[nfs]
-0000000000000000 r .LC5	[nfs]
-0000000000000000 r __ksymtab_nfs_pageio_init_read	[nfs]
-0000000000000000 r __kstrtab_nfs_pageio_init_read	[nfs]
-0000000000000000 r __ksymtab_nfs_pageio_reset_read_mds	[nfs]
-0000000000000000 r __kstrtab_nfs_pageio_reset_read_mds	[nfs]
-0000000000000000 r nfs_rw_read_ops	[nfs]
-0000000000000000 t nfs_initiate_read	[nfs]
-0000000000000000 t nfs_readhdr_free	[nfs]
-0000000000000000 b nfs_rdata_cachep	[nfs]
-0000000000000000 t nfs_readhdr_alloc	[nfs]
-0000000000000000 t nfs_readpage_release	[nfs]
-0000000000000000 t nfs_readpage_release.cold	[nfs]
-0000000000000000 t nfs_readpage_done	[nfs]
-0000000000000000 t nfs_readpage_result	[nfs]
-0000000000000000 t nfs_page_group_set_uptodate	[nfs]
-0000000000000000 t nfs_async_read_error	[nfs]
-0000000000000000 t nfs_return_empty_page	[nfs]
-0000000000000000 t nfs_read_completion	[nfs]
-0000000000000000 t readpage_async_filler	[nfs]
-0000000000000000 r nfs_async_read_completion_ops	[nfs]
-0000000000000000 t nfs_readpage.cold	[nfs]
-0000000000000000 t nfs_readpages.cold	[nfs]
-0000000000000000 r .LC0	[nfs]
-0000000000000000 r .LC4	[nfs]
-0000000000000000 r .LC5	[nfs]
-0000000000000000 t nfs_symlink_filler	[nfs]
-0000000000000000 t nfs_get_link	[nfs]
-0000000000000000 r .LC1	[nfs]
-0000000000000000 r .LC3	[nfs]
-0000000000000000 t nfs_unlink_prepare	[nfs]
-0000000000000000 t nfs_rename_prepare	[nfs]
-0000000000000000 t nfs_do_call_unlink	[nfs]
+0000000000000000 r __func__.87038	[nfs]
+0000000000000000 t __nfs_revalidate_inode.cold	[nfs]
+0000000000000000 t nfs_revalidate_mapping.cold	[nfs]
+0000000000000000 d nfs_net_ops	[nfs]
+0000000000000000 t exit_nfs_fs	[nfs]
+0000000000000000 r __param_enable_ino64	[nfs]
+0000000000000000 r __param_str_enable_ino64	[nfs]
+0000000000000000 r .LC15	[nfs]
+0000000000000000 r __ksymtab_nfs_fs_type	[nfs]
+0000000000000000 r __kstrtab_nfs_fs_type	[nfs]
+0000000000000000 r __ksymtab_nfs_sops	[nfs]
+0000000000000000 r __kstrtab_nfs_sops	[nfs]
+0000000000000000 r __ksymtab_nfs4_fs_type	[nfs]
+0000000000000000 r __kstrtab_nfs4_fs_type	[nfs]
+0000000000000000 r __ksymtab_nfs_sb_active	[nfs]
+0000000000000000 r __kstrtab_nfs_sb_active	[nfs]
+0000000000000000 r __ksymtab_nfs_sb_deactive	[nfs]
+0000000000000000 r __kstrtab_nfs_sb_deactive	[nfs]
+0000000000000000 r __ksymtab_nfs_statfs	[nfs]
+0000000000000000 r __kstrtab_nfs_statfs	[nfs]
+0000000000000000 r __ksymtab_nfs_show_options	[nfs]
+0000000000000000 r __kstrtab_nfs_show_options	[nfs]
+0000000000000000 r __ksymtab_nfs_show_devname	[nfs]
+0000000000000000 r __kstrtab_nfs_show_devname	[nfs]
+0000000000000000 r __ksymtab_nfs_show_path	[nfs]
+0000000000000000 r __kstrtab_nfs_show_path	[nfs]
+0000000000000000 r __ksymtab_nfs_show_stats	[nfs]
+0000000000000000 r __kstrtab_nfs_show_stats	[nfs]
+0000000000000000 r __ksymtab_nfs_umount_begin	[nfs]
+0000000000000000 r __kstrtab_nfs_umount_begin	[nfs]
+0000000000000000 r __ksymtab_nfs_auth_info_match	[nfs]
+0000000000000000 r __kstrtab_nfs_auth_info_match	[nfs]
+0000000000000000 r __ksymtab_nfs_try_mount	[nfs]
+0000000000000000 r __kstrtab_nfs_try_mount	[nfs]
+0000000000000000 r __ksymtab_nfs_remount	[nfs]
+0000000000000000 r __kstrtab_nfs_remount	[nfs]
+0000000000000000 r __ksymtab_nfs_fill_super	[nfs]
+0000000000000000 r __kstrtab_nfs_fill_super	[nfs]
+0000000000000000 r __ksymtab_nfs_set_sb_security	[nfs]
+0000000000000000 r __kstrtab_nfs_set_sb_security	[nfs]
+0000000000000000 r __ksymtab_nfs_clone_sb_security	[nfs]
+0000000000000000 r __kstrtab_nfs_clone_sb_security	[nfs]
+0000000000000000 r __ksymtab_nfs_fs_mount_common	[nfs]
+0000000000000000 r __kstrtab_nfs_fs_mount_common	[nfs]
+0000000000000000 r __ksymtab_nfs_fs_mount	[nfs]
+0000000000000000 r __kstrtab_nfs_fs_mount	[nfs]
+0000000000000000 r __ksymtab_nfs_kill_super	[nfs]
+0000000000000000 r __kstrtab_nfs_kill_super	[nfs]
+0000000000000000 r __ksymtab_nfs_callback_nr_threads	[nfs]
+0000000000000000 r __kstrtab_nfs_callback_nr_threads	[nfs]
+0000000000000000 r __ksymtab_nfs_callback_set_tcpport	[nfs]
+0000000000000000 r __kstrtab_nfs_callback_set_tcpport	[nfs]
+0000000000000000 r __ksymtab_nfs_idmap_cache_timeout	[nfs]
+0000000000000000 r __kstrtab_nfs_idmap_cache_timeout	[nfs]
+0000000000000000 r __ksymtab_nfs4_disable_idmapping	[nfs]
+0000000000000000 r __kstrtab_nfs4_disable_idmapping	[nfs]
+0000000000000000 r __ksymtab_max_session_slots	[nfs]
+0000000000000000 r __kstrtab_max_session_slots	[nfs]
+0000000000000000 r __ksymtab_max_session_cb_slots	[nfs]
+0000000000000000 r __kstrtab_max_session_cb_slots	[nfs]
+0000000000000000 r __ksymtab_send_implementation_id	[nfs]
+0000000000000000 r __kstrtab_send_implementation_id	[nfs]
+0000000000000000 r __ksymtab_nfs4_client_id_uniquifier	[nfs]
+0000000000000000 r __kstrtab_nfs4_client_id_uniquifier	[nfs]
+0000000000000000 r __ksymtab_recover_lost_locks	[nfs]
+0000000000000000 r __kstrtab_recover_lost_locks	[nfs]
+0000000000000000 t nfs_initialise_sb	[nfs]
+0000000000000000 t nfs_clone_super	[nfs]
+0000000000000000 t nfs_statfs.cold	[nfs]
+0000000000000000 r __func__.79706	[nfs]
+0000000000000000 t nfs_show_mount_options	[nfs]
+0000000000000000 r nfs_info.79771	[nfs]
+0000000000000000 r sec_flavours.79718	[nfs]
+0000000000000000 t nfs_parse_security_flavors	[nfs]
+0000000000000000 r nfs_secflavor_tokens	[nfs]
+0000000000000000 r CSWTCH.283	[nfs]
+0000000000000000 t nfs_parse_security_flavors.cold	[nfs]
+0000000000000000 t nfs_get_option_ul	[nfs]
+0000000000000000 t param_set_portnr	[nfs]
+0000000000000000 t nfs_parse_mount_options	[nfs]
+0000000000000000 r nfs_mount_option_tokens	[nfs]
+0000000000000000 r nfs_xprt_protocol_tokens	[nfs]
+0000000000000000 d nfs_lookupcache_tokens	[nfs]
+0000000000000000 d nfs_local_lock_tokens	[nfs]
+0000000000000000 d nfs_vers_tokens	[nfs]
+0000000000000000 t nfs_parse_mount_options.cold	[nfs]
+0000000000000000 t nfs_set_super	[nfs]
+0000000000000000 t nfs_compare_super	[nfs]
+0000000000000000 t nfs_xdev_mount	[nfs]
+0000000000000000 t nfs_xdev_mount.cold	[nfs]
+0000000000000000 t nfs_verify_server_address	[nfs]
+0000000000000000 t nfs_verify_server_address.cold	[nfs]
+0000000000000000 t nfs_free_parsed_mount_data.part.0	[nfs]
+0000000000000000 t nfs_request_mount.constprop.0	[nfs]
+0000000000000000 t nfs_request_mount.constprop.0.cold	[nfs]
+0000000000000000 t nfs_try_mount.cold	[nfs]
+0000000000000000 t nfs_alloc_parsed_mount_data	[nfs]
+0000000000000000 t nfs_fs_mount.cold	[nfs]
+0000000000000000 d acl_shrinker	[nfs]
+0000000000000000 r __param_recover_lost_locks	[nfs]
+0000000000000000 r __param_str_recover_lost_locks	[nfs]
+0000000000000000 r __param_send_implementation_id	[nfs]
+0000000000000000 r __param_str_send_implementation_id	[nfs]
+0000000000000000 r __param_max_session_cb_slots	[nfs]
+0000000000000000 r __param_str_max_session_cb_slots	[nfs]
+0000000000000000 r __param_max_session_slots	[nfs]
+0000000000000000 r __param_str_max_session_slots	[nfs]
+0000000000000000 r __param_nfs4_unique_id	[nfs]
+0000000000000000 r __param_str_nfs4_unique_id	[nfs]
+0000000000000000 r __param_string_nfs4_unique_id	[nfs]
+0000000000000000 r __param_nfs4_disable_idmapping	[nfs]
+0000000000000000 r __param_str_nfs4_disable_idmapping	[nfs]
+0000000000000000 r __param_nfs_idmap_cache_timeout	[nfs]
+0000000000000000 r __param_str_nfs_idmap_cache_timeout	[nfs]
+0000000000000000 r __param_callback_nr_threads	[nfs]
+0000000000000000 r __param_str_callback_nr_threads	[nfs]
+0000000000000000 r __param_callback_tcpport	[nfs]
+0000000000000000 r __param_str_callback_tcpport	[nfs]
+0000000000000000 r param_ops_portnr	[nfs]
+0000000000000000 r .LC120	[nfs]
+0000000000000000 r __ksymtab_nfs_dreq_bytes_left	[nfs]
+0000000000000000 r __kstrtab_nfs_dreq_bytes_left	[nfs]
+0000000000000000 t nfs_direct_count_bytes	[nfs]
+0000000000000000 t nfs_direct_pgio_init	[nfs]
+0000000000000000 t nfs_direct_set_hdr_verf	[nfs]
+0000000000000000 t nfs_direct_wait	[nfs]
 0000000000000000 r nfs_unlink_ops	[nfs]
 0000000000000000 t nfs_async_unlink_done	[nfs]
 0000000000000000 t nfs_async_rename_done	[nfs]
+ fail=1
+ md5sum /proc/kallsyms
+ md5sum 2
+ sed 's/ .*//' 3
+ sed 's/ .*//' 4
+ compare sum.proc sum.2
+ compare_dev_null_ sum.proc sum.2
+ test 2 = 2
+ test xsum.proc = x/dev/null
+ test xsum.2 = x/dev/null
+ return 2
+ case $? in
+ compare_ sum.proc sum.2
+ diff -u sum.proc sum.2
--- sum.proc	2020-01-29 12:04:37.172963999 +0000
+++ sum.2	2020-01-29 12:04:37.175964009 +0000
@@ -1 +1 @@
-226cd09830f68c56edda0b9272be66e4
+37d7e78173b2a31d5f27cc66aa52e72a
+ fail=1
+ Exit 1
+ set +e
+ exit 1
+ exit 1
+ remove_tmp_
+ __st=1
+ cleanup_
+ :
+ test '' = yes
+ cd /builddir/build/BUILD/coreutils-8.31/separate
+ chmod -R u+rwx /builddir/build/BUILD/coreutils-8.31/separate/gt-proc-short-read.sh.lINR
+ rm -rf /builddir/build/BUILD/coreutils-8.31/separate/gt-proc-short-read.sh.lINR
+ exit 1
FAIL tests/cp/proc-short-read.sh (exit status: 1)