Bug 2005686 - error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘use_tracing’; did you mean ‘tracing’?
Summary: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘use_tracing’; ...
Keywords:
Status: CLOSED CANTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: python3.10
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Python Maintainers
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-09-19 14:35 UTC by Ankur Sinha (FranciscoD)
Modified: 2021-09-24 10:11 UTC (History)
7 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2021-09-23 18:21:46 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Ankur Sinha (FranciscoD) 2021-09-19 14:35:08 UTC
Description of problem:

While trying to package numba for Fedora, my builds on rawhide are failing with this error:


  numba/_dispatcher.cpp: In function ‘int call_trace(Py_tracefunc, PyObject*, PyThreadState*, PyFrameObject*, int, PyObject*)’:                     numba/_dispatcher.cpp:28:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘use_tracing’; did you mean ‘tracing’?                    28 |     tstate->use_tracing = 0;                                                                                                                    |             ^~~~~~~~~~~                                                                                                                         |             tracing                                                                                                                       numba/_dispatcher.cpp:30:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘use_tracing’; did you mean ‘tracing’?                    30 |     tstate->use_tracing = ((tstate->c_tracefunc != NULL)                                                                                        |             ^~~~~~~~~~~                                                                                                                         |             tracing                                                                                                                       numba/_dispatcher.cpp: In function ‘PyObject* call_cfunc(Dispatcher*, PyObject*, PyObject*, PyObject*, PyObject*)’:
  numba/_dispatcher.cpp:387:17: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘use_tracing’; did you mean ‘tracing’?
    387 |     if (tstate->use_tracing && tstate->c_profilefunc)
        |                 ^~~~~~~~~~~
        |                 tracing
  numba/_dispatcher.cpp: In function ‘PyObject* Dispatcher_call(Dispatcher*, PyObject*, PyObject*)’:
  numba/_dispatcher.cpp:663:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘use_tracing’; did you mean ‘tracing’?
    663 |     if (ts->use_tracing && ts->c_profilefunc) {
        |             ^~~~~~~~~~~
        |             tracing
  numba/_dispatcher.cpp: In function ‘PyObject* Dispatcher_cuda_call(Dispatcher*, PyObject*, PyObject*)’:
  numba/_dispatcher.cpp:777:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘use_tracing’; did you mean ‘tracing’?
    777 |     if (ts->use_tracing && ts->c_profilefunc) {
        |             ^~~~~~~~~~~
        |             tracing



I found https://bugzilla.redhat.com/show_bug.cgi?id=1958938#c1 and other bugs where this was also seen, and it was noted to be a regression in Python (with a PR for Cython).

I was wondering if this is still the case?

Note that numba currently does not list python 3.10 as supported, so it could just be that it needs updating. But I thought I'd ask :)

Version-Release number of selected component (if applicable):
python3-devel-3.10.0~rc2-2.fc36.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Try building numba package. WIP spec is here https://pagure.io/python-numba/blob/main/f/python-numba.spec
2.
3.

Comment 1 Miro Hrončok 2021-09-19 19:11:47 UTC
Yes, I believe this is a regression in Python, but it will not be fixed in time for Python 3.10. See https://bugs.python.org/issue43760

Unfortunately, numba code needs to be changed :(

Comment 2 Ankur Sinha (FranciscoD) 2021-09-21 15:42:23 UTC
Ah, no worries. We see that there's a PR for getting numba to work with py3.10, and it looks like there's some work needed there too (they've addressed the error I noted above in a commit too). So we'll just wait until they officially support 3.10 and then see how things go.

https://github.com/numba/numba/pull/7381


Please close this bug if you folks don't need it to track the regression.

Cheers,

Comment 3 Victor Stinner 2021-09-23 09:06:43 UTC
I created https://github.com/python/cpython/pull/28527 to document how to update C extensions using PyThreadState.use_tracing: "tstate->use_tracing" must be replaced with "tstate->cframe->use_tracing".

Comment 4 Victor Stinner 2021-09-24 10:11:07 UTC
I'm also working on a new C API to abstract access to PyThreadState: https://github.com/python/cpython/pull/28542


Note You need to log in before you can comment on or make changes to this bug.