classification
Title: binascii.c:1578:1: error: the control flow of function ‘binascii_crc32’ does not match its profile data (counter ‘arcs’)
Type: compile error Stage: needs patch
Components: Build Versions: Python 3.8, Python 3.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: anthonypjshaw, dacut, ncoghlan, wencan, xtreak
Priority: normal Keywords:

Created on 2018-09-27 13:58 by wencan, last changed 2020-06-17 23:24 by ncoghlan.

Messages (5)
msg326563 - (view) Author: wencan (wencan) Date: 2018-09-27 13:58
git version: a94ee12c26aa8dd7dce01373779df8055aff765b

/home/wencan/Projects/github.com/python/cpython/Modules/binascii.c: In function ‘binascii_crc32’:
/home/wencan/Projects/github.com/python/cpython/Modules/binascii.c:1578:1: error: the control flow of function ‘binascii_crc32’ does not match its profile data (counter ‘arcs’) [-Werror=coverage-mismatch]
 }
 ^
/home/wencan/Projects/github.com/python/cpython/Modules/binascii.c:1578:1: error: the control flow of function ‘binascii_crc32’ does not match its profile data (counter ‘time_profiler’) [-Werror=coverage-mismatch]
msg326580 - (view) Author: Karthikeyan Singaravelan (xtreak) * (Python committer) Date: 2018-09-27 18:39
Thanks for the report. 

* Can you please add the OS, GCC details, full traceback and command that triggers the error? 
* Is it consistent?
* Are you adding a flag to treat all the warnings as errors? 

I assume you are running PGO. As I can see on the bots for PGO they are green on Debian for the commit : https://buildbot.python.org/all/#/builders/47/builds/1609/steps/2/logs/stdio .  There is a issue related to PGO that causes internal compiler error but I don't think it's related here and it suggests doing make clean since previous build artifacts might cause an issue : https://bugs.python.org/issue31963#msg305708
msg341574 - (view) Author: anthony shaw (anthonypjshaw) * (Python triager) Date: 2019-05-06 17:38
There is not enough information to triage this issue and since the last request there has been no reply. Closing issue.
msg352754 - (view) Author: David Cuthbert (dacut) * Date: 2019-09-18 20:57
I'm seeing this on a rebuild now of Python 3.7.4 on Ubuntu 18.04 (in my case against _ssl.c).

What's happening is there's coverage/profiling data being generated in the build chain (somewhere), which spits out files named *.gcda. Interestingly, make clean does *not* clean these files up.

gcc is attempting to use this data in its optimization, but discovers that it's now bogus -- likely due to system library headers (like OpenSSL) being updated in the meantime, with some inline code causing the coverage data to become invalid.

The fix should be to have 'make clean' clean up these *.gcda files. In the meantime, the workaround is to run "find . -name \*.gcda -exec rm '{}' \;"
msg371783 - (view) Author: Nick Coghlan (ncoghlan) * (Python committer) Date: 2020-06-17 23:24
I'm seeing this as well when attempting to run an optimised Python 3.8 build on an old Debian 9 system (with the curses and socket extension modules).

For example:

cpython/Modules/socketmodule.c: In function ‘PyInit__socket’:
cpython/Modules/socketmodule.c:8304:1: error: the control flow of function ‘PyInit__socket’ does not match its profile data (counter ‘arcs’) [-Werror=coverage-mismatch]
cpython/Modules/socketmodule.c:8304:1: error: the control flow of function ‘PyInit__socket’ does not match its profile data (counter ‘time_profiler’) [-Werror=coverage-mismatch]

That said, I did install missing optional dependendencies and then do a reconfigure without doing a "make clean", which is pretty dubious.

So David's assessment here sounds good to me: the bug is that "make clean" should be removing the intermediate PGO files, but is currently leaving them lying around.
History
Date User Action Args
2020-06-17 23:24:12ncoghlansetnosy: + ncoghlan
messages: + msg371783
2019-09-18 21:16:21ned.deilysetstatus: closed -> open
stage: resolved -> needs patch
2019-09-18 20:58:29dacutsetversions: + Python 3.8
2019-09-18 20:57:42dacutsetnosy: + dacut

messages: + msg352754
versions: + Python 3.7, - Python 3.8
2019-05-06 17:38:50anthonypjshawsetstatus: open -> closed

nosy: + anthonypjshaw
messages: + msg341574

stage: resolved
2018-09-27 18:39:14xtreaksetmessages: + msg326580
2018-09-27 18:27:21xtreaksetnosy: + xtreak
2018-09-27 13:58:02wencancreate