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
Add cpdef declarations in pxd files when overwriting a cdef method #23227
Comments
Upstream: Reported upstream. No feedback yet. |
This comment has been minimized.
This comment has been minimized.
comment:3
How did you come up with this? Is there a specific concrete problem or just a theoretical bug? By the way, the gist link talks about " |
comment:4
Replying to @jdemeyer:
Yeah, this caused a segfault that saraedum and I spent 10 hours yesterday debugging, while working on #23218. Because the vtable is screwed up, function calls behave unpredictably.
Yeah, I agree that the link is not that informative. I wrote something easy to try to get an idea of the scope of the problem, then determined that it wasn't easy to actually find the cases where the problem actually occurs (which is, indeed, where a cdef method is overwritten by a cpdef method without a corresponding entry in the pxd file). I decided that I wanted to move on and work on other stuff, so I uploaded the gist as a place to start looking. |
comment:5
Replying to @roed314:
In particular, we noticed the problem for |
comment:6
Honestly, I don't think it is realistic to fix the general problem in Sage since the underlying problem is in upstream Cython. Of course, we can fix specific cases like the |
comment:7
Replying to @jdemeyer:
Sure, and I'm fine waiting to see what Cython does. But one possible thing for them to do is to require a cpdef declaration in the pxd file, in which case this ticket can track those additions. |
comment:8
Replying to @roed314:
Cython will soon raise an error in these cases. I think the best thing to do is to wait until we update to a new version of Cython and change these pxd files then. I think it's worth leaving this ticket open until that point in case someone else runs into a similar problem. |
Changed upstream from Reported upstream. No feedback yet. to Fixed upstream, but not in a stable release. |
Author: Jeroen Demeyer |
comment:10
Replying to @roed314:
I convinced Cython upstream to downgrade this to a warning for now. That will make our life easier, since we can first upgrade to Cython 0.26 (in beta now) and then fix this gradually. |
Dependencies: #23360 |
Branch: u/roed/fix_cpdef |
Branch pushed to git repo; I updated commit sha1. New commits:
|
Commit: |
Changed author from Jeroen Demeyer to David Roe |
comment:14
Ready for review? |
comment:15
Why restrict to |
comment:16
Yeah, I just got lazy going through and figuring out all the functions that I'd actually changed. I used the log of warnings to find the places to edit, so I think I got them all, but I haven't rebuilt from scratch to check. |
comment:17
Yeah, I think this is ready for review. I don't have anything else to add to it. |
comment:18
Replying to @roed314:
Even if you didn't catch them all, that's not really a problem. |
Changed branch from u/roed/fix_cpdef to u/jdemeyer/fix_cpdef |
Reviewer: Jeroen Demeyer |
comment:20
Rebased to 8.1.beta1 New commits:
|
comment:21
Why this? - cpdef normalize(self)
+ cpdef normalize(self, include_zeroth_moment = *) |
comment:22
In some cases, I am wondering whether it is better to add "abstract" Concretely for this ticket, I would like to fix only the totally uncontroversial cases (for example, undoing the changes to quaternion algebra elements) and leave the rest for a follow-up. |
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
|
comment:24
positive_review to this strict subset of the original patch. |
This comment has been minimized.
This comment has been minimized.
comment:26
See #23600 for the followup. |
Changed dependencies from #23360 to none |
Changed branch from u/jdemeyer/fix_cpdef to |
See cython/cython#1732.
Upstream: Fixed upstream, but not in a stable release.
CC: @saraedum
Component: cython
Author: David Roe
Branch/Commit:
919de01
Reviewer: Jeroen Demeyer
Issue created by migration from https://trac.sagemath.org/ticket/23227
The text was updated successfully, but these errors were encountered: