René's URL Explorer Experiment


Title: Who manages STRING_ARRAY/STRING_POINTER? · Issue #472 · Source-Python-Dev-Team/Source.Python · GitHub

Open Graph Title: Who manages STRING_ARRAY/STRING_POINTER? · Issue #472 · Source-Python-Dev-Team/Source.Python

X Title: Who manages STRING_ARRAY/STRING_POINTER? · Issue #472 · Source-Python-Dev-Team/Source.Python

Description: Who manages the char* set by Pointer.set_string_pointer? Is it impossible to set a string to a char* managed by a C++ object? Test Code 1: from memory import alloc string = "string1" string2 = "string2" s_p1 = alloc(4, False) s_p2 = allo...

Open Graph Description: Who manages the char* set by Pointer.set_string_pointer? Is it impossible to set a string to a char* managed by a C++ object? Test Code 1: from memory import alloc string = "string1" string2 = "str...

X Description: Who manages the char* set by Pointer.set_string_pointer? Is it impossible to set a string to a char* managed by a C++ object? Test Code 1: from memory import alloc string = "string1" stri...

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

X: @github

direct link

Domain: patch-diff.githubusercontent.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Who manages STRING_ARRAY/STRING_POINTER?","articleBody":"Who manages the char* set by Pointer.set_string_pointer? Is it impossible to set a string to a char* managed by a C++ object?\r\n\r\nTest Code 1:\r\n```python\r\nfrom memory import alloc\r\n\r\nstring = \"string1\"\r\nstring2 = \"string2\"\r\n\r\ns_p1 = alloc(4, False)\r\ns_p2 = alloc(4, False)\r\n\r\ns_p1.set_string_pointer(string)\r\ns_p2.set_string_pointer(string)\r\n\r\nprint(\"uint1\", s_p1.get_uint())\r\nprint(\"uint2\", s_p2.get_uint())\r\n\r\ns_p1.set_string_pointer(s_p2.get_string_pointer())\r\n\r\nprint(\"uint1\", s_p1.get_uint())\r\nprint(\"uint2\", s_p2.get_uint())\r\n\r\nprint(\"string1\", s_p1.get_string_pointer())\r\nprint(\"string2\", s_p2.get_string_pointer())\r\n\r\ns_p1.get_pointer().dealloc()\r\n```\r\nOutput 1:\r\n```\r\nuint1 3949688248\r\nuint2 3949688312\r\nuint1 3953894104\r\nuint2 3949688312\r\nstring1 12\r\nstring2 string2\r\nfree(): invalid pointer\r\n```\r\nFirst, I don't know why string1 is set to `12` instead of `string2` as in string2, but trying to free string1 would result in an illegal pointer deallocation. Who exactly is managing this char*?\r\n\r\nThere is also a problem with TypeManager.pointer_attribute not being able to set STRING_ARRAY.\r\n\r\nTest Code 2:\r\n```python\r\nfrom memory.manager import CustomType\r\nfrom memory.manager import Type\r\nfrom memory.manager import TypeManager\r\n\r\nmanager = TypeManager()\r\n\r\nclass Test(CustomType, metaclass=manager):\r\n    _size = 4\r\n    string = manager.pointer_attribute(Type.STRING_ARRAY, 0)\r\n\r\ntest = Test()\r\ntest.string = \"test\"\r\n```\r\nOutput 2:\r\n```\r\n[Source.Python]\r\n[SP] Caught an Exception:\r\nTraceback (most recent call last):\r\n  File \"../addons/source-python/packages/source-python/plugins/command.py\", line 164, in load_plugin\r\n    plugin = self.manager.load(plugin_name)\r\n  File \"../addons/source-python/packages/source-python/plugins/manager.py\", line 207, in load\r\n    plugin._load()\r\n  File \"../addons/source-python/packages/source-python/plugins/instance.py\", line 74, in _load\r\n    self.module = import_module(self.import_name)\r\n  File \"../addons/source-python/plugins/test/test.py\", line 4214, in \u003cmodule\u003e\r\n    test.string = \"test\"\r\n  File \"../addons/source-python/packages/source-python/memory/manager.py\", line 515, in fset\r\n    instance_ptr = alloc(TYPE_SIZES[type_name.upper()])\r\n\r\nKeyError: 'STRING_ARRAY'\r\n```\r\nSTRING_ARRAY also allows buffer overrun, and it seems that STRING-related issues are somewhat problematic.","author":{"url":"https://github.com/CookStar","@type":"Person","name":"CookStar"},"datePublished":"2023-05-17T16:22:16.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":12},"url":"https://github.com/472/Source.Python/issues/472"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:88502015-6af6-99b0-15f5-07bcda45b5cc
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id9D88:EAD41:193F11E:233DBD5:6970DF64
html-safe-noncef3263fe0eb0adf8d16f682aa2d7830f075fd6ade255ac195a55704b71064b594
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RDg4OkVBRDQxOjE5M0YxMUU6MjMzREJENTo2OTcwREY2NCIsInZpc2l0b3JfaWQiOiI0NjYyMTI3NTUwNjM5NjkzNjY4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac3d1208fcec8207412eeb6a27f86258e77da36adad0bb77be0fd0c151b9ee2424
hovercard-subject-tagissue:1714254331
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/472/issue_layout
twitter:imagehttps://opengraph.githubassets.com/4423c98796b9ab5efb16ed92dbcb45d60a86c096da2aef52e31f21560518f172/Source-Python-Dev-Team/Source.Python/issues/472
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/4423c98796b9ab5efb16ed92dbcb45d60a86c096da2aef52e31f21560518f172/Source-Python-Dev-Team/Source.Python/issues/472
og:image:altWho manages the char* set by Pointer.set_string_pointer? Is it impossible to set a string to a char* managed by a C++ object? Test Code 1: from memory import alloc string = "string1" string2 = "str...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameCookStar
hostnamegithub.com
expected-hostnamegithub.com
Noneb9203e7efc62065329c3b7015a1e6d16fc14bce440abec7b0d3cbe9e4fb1e2e4
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
releaseeb3c92b74ae48a78cffd8700b8eb5f60bad61528
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://patch-diff.githubusercontent.com/Source-Python-Dev-Team/Source.Python/issues/472#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%2F472
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%2F472
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/472
Reloadhttps://patch-diff.githubusercontent.com/Source-Python-Dev-Team/Source.Python/issues/472
Reloadhttps://patch-diff.githubusercontent.com/Source-Python-Dev-Team/Source.Python/issues/472
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/472
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/472
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/Source-Python-Dev-Team/Source.Python/issues/472
Who manages STRING_ARRAY/STRING_POINTER?https://patch-diff.githubusercontent.com/Source-Python-Dev-Team/Source.Python/issues/472#top
questionhttps://github.com/Source-Python-Dev-Team/Source.Python/issues?q=state%3Aopen%20label%3A%22question%22
https://github.com/CookStar
https://github.com/CookStar
CookStarhttps://github.com/CookStar
on May 17, 2023https://github.com/Source-Python-Dev-Team/Source.Python/issues/472#issue-1714254331
questionhttps://github.com/Source-Python-Dev-Team/Source.Python/issues?q=state%3Aopen%20label%3A%22question%22
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.