René's URL Explorer Experiment


Title: Crash due to ConVar overlap and release. #421 · Issue #430 · Source-Python-Dev-Team/Source.Python · GitHub

Open Graph Title: Crash due to ConVar overlap and release. #421 · Issue #430 · Source-Python-Dev-Team/Source.Python

X Title: Crash due to ConVar overlap and release. #421 · Issue #430 · Source-Python-Dev-Team/Source.Python

Description: This is an issue derived from #421 and introduced by 02e3490. There is a long discussion going on in #421, and I've created an issue for the record. The main issue is due to Source.Python releasing the ConVar object created by ConVar(str...

Open Graph Description: This is an issue derived from #421 and introduced by 02e3490. There is a long discussion going on in #421, and I've created an issue for the record. The main issue is due to Source.Python releasing...

X Description: This is an issue derived from #421 and introduced by 02e3490. There is a long discussion going on in #421, and I've created an issue for the record. The main issue is due to Source.Python relea...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Crash due to ConVar overlap and release. #421","articleBody":"This is an issue derived from #421 and introduced by 02e34907fc86036228d132526edcd8f847a0650a. There is a long discussion going on in #421, and I've created an issue for the record.\r\n\r\nThe main issue is due to Source.Python releasing the ConVar object created by [ConVar(str)](https://github.com/Source-Python-Dev-Team/Source.Python/blob/02e34907fc86036228d132526edcd8f847a0650a/src/core/modules/cvars/cvars_wrap.cpp#L207) when the plugin is unloaded. This will cause other Source.Python/SourceMod plugins to crash if they hold the same ConVar object.\r\n\r\nCode:\r\n\r\nPlugin1 (test1)\r\n```python\r\nfrom cvars import ConVar\r\ntest_convar = ConVar(\"test_convar\", \"1\", \"Test Convar(test1).\")\r\n```\r\n\r\nPlugin2 (test2) Or a SourceMod plugin with equivalent functionality.\r\n```python\r\nfrom commands.server import ServerCommand\r\nfrom cvars import ConVar\r\ntest_convar = ConVar(\"test_convar\", \"2\", \"Test Convar(test2).\")\r\n\r\n@ServerCommand(\"set_test\")\r\ndef test_command(*args):\r\n    test_convar.set_string(\"3\")\r\n```\r\n\r\nOutput;\r\n```\r\n$ sp plugin load test1\r\n[SP] Loading plugin 'test1'...\r\n[SP] Successfully loaded plugin 'test1'.\r\n\r\n$ test_convar\r\n\"test_convar\" = \"1\" - Test Convar(test1).\r\n\r\n$ sp plugin load test2\r\n[SP] Loading plugin 'test2'...\r\n[SP] Successfully loaded plugin 'test2'.\r\n\r\n$ sp plugin unload test1\r\n[SP] Unloading plugin 'test1'...\r\n[SP] Successfully unloaded plugin 'test1'.\r\n\r\n$ set_test\r\nThread 1 \"srcds_linux\" received signal SIGSEGV, Segmentation fault.\r\n0xf076d5e5 in boost::python::objects::polymorphic_id_generator\u003cConVar\u003e::execute(void*) ()\r\n```\r\n\r\nThe same problem occurs with the wrapping plugin for ConVars.\r\n\r\nThe root of the problem lies in the fact that ConVar(str) returns an existing registered ConVar.\r\nhttps://github.com/Source-Python-Dev-Team/Source.Python/blob/02e34907fc86036228d132526edcd8f847a0650a/src/core/modules/cvars/cvars.h#L95-L104\r\n\r\nIn the Valve Server Plugin, the ConVar used by the plugin is created each time it is loaded, and released when it is unloaded. Also, when accessing a ConVar that already exists, the plugin retrieves the ConVar from ICvar.FindVar(g_pCVar-\u003eFindVar) and checks if it is valid before accessing it. However, SourcePython's ConVar(str) and SourceMod's CreateConVar return an existing ConVar, so if there are overlapping ConVars, intentionally or unintentionally, the plugin will own a single ConVar, resulting in a crash.\r\n\r\nUnfortunately, ConVar(str) is used by many plugins to access an existing ConVar instead of cvar.find_var which should be used, and it is not possible to not return an existing ConVar without causing a major compatibility break.\r\n\r\nBut either way, when ConVar overlaps, the parent is set and the children access the parent, so when the parent is released, this also causes a crash. (This has been disabled in 02e34907fc86036228d132526edcd8f847a0650a, but should not be disabled for warnings.)\r\nhttps://github.com/Source-Python-Dev-Team/Source.Python/blob/02e34907fc86036228d132526edcd8f847a0650a/src/core/modules/commands/commands_server.cpp#L54-L62\r\n\r\nWe should stop releasing ConVar when unloading plugins, and if we do release it, at least it should be done when unloading Source.Python VSP, so that plugins can work safely. However, if we want to be compatible with SourceMod, I think we should prohibit release of ConVar itself.","author":{"url":"https://github.com/CookStar","@type":"Person","name":"CookStar"},"datePublished":"2021-10-30T09:58:08.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/430/Source.Python/issues/430"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:b2be5c6b-8979-f201-cb6c-28db390a86d4
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id83E8:B32AB:2300FB3:2E97A04:6970639F
html-safe-noncefd579f8c3921fb82deed70e4d4e8f78716c23535cda4f22aee5fc57fca6620ae
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4M0U4OkIzMkFCOjIzMDBGQjM6MkU5N0EwNDo2OTcwNjM5RiIsInZpc2l0b3JfaWQiOiI1ODg0NDg1MjIwMjkwMjkwNTkyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmaceb26981dcd7d3988a20f1641d652e2cc22dee850a961842096cf6f97f99496d2
hovercard-subject-tagissue:1040104474
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/430/issue_layout
twitter:imagehttps://opengraph.githubassets.com/d45b541a240503ad8b6f1cc44970eeacbfbf03f61f23e74927baf3d0b645a81e/Source-Python-Dev-Team/Source.Python/issues/430
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/d45b541a240503ad8b6f1cc44970eeacbfbf03f61f23e74927baf3d0b645a81e/Source-Python-Dev-Team/Source.Python/issues/430
og:image:altThis is an issue derived from #421 and introduced by 02e3490. There is a long discussion going on in #421, and I've created an issue for the record. The main issue is due to Source.Python releasing...
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
release7d6181066430cc06553c8396ca201e194ae33cb9
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/Source-Python-Dev-Team/Source.Python/issues/430#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FSource-Python-Dev-Team%2FSource.Python%2Fissues%2F430
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://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FSource-Python-Dev-Team%2FSource.Python%2Fissues%2F430
Sign up https://github.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://github.com/Source-Python-Dev-Team/Source.Python/issues/430
Reloadhttps://github.com/Source-Python-Dev-Team/Source.Python/issues/430
Reloadhttps://github.com/Source-Python-Dev-Team/Source.Python/issues/430
Source-Python-Dev-Team https://github.com/Source-Python-Dev-Team
Source.Pythonhttps://github.com/Source-Python-Dev-Team/Source.Python
Notifications https://github.com/login?return_to=%2FSource-Python-Dev-Team%2FSource.Python
Fork 37 https://github.com/login?return_to=%2FSource-Python-Dev-Team%2FSource.Python
Star 170 https://github.com/login?return_to=%2FSource-Python-Dev-Team%2FSource.Python
Code https://github.com/Source-Python-Dev-Team/Source.Python
Issues 7 https://github.com/Source-Python-Dev-Team/Source.Python/issues
Pull requests 7 https://github.com/Source-Python-Dev-Team/Source.Python/pulls
Discussions https://github.com/Source-Python-Dev-Team/Source.Python/discussions
Actions https://github.com/Source-Python-Dev-Team/Source.Python/actions
Security Uh oh! There was an error while loading. Please reload this page. https://github.com/Source-Python-Dev-Team/Source.Python/security
Please reload this pagehttps://github.com/Source-Python-Dev-Team/Source.Python/issues/430
Insights https://github.com/Source-Python-Dev-Team/Source.Python/pulse
Code https://github.com/Source-Python-Dev-Team/Source.Python
Issues https://github.com/Source-Python-Dev-Team/Source.Python/issues
Pull requests https://github.com/Source-Python-Dev-Team/Source.Python/pulls
Discussions https://github.com/Source-Python-Dev-Team/Source.Python/discussions
Actions https://github.com/Source-Python-Dev-Team/Source.Python/actions
Security https://github.com/Source-Python-Dev-Team/Source.Python/security
Insights https://github.com/Source-Python-Dev-Team/Source.Python/pulse
New issuehttps://github.com/login?return_to=https://github.com/Source-Python-Dev-Team/Source.Python/issues/430
New issuehttps://github.com/login?return_to=https://github.com/Source-Python-Dev-Team/Source.Python/issues/430
Crash due to ConVar overlap and release. #421https://github.com/Source-Python-Dev-Team/Source.Python/issues/430#top
https://github.com/CookStar
https://github.com/CookStar
CookStarhttps://github.com/CookStar
on Oct 30, 2021https://github.com/Source-Python-Dev-Team/Source.Python/issues/430#issue-1040104474
#421https://github.com/Source-Python-Dev-Team/Source.Python/pull/421
02e3490https://github.com/Source-Python-Dev-Team/Source.Python/commit/02e34907fc86036228d132526edcd8f847a0650a
#421https://github.com/Source-Python-Dev-Team/Source.Python/pull/421
ConVar(str)https://github.com/Source-Python-Dev-Team/Source.Python/blob/02e34907fc86036228d132526edcd8f847a0650a/src/core/modules/cvars/cvars_wrap.cpp#L207
Source.Python/src/core/modules/cvars/cvars.hhttps://github.com/Source-Python-Dev-Team/Source.Python/blob/02e34907fc86036228d132526edcd8f847a0650a/src/core/modules/cvars/cvars.h#L95-L104
02e3490https://github.com/Source-Python-Dev-Team/Source.Python/commit/02e34907fc86036228d132526edcd8f847a0650a
02e3490https://github.com/Source-Python-Dev-Team/Source.Python/commit/02e34907fc86036228d132526edcd8f847a0650a
Source.Python/src/core/modules/commands/commands_server.cpphttps://github.com/Source-Python-Dev-Team/Source.Python/blob/02e34907fc86036228d132526edcd8f847a0650a/src/core/modules/commands/commands_server.cpp#L54-L62
02e3490https://github.com/Source-Python-Dev-Team/Source.Python/commit/02e34907fc86036228d132526edcd8f847a0650a
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.