Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] use of incomplete type PyFrameObject in __Pyx_PyFrame_SetLineNumber/__Pyx_AddTraceback #4681

Closed
gastineau opened this issue Mar 14, 2022 · 2 comments

Comments

@gastineau
Copy link
Contributor

Describe the bug
A clear and concise description of what the bug is.

In generated c code, the generated macro __Pyx_PyFrame_SetLineNumber still uses fields of PyFrameObject, but PyFrameObject has moved to internal API.
I was fixing the reported bug https://bugzilla.redhat.com/show_bug.cgi?id=2062338
but it appears that the problem comes from the generated code by cython.

python 3.10 and cython works fine on this code.

After removing some warnings, I still obtain this error with the last docker image of python : 3.11-rc-bullseye

gcc -I../../src -g -O2 -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/calceph/src -I/usr/local/include/python3.11 -c calcephpy.c -o build/temp.linux-x86_64-3.11/calcephpy.o
calcephpy.c: In function ‘__Pyx_AddTraceback’:
calcephpy.c:438:62: error: invalid use of incomplete typedef ‘PyFrameObject’ {aka ‘struct _frame’}
  438 |   #define __Pyx_PyFrame_SetLineNumber(frame, lineno)  (frame)->f_lineno = (lineno)
      |                                                              ^~
calcephpy.c:23634:5: note: in expansion of macro ‘__Pyx_PyFrame_SetLineNumber’
23634 |     __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~

To Reproduce
Code to reproduce the behaviour:

wget https://www.imcce.fr/content/medias/recherche/equipes/asd/calceph/calceph-3.5.1.tar.gz
tar xzf calceph-3.5.1.tar.gz
cd calceph-3.5.1
cd pythonapi/src
cython -3 calcephpy.pyx
cd ../..
./configure --enable-python=yes --enable-fortran=no && make

Expected behavior
A clear and concise description of what you expected to happen.

Environment (please complete the following information):

  • OS: Linux
  • Python version 3.11.0a6
  • Cython version 0.29.28

Additional context
Add any other context about the problem here.

Another project has maybe the same issue :
https://www.mail-archive.com/[email protected]/msg1906195.html

@gastineau
Copy link
Contributor Author

@da-woods
Copy link
Contributor

I'm pretty sure this was fixed in 7537910 and afc00fc (depending on the Cython version) - it just hasn't made it into a release yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants