Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Python 3.13#2454

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
filmor merged 12 commits intomasterfrompython3.13
Dec 13, 2024
Merged

Python 3.13#2454

filmor merged 12 commits intomasterfrompython3.13
Dec 13, 2024

Conversation

filmor
Copy link
Member

@filmorfilmor commentedSep 19, 2024
edited
Loading

This is crashing right now.

  • Investigate whether the generated type offsets are correct (investigated, but missed an error, seePython 3.13 #2454 (comment))
  • Decide how to deal with the removedGetter for the thread state
  • Find out why it crashes :)

RobPasMue, FelixSchwarz, and mpottinger reacted with thumbs up emoji
@lostmsu
Copy link
Member

Enable tests for 3.13 in the same PR?

@RobPasMue
Copy link
Contributor

@filmor@lostmsu - is there a plan for enabling support for 3.13? I see this PR has been stale for quite a while already. Just checking what's the status :)

porly1985 and dipinknair reacted with thumbs up emoji

@filmor
Copy link
MemberAuthor

All development is public. You can see here that the "simple" approach of adding new offsets (that I have indeed verified) fails. Debugging gave me additionally that it crashes in some very early dictionary access, but I don't really know how to go further.

RobPasMue and dipinknair reacted with thumbs up emoji

@kunom
Copy link

According tocvdump "c:\Program Files\Python313\python313.pdb" (cvdump fromhere), thePyHeapTypeStruct is stated to have a size of 928 bytes:

[...]S_UDT:             0x1211, PyHeapTypeObject[...]0x1211 : Length = 58, Leaf = 0x1505 LF_STRUCTURE# members = 13,  field list type 0x1210, Derivation list type 0x0000, VT shape type 0x0000Size = 928, class name = _heaptypeobject, unique name = .?AU_heaptypeobject@@, UDT(0x00001211)[...]

However, when I look at the value of theTypeOffset313.init value, it is also 928.
image

We seem to have one property too much, don't we?

lostmsu reacted with thumbs up emoji

@filmor
Copy link
MemberAuthor

filmor commentedDec 12, 2024
edited
Loading

Aaah, got it, thanks@kunom!

The issue is that, unlike all other members, the newtp_watched andtp_versions_used attributes arechar anduint16_t. I'll update ourgeninterop script to pick this up and release a new version latest tomorrow (CET).

I might have to release a new version ofclr-loader as well to bump thecffi dependency.

/edit: Actually, fixing the generator requires more work that I don't think is worth the effort, seeing that we should remove the direct type offsets eventually. I will just lazy-fix this by dropping one of the fields, alignment does the rest.

@filmorfilmor marked this pull request as ready for reviewDecember 12, 2024 19:29
@kunom
Copy link

kunom commentedDec 12, 2024
edited
Loading

Not shure whether this still matters, but I was finally able to produce an offset listing of the full 3.13 structPyHeapTypeObject usingGhidra reverse engineering. According to that tool, the following struct members have a size different from 8:

NameSize
tp_flags4
tp_version_tag4
tp_watched1 (as stated above)
tp_versions_used2 (as stated above)
getitem_version4

But as you correctly noted, due to alignment, only thetp_watched;tp_versions_used; combination matters.

@filmor
Copy link
MemberAuthor

On my local machine, the embedding tests also pass for 3.13. I'll have to spend some more time tomorrow to get the CI going, but I'm quite confident that I can release a new version either tomorrow or this weekend.

RobPasMue and dipinknair reacted with hooray emojiryan-kipawa and mpottinger reacted with heart emoji

@filmorfilmorforce-pushed thepython3.13 branch 3 times, most recently from21f3ffa to1920b19CompareDecember 13, 2024 07:59
Verified them locally, but there is an issue with the Github workflowimage that can hopefully be resolved later by using a full venvinstead of relying on the system environment.
@filmorfilmor merged commit4132a36 intomasterDec 13, 2024
32 of 33 checks passed
@filmorfilmor deleted the python3.13 branchDecember 13, 2024 08:26
@lostmsu
Copy link
Member

lostmsu commentedDec 13, 2024
edited
Loading

Not that I'm against 3.13 support, but this seems to fail multiple tests and should have been marked alpha, or manually released calling our NuGet monthly build for preview packages, IMHO.

@filmor
Copy link
MemberAuthor

It is not failing tests, our CI is just a bit rusty. I ran a many combinations locally and will follow up in the next week to reactivate the excluded platforms.

dipinknair and mpottinger reacted with thumbs up emoji

@RobPasMueRobPasMue mentioned this pull requestJan 8, 2025
5 tasks
@maged-hanna
Copy link

maged-hanna commentedMar 3, 2025
edited
Loading

@filmor I'm receiving a 'Attempted to read or write protected memory' error in my C# code when interacting with Python 3.13. This suggests potential memory corruption. Could this error be due to incompatibility with Python 3.13, or is it a sign that 3.13 is not supported?
var m_threadState = PythonEngine.BeginAllowThreads(); using (Py.GIL()){}

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@kunomkunomkunom left review comments

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

5 participants
@filmor@lostmsu@RobPasMue@kunom@maged-hanna

[8]ページ先頭

©2009-2025 Movatter.jp