Page MenuHomePhabricator

Remove fdelt_chk back-compat code and sanity check
ClosedPublic

Authored by Fabien on Jun 3 2020, 14:44.

Details

Reviewers
deadalnix
Group Reviewers
Restricted Project
Commits
rABC5c0e43d97cd7: Remove fdelt_chk back-compat code and sanity check
Summary
The return type of fdelt_chk changed from unsigned long int to long
int in glibc 2.16. See this commit. Now that we require glibc >=2.17 we
can remove our back-compat code.
[...]

Note: we require glibc >= 2.19 so this also applies to us.

Backport of core PR15146 and PR18862.
PR15146 fix an edge case from the sanity check which is totally removed
by the second commit of PR18862. The diff is then mostly a backport of
the first commit from PR18862:
https://github.com/bitcoin/bitcoin/pull/18862/commits/8bf1540cc235fb8fb5330a7ae8ab638247ceb177

Test Plan

Run the gitian builds.

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Fabien requested review of this revision.Jun 3 2020, 14:44

[Bot Message]
One or more PR numbers were detected in the summary.
Links to those PRs have been inserted into the summary for reference.

Snippet of first build failure:

[14:52:08] :	 [Step 1/2] -- Performing Test HAVE_LARGE_FILE_SUPPORT
[14:52:08] :	 [Step 1/2] -- Performing Test HAVE_LARGE_FILE_SUPPORT - Success
[14:52:08] :	 [Step 1/2] -- Performing Test HAVE_FUNC_ATTRIBUTE_VISIBILITY
[14:52:08] :	 [Step 1/2] -- Performing Test HAVE_FUNC_ATTRIBUTE_VISIBILITY - Success
[14:52:08] :	 [Step 1/2] -- Performing Test HAVE_FUNC_ATTRIBUTE_DLLEXPORT
[14:52:08] :	 [Step 1/2] -- Performing Test HAVE_FUNC_ATTRIBUTE_DLLEXPORT - Failed
[14:52:08] :	 [Step 1/2] -- Found PkgConfig: /usr/bin/pkg-config (found version "0.29") 
[14:52:08] :	 [Step 1/2] -- Looking for pthread.h
[14:52:08] :	 [Step 1/2] -- Looking for pthread.h - found
[14:52:08] :	 [Step 1/2] -- Looking for pthread_create
[14:52:08] :	 [Step 1/2] -- Looking for pthread_create - not found
[14:52:08] :	 [Step 1/2] -- Check if compiler accepts -pthread
[14:52:08] :	 [Step 1/2] -- Check if compiler accepts -pthread - yes
[14:52:08] :	 [Step 1/2] -- Found Threads: TRUE  
[14:52:08] :	 [Step 1/2] -- Found Jemalloc component jemalloc: /usr/lib/x86_64-linux-gnu/libjemalloc_pic.a
[14:52:08]W:	 [Step 1/2] CMake Error at cmake/modules/FindJemalloc.cmake:75 (message):
[14:52:08]W:	 [Step 1/2]   Jemalloc was found, but the configuration failed to build a simple program.
[14:52:08]W:	 [Step 1/2]   Please check it is installed properly or consider disabling it.  Build
[14:52:08]W:	 [Step 1/2]   output: Change Dir: /work/build/CMakeFiles/CMakeTmp
[14:52:08]W:	 [Step 1/2] 
[14:52:08]W:	 [Step 1/2]   
[14:52:08]W:	 [Step 1/2] 
[14:52:08]W:	 [Step 1/2]   Run Build Command:"/usr/bin/ninja" "cmTC_2183b"
[14:52:08]W:	 [Step 1/2] 
[14:52:08]W:	 [Step 1/2]   [1/2] Building C object CMakeFiles/cmTC_2183b.dir/CheckJemallocBuilds.c.o
[14:52:08]W:	 [Step 1/2] 
[14:52:08]W:	 [Step 1/2]   FAILED: CMakeFiles/cmTC_2183b.dir/CheckJemallocBuilds.c.o
[14:52:08]W:	 [Step 1/2] 
[14:52:08]W:	 [Step 1/2]   /usr/bin/cc -isystem /usr/include/jemalloc -Werror -fPIE -pthread -o
[14:52:08]W:	 [Step 1/2]   CMakeFiles/cmTC_2183b.dir/CheckJemallocBuilds.c.o -c
[14:52:08]W:	 [Step 1/2]   /work/cmake/utils/CheckJemallocBuilds.c
[14:52:08]W:	 [Step 1/2] 
[14:52:08]W:	 [Step 1/2]   /work/cmake/utils/CheckJemallocBuilds.c: In function 'main':
[14:52:08]W:	 [Step 1/2] 
[14:52:08]W:	 [Step 1/2]   /work/cmake/utils/CheckJemallocBuilds.c:5:19: error: cast from pointer to
[14:52:08]W:	 [Step 1/2]   integer of different size [-Werror=pointer-to-int-cast]
[14:52:08]W:	 [Step 1/2] 
[14:52:08]W:	 [Step 1/2]        return argc + (int)(malloc(42));
[14:52:08] :	 [Step 1/2] -- Configuring incomplete, errors occurred!
[14:52:08]W:	 [Step 1/2]                      ^
[14:52:08] :	 [Step 1/2] See also "/work/build/CMakeFiles/CMakeOutput.log".
[14:52:08]W:	 [Step 1/2] 
[14:52:08] :	 [Step 1/2] See also "/work/build/CMakeFiles/CMakeError.log".
[14:52:08]W:	 [Step 1/2]   cc1: all warnings being treated as errors
[14:52:08]W:	 [Step 1/2] 
[14:52:08]W:	 [Step 1/2]   ninja: build stopped: subcommand failed.
[14:52:08]W:	 [Step 1/2] 
[14:52:08]W:	 [Step 1/2] Call Stack (most recent call first):
[14:52:08]W:	 [Step 1/2]   src/CMakeLists.txt:233 (find_package)
[14:52:08]W:	 [Step 1/2] 
[14:52:08]W:	 [Step 1/2] 
[14:52:08]W:	 [Step 1/2] ++ print_sanitizers_log
[14:52:08]W:	 [Step 1/2] ++ for log in "${SAN_LOG_DIR}"/*.log.*
[14:52:08]W:	 [Step 1/2] ++ echo '*** Output of /tmp/sanitizer_logs/*.log.* ***'
[14:52:08]W:	 [Step 1/2] ++ cat '/tmp/sanitizer_logs/*.log.*'
[14:52:08] :	 [Step 1/2] *** Output of /tmp/sanitizer_logs/*.log.* ***
[14:52:08]W:	 [Step 1/2] cat: '/tmp/sanitizer_logs/*.log.*': No such file or directory
[14:52:08]W:	 [Step 1/2] cp: cannot stat '/work/ibd/debug.log': No such file or directory
[14:52:11]W:	 [Step 1/2] Process exited with code 1
[14:52:12]E:	 [Step 1/2] Process exited with code 1 (Step: Command Line)

Snippet of first build failure:

[14:48:04] :	 [Step 1/1] (Reading database ... 75%
[14:48:04] :	 [Step 1/1] (Reading database ... 80%
[14:48:04] :	 [Step 1/1] (Reading database ... 85%
[14:48:04] :	 [Step 1/1] (Reading database ... 90%
[14:48:04] :	 [Step 1/1] (Reading database ... 95%
[14:48:04] :	 [Step 1/1] (Reading database ... 100%
[14:48:04] :	 [Step 1/1] (Reading database ... 17694 files and directories currently installed.)
[14:48:04] :	 [Step 1/1] Removing rsyslog (8.1901.0-1) ...
[14:48:04] :	 [Step 1/1] invoke-rc.d: could not determine current runlevel
[14:48:04] :	 [Step 1/1] Stopping enhanced syslogd: rsyslogd already stopped.
[14:48:04] :	 [Step 1/1] (Reading database ... 
[14:48:04] :	 [Step 1/1] (Reading database ... 5%
[14:48:04] :	 [Step 1/1] (Reading database ... 10%
[14:48:04] :	 [Step 1/1] (Reading database ... 15%
[14:48:04] :	 [Step 1/1] (Reading database ... 20%
[14:48:04] :	 [Step 1/1] (Reading database ... 25%
[14:48:04] :	 [Step 1/1] (Reading database ... 30%
[14:48:04] :	 [Step 1/1] (Reading database ... 35%
[14:48:04] :	 [Step 1/1] (Reading database ... 40%
[14:48:04] :	 [Step 1/1] (Reading database ... 45%
[14:48:04] :	 [Step 1/1] (Reading database ... 50%
[14:48:04] :	 [Step 1/1] (Reading database ... 55%
[14:48:04] :	 [Step 1/1] (Reading database ... 60%
[14:48:04] :	 [Step 1/1] (Reading database ... 65%
[14:48:04] :	 [Step 1/1] (Reading database ... 70%
[14:48:04] :	 [Step 1/1] (Reading database ... 75%
[14:48:04] :	 [Step 1/1] (Reading database ... 80%
[14:48:04] :	 [Step 1/1] (Reading database ... 85%
[14:48:04] :	 [Step 1/1] (Reading database ... 90%
[14:48:04] :	 [Step 1/1] (Reading database ... 95%
[14:48:04] :	 [Step 1/1] (Reading database ... 100%
[14:48:04] :	 [Step 1/1] (Reading database ... 17636 files and directories currently installed.)
[14:48:04] :	 [Step 1/1] Purging configuration files for rsyslog (8.1901.0-1) ...
[14:48:04] :	 [Step 1/1] Processing triggers for systemd (241-7~deb10u3) ...
[14:48:04] :	 [Step 1/1] Adding 'local diversion of /sbin/initctl to /sbin/initctl.distrib'
[14:48:04] :	 [Step 1/1] Adding 'local diversion of /usr/bin/ischroot to /usr/bin/ischroot.distrib'
[14:48:04]W:	 [Step 1/1] dpkg-divert: warning: diverting file '/usr/bin/ischroot' from an Essential package with rename is dangerous, use --no-rename
[14:48:04] :	 [Step 1/1] Adding 'local diversion of /usr/sbin/policy-rc.d to /usr/sbin/policy-rc.d.distrib'
[14:48:04] :	 [Step 1/1] Starting target
[14:48:05] :	 [Step 1/1] Checking if target is up
[14:48:05] :	 [Step 1/1] Preparing build environment
[14:48:08] :	 [Step 1/1] Adding multiarch support (log in var/install.log)
[14:48:09] :	 [Step 1/1] Updating apt-get repository (log in var/install.log)
[14:48:22] :	 [Step 1/1] Installing additional packages (log in var/install.log)
[14:49:17] :	 [Step 1/1] Upgrading system, may take a while (log in var/install.log)
[14:49:25] :	 [Step 1/1] Creating package manifest
[14:49:30] :	 [Step 1/1] Creating build script (var/build-script)
[14:49:32] :	 [Step 1/1] Running build script (log in var/build.log)
[14:52:11]W:	 [Step 1/1] ./bin/gbuild:23:in `system!': failed to run on-target setarch x86_64 bash -x < var/build-script > var/build.log 2>&1 (RuntimeError)
[14:52:11]W:	 [Step 1/1] 	from ./bin/gbuild:169:in `build_one_configuration'
[14:52:11]W:	 [Step 1/1] 	from ./bin/gbuild:320:in `block (2 levels) in <main>'
[14:52:11]W:	 [Step 1/1] 	from ./bin/gbuild:315:in `each'
[14:52:11]W:	 [Step 1/1] 	from ./bin/gbuild:315:in `block in <main>'
[14:52:11]W:	 [Step 1/1] 	from ./bin/gbuild:313:in `each'
[14:52:11]W:	 [Step 1/1] 	from ./bin/gbuild:313:in `<main>'
[14:52:11]W:	 [Step 1/1] ++ move_log
[14:52:11]W:	 [Step 1/1] ++ mv var/install.log /home/teamcity/buildAgent/work/c4a5708f2bae7929/gitian-results/
[14:52:11]W:	 [Step 1/1] ++ mv var/build.log /home/teamcity/buildAgent/work/c4a5708f2bae7929/gitian-results/
[14:52:11]W:	 [Step 1/1] Process exited with code 1
[14:52:11]E:	 [Step 1/1] Process exited with code 1 (Step: Command Line)

Snippet of first build failure:

[14:52:17] :	 [Step 1/2] -- Performing Test HAVE_LARGE_FILE_SUPPORT
[14:52:17] :	 [Step 1/2] -- Performing Test HAVE_LARGE_FILE_SUPPORT - Success
[14:52:17] :	 [Step 1/2] -- Performing Test HAVE_FUNC_ATTRIBUTE_VISIBILITY
[14:52:17] :	 [Step 1/2] -- Performing Test HAVE_FUNC_ATTRIBUTE_VISIBILITY - Success
[14:52:17] :	 [Step 1/2] -- Performing Test HAVE_FUNC_ATTRIBUTE_DLLEXPORT
[14:52:17] :	 [Step 1/2] -- Performing Test HAVE_FUNC_ATTRIBUTE_DLLEXPORT - Failed
[14:52:17] :	 [Step 1/2] -- Found PkgConfig: /usr/bin/pkg-config (found version "0.29") 
[14:52:17] :	 [Step 1/2] -- Looking for pthread.h
[14:52:17] :	 [Step 1/2] -- Looking for pthread.h - found
[14:52:17] :	 [Step 1/2] -- Looking for pthread_create
[14:52:17] :	 [Step 1/2] -- Looking for pthread_create - not found
[14:52:17] :	 [Step 1/2] -- Check if compiler accepts -pthread
[14:52:17] :	 [Step 1/2] -- Check if compiler accepts -pthread - yes
[14:52:17] :	 [Step 1/2] -- Found Threads: TRUE  
[14:52:17] :	 [Step 1/2] -- Found Jemalloc component jemalloc: /usr/lib/x86_64-linux-gnu/libjemalloc_pic.a
[14:52:17]W:	 [Step 1/2] CMake Error at cmake/modules/FindJemalloc.cmake:75 (message):
[14:52:17]W:	 [Step 1/2]   Jemalloc was found, but the configuration failed to build a simple program.
[14:52:17]W:	 [Step 1/2]   Please check it is installed properly or consider disabling it.  Build
[14:52:17]W:	 [Step 1/2]   output: Change Dir: /work/build/CMakeFiles/CMakeTmp
[14:52:17]W:	 [Step 1/2] 
[14:52:17]W:	 [Step 1/2]   
[14:52:17]W:	 [Step 1/2] 
[14:52:17]W:	 [Step 1/2]   Run Build Command:"/usr/bin/ninja" "cmTC_5c957"
[14:52:17]W:	 [Step 1/2] 
[14:52:17]W:	 [Step 1/2]   [1/2] Building C object CMakeFiles/cmTC_5c957.dir/CheckJemallocBuilds.c.o
[14:52:17]W:	 [Step 1/2] 
[14:52:17]W:	 [Step 1/2]   FAILED: CMakeFiles/cmTC_5c957.dir/CheckJemallocBuilds.c.o
[14:52:17]W:	 [Step 1/2] 
[14:52:17]W:	 [Step 1/2]   /usr/bin/cc -isystem /usr/include/jemalloc -Werror -fPIE -pthread -o
[14:52:17]W:	 [Step 1/2]   CMakeFiles/cmTC_5c957.dir/CheckJemallocBuilds.c.o -c
[14:52:17]W:	 [Step 1/2]   /work/cmake/utils/CheckJemallocBuilds.c
[14:52:17]W:	 [Step 1/2] 
[14:52:17]W:	 [Step 1/2]   /work/cmake/utils/CheckJemallocBuilds.c: In function 'main':
[14:52:17]W:	 [Step 1/2] 
[14:52:17]W:	 [Step 1/2]   /work/cmake/utils/CheckJemallocBuilds.c:5:19: error: cast from pointer to
[14:52:17]W:	 [Step 1/2]   integer of different size [-Werror=pointer-to-int-cast]
[14:52:17]W:	 [Step 1/2] 
[14:52:17]W:	 [Step 1/2]        return argc + (int)(malloc(42));
[14:52:17]W:	 [Step 1/2]                      ^
[14:52:17]W:	 [Step 1/2] 
[14:52:17]W:	 [Step 1/2]   cc1: all warnings being treated as errors
[14:52:17]W:	 [Step 1/2] 
[14:52:17]W:	 [Step 1/2]   ninja: build stopped: subcommand failed.
[14:52:17]W:	 [Step 1/2] 
[14:52:17]W:	 [Step 1/2] Call Stack (most recent call first):
[14:52:17]W:	 [Step 1/2]   src/CMakeLists.txt:233 (find_package)
[14:52:17]W:	 [Step 1/2] 
[14:52:17]W:	 [Step 1/2] 
[14:52:17] :	 [Step 1/2] -- Configuring incomplete, errors occurred!
[14:52:17] :	 [Step 1/2] See also "/work/build/CMakeFiles/CMakeOutput.log".
[14:52:17] :	 [Step 1/2] See also "/work/build/CMakeFiles/CMakeError.log".
[14:52:17]W:	 [Step 1/2] ++ print_sanitizers_log
[14:52:17]W:	 [Step 1/2] ++ for log in "${SAN_LOG_DIR}"/*.log.*
[14:52:17]W:	 [Step 1/2] ++ echo '*** Output of /tmp/sanitizer_logs/*.log.* ***'
[14:52:17] :	 [Step 1/2] *** Output of /tmp/sanitizer_logs/*.log.* ***
[14:52:17]W:	 [Step 1/2] ++ cat '/tmp/sanitizer_logs/*.log.*'
[14:52:17]W:	 [Step 1/2] cat: '/tmp/sanitizer_logs/*.log.*': No such file or directory
[14:52:17]W:	 [Step 1/2] cp: cannot stat '/work/ibd/debug.log': No such file or directory
[14:52:21]W:	 [Step 1/2] Process exited with code 1
[14:52:21]E:	 [Step 1/2] Process exited with code 1 (Step: Command Line)

Rebase on master to prevent CI failure

This revision is now accepted and ready to land.Jun 3 2020, 21:16