René's URL Explorer Experiment


Title: TypeManager.pointer_attribute are broken due to incompatibility with the C/C++ memory ownership model. · Issue #490 · Source-Python-Dev-Team/Source.Python · GitHub

Open Graph Title: TypeManager.pointer_attribute are broken due to incompatibility with the C/C++ memory ownership model. · Issue #490 · Source-Python-Dev-Team/Source.Python

X Title: TypeManager.pointer_attribute are broken due to incompatibility with the C/C++ memory ownership model. · Issue #490 · Source-Python-Dev-Team/Source.Python

Description: The values given to pointer_attribute are managed by CustomType's _allocated_pointers/_pointer_values, but since CustomType may be generated from raw pointers, CustomType cannot have ownership of the value. This applies to CustomType gen...

Open Graph Description: The values given to pointer_attribute are managed by CustomType's _allocated_pointers/_pointer_values, but since CustomType may be generated from raw pointers, CustomType cannot have ownership of t...

X Description: The values given to pointer_attribute are managed by CustomType's _allocated_pointers/_pointer_values, but since CustomType may be generated from raw pointers, CustomType cannot have ownership ...

Opengraph URL: https://github.com/Source-Python-Dev-Team/Source.Python/issues/490

X: @github

direct link

Domain: patch-diff.githubusercontent.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"TypeManager.pointer_attribute are broken due to incompatibility with the C/C++ memory ownership model.","articleBody":"1. The values given to pointer_attribute are managed by CustomType's [_allocated_pointers](https://github.com/Source-Python-Dev-Team/Source.Python/blob/0171b36297c23d480c17631561c98c0ff2afca28/addons/source-python/packages/source-python/memory/manager.py#L90)/[_pointer_values](https://github.com/Source-Python-Dev-Team/Source.Python/blob/0171b36297c23d480c17631561c98c0ff2afca28/addons/source-python/packages/source-python/memory/manager.py#L94), but since CustomType may be generated from raw pointers, CustomType cannot have ownership of the value. This applies to CustomType generated by `make_object()`, nested [CustomType](https://github.com/Source-Python-Dev-Team/Source.Python/blob/0171b36297c23d480c17631561c98c0ff2afca28/addons/source-python/packages/source-python/memory/manager.py#L249-L252), and Array generated by static_pointer_array/dynamic_pointer_array.\r\n(See also #480, #489).\r\n\r\n2. If the value set in the pointer_attribute is an object generated by Python/Boost.Python, the memory will eventually be double free if the memory is managed by the C++ side. This can be circumvented by the user, but this is incompatible with the actual [Source.Python implementation](https://github.com/Source-Python-Dev-Team/Source.Python/blob/0171b36297c23d480c17631561c98c0ff2afca28/addons/source-python/packages/source-python/memory/manager.py#L512-L519). Furthermore, this means that when the user handles a pointer_attribute, it must be fully aware of how the memory is managed. While this may be feasible at the library level, it is impractical at the user level.\r\n\r\nThese two problems eventually lead to segmentation violation or double free or memory corruption, and these problems are very difficult or impossible to debug.\r\n\r\nProposal:\r\n\r\nWe should not assign the pointer of an object generated by Python/Boost.Python directly to other memory location, we should always make a copy of it and assign it, as in an [earlier implementation](https://github.com/Source-Python-Dev-Team/Source.Python/commit/7690d9674053a158bc79246dfc64d26a507d5209) (https://github.com/Source-Python-Dev-Team/Source.Python/commit/7690d9674053a158bc79246dfc64d26a507d5209). \r\nhttps://github.com/Source-Python-Dev-Team/Source.Python/blob/7690d9674053a158bc79246dfc64d26a507d5209/addons/source-python/packages/source-python/memory/__init__.py#L394-L399\r\n\r\nThis means that _allocated_pointers/_pointer_values are no longer required. If the user needs to delete a copied object, they can always use [CustomType._destructor](https://github.com/Source-Python-Dev-Team/Source.Python/blob/0171b36297c23d480c17631561c98c0ff2afca28/addons/source-python/packages/source-python/memory/manager.py#L73-L74).","author":{"url":"https://github.com/CookStar","@type":"Person","name":"CookStar"},"datePublished":"2023-08-10T00:21:30.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/490/Source.Python/issues/490"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:87010bcb-0494-1ef7-e04e-e2f62697ef92
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idEAEA:121C5C:296E6CF:37ADCA3:69704A60
html-safe-noncecdc4bafab729028c256d0ed675ed84a6d2189c453ace3e1d4b1fd50397123990
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQUVBOjEyMUM1QzoyOTZFNkNGOjM3QURDQTM6Njk3MDRBNjAiLCJ2aXNpdG9yX2lkIjoiNDU3MDgzNjc0MDg2MjkyMTMxMiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac77eaffe66cc18298e2ae36443ae0cc98f020ef0348104c19348a26b27c7884a8
hovercard-subject-tagissue:1844214000
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/Source-Python-Dev-Team/Source.Python/490/issue_layout
twitter:imagehttps://opengraph.githubassets.com/eb80218eac7d426da3d5c6b76755c130961918880da77227b390f81f3b0902ff/Source-Python-Dev-Team/Source.Python/issues/490
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/eb80218eac7d426da3d5c6b76755c130961918880da77227b390f81f3b0902ff/Source-Python-Dev-Team/Source.Python/issues/490
og:image:altThe values given to pointer_attribute are managed by CustomType's _allocated_pointers/_pointer_values, but since CustomType may be generated from raw pointers, CustomType cannot have ownership of t...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameCookStar
hostnamegithub.com
expected-hostnamegithub.com
None9920a62ba22d06470388e2904804fb7e5ec51c9e35f81784e9191394c74b2bd2
turbo-cache-controlno-preview
go-importgithub.com/Source-Python-Dev-Team/Source.Python git https://github.com/Source-Python-Dev-Team/Source.Python.git
octolytics-dimension-user_id5440368
octolytics-dimension-user_loginSource-Python-Dev-Team
octolytics-dimension-repository_id12771934
octolytics-dimension-repository_nwoSource-Python-Dev-Team/Source.Python
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id12771934
octolytics-dimension-repository_network_root_nwoSource-Python-Dev-Team/Source.Python
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasef643964067a552f02067066d6a910b2f90a5721f
ui-targetcanary-2
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://patch-diff.githubusercontent.com/Source-Python-Dev-Team/Source.Python/issues/490#start-of-content
https://patch-diff.githubusercontent.com/
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2FSource-Python-Dev-Team%2FSource.Python%2Fissues%2F490
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2FSource-Python-Dev-Team%2FSource.Python%2Fissues%2F490
Sign up https://patch-diff.githubusercontent.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=Source-Python-Dev-Team%2FSource.Python
Reloadhttps://patch-diff.githubusercontent.com/Source-Python-Dev-Team/Source.Python/issues/490
Reloadhttps://patch-diff.githubusercontent.com/Source-Python-Dev-Team/Source.Python/issues/490
Reloadhttps://patch-diff.githubusercontent.com/Source-Python-Dev-Team/Source.Python/issues/490
Source-Python-Dev-Team https://patch-diff.githubusercontent.com/Source-Python-Dev-Team
Source.Pythonhttps://patch-diff.githubusercontent.com/Source-Python-Dev-Team/Source.Python
Notifications https://patch-diff.githubusercontent.com/login?return_to=%2FSource-Python-Dev-Team%2FSource.Python
Fork 37 https://patch-diff.githubusercontent.com/login?return_to=%2FSource-Python-Dev-Team%2FSource.Python
Star 170 https://patch-diff.githubusercontent.com/login?return_to=%2FSource-Python-Dev-Team%2FSource.Python
Code https://patch-diff.githubusercontent.com/Source-Python-Dev-Team/Source.Python
Issues 7 https://patch-diff.githubusercontent.com/Source-Python-Dev-Team/Source.Python/issues
Pull requests 7 https://patch-diff.githubusercontent.com/Source-Python-Dev-Team/Source.Python/pulls
Discussions https://patch-diff.githubusercontent.com/Source-Python-Dev-Team/Source.Python/discussions
Actions https://patch-diff.githubusercontent.com/Source-Python-Dev-Team/Source.Python/actions
Security Uh oh! There was an error while loading. Please reload this page. https://patch-diff.githubusercontent.com/Source-Python-Dev-Team/Source.Python/security
Please reload this pagehttps://patch-diff.githubusercontent.com/Source-Python-Dev-Team/Source.Python/issues/490
Insights https://patch-diff.githubusercontent.com/Source-Python-Dev-Team/Source.Python/pulse
Code https://patch-diff.githubusercontent.com/Source-Python-Dev-Team/Source.Python
Issues https://patch-diff.githubusercontent.com/Source-Python-Dev-Team/Source.Python/issues
Pull requests https://patch-diff.githubusercontent.com/Source-Python-Dev-Team/Source.Python/pulls
Discussions https://patch-diff.githubusercontent.com/Source-Python-Dev-Team/Source.Python/discussions
Actions https://patch-diff.githubusercontent.com/Source-Python-Dev-Team/Source.Python/actions
Security https://patch-diff.githubusercontent.com/Source-Python-Dev-Team/Source.Python/security
Insights https://patch-diff.githubusercontent.com/Source-Python-Dev-Team/Source.Python/pulse
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/Source-Python-Dev-Team/Source.Python/issues/490
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/Source-Python-Dev-Team/Source.Python/issues/490
TypeManager.pointer_attribute are broken due to incompatibility with the C/C++ memory ownership model.https://patch-diff.githubusercontent.com/Source-Python-Dev-Team/Source.Python/issues/490#top
https://github.com/CookStar
https://github.com/CookStar
CookStarhttps://github.com/CookStar
on Aug 10, 2023https://github.com/Source-Python-Dev-Team/Source.Python/issues/490#issue-1844214000
_allocated_pointershttps://github.com/Source-Python-Dev-Team/Source.Python/blob/0171b36297c23d480c17631561c98c0ff2afca28/addons/source-python/packages/source-python/memory/manager.py#L90
_pointer_valueshttps://github.com/Source-Python-Dev-Team/Source.Python/blob/0171b36297c23d480c17631561c98c0ff2afca28/addons/source-python/packages/source-python/memory/manager.py#L94
CustomTypehttps://github.com/Source-Python-Dev-Team/Source.Python/blob/0171b36297c23d480c17631561c98c0ff2afca28/addons/source-python/packages/source-python/memory/manager.py#L249-L252
TypeManager.pointer_attribute cannot be safely used in nested CustomType. #480https://github.com/Source-Python-Dev-Team/Source.Python/issues/480
TypeManager.static_pointer_array/TypeManager.dynamic_pointer_array are broken. #489https://github.com/Source-Python-Dev-Team/Source.Python/issues/489
Source.Python implementationhttps://github.com/Source-Python-Dev-Team/Source.Python/blob/0171b36297c23d480c17631561c98c0ff2afca28/addons/source-python/packages/source-python/memory/manager.py#L512-L519
earlier implementationhttps://github.com/Source-Python-Dev-Team/Source.Python/commit/7690d9674053a158bc79246dfc64d26a507d5209
7690d96https://github.com/Source-Python-Dev-Team/Source.Python/commit/7690d9674053a158bc79246dfc64d26a507d5209
Source.Python/addons/source-python/packages/source-python/memory/__init__.pyhttps://github.com/Source-Python-Dev-Team/Source.Python/blob/7690d9674053a158bc79246dfc64d26a507d5209/addons/source-python/packages/source-python/memory/__init__.py#L394-L399
7690d96https://patch-diff.githubusercontent.com/Source-Python-Dev-Team/Source.Python/commit/7690d9674053a158bc79246dfc64d26a507d5209
CustomType._destructorhttps://github.com/Source-Python-Dev-Team/Source.Python/blob/0171b36297c23d480c17631561c98c0ff2afca28/addons/source-python/packages/source-python/memory/manager.py#L73-L74
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.