René's URL Explorer Experiment


Title: F-stack rack and BBR both causes PCB memory leak · Issue #702 · F-Stack/f-stack · GitHub

Open Graph Title: F-stack rack and BBR both causes PCB memory leak · Issue #702 · F-Stack/f-stack

X Title: F-stack rack and BBR both causes PCB memory leak · Issue #702 · F-Stack/f-stack

Description: My application suddenly start spamming ff_socket: "No buffer space available." so I went to debug why. I figured out that setting tcp stack back to default freebsd stack solved the issue, it only happens on tcp stack to rack/bbr. Also do...

Open Graph Description: My application suddenly start spamming ff_socket: "No buffer space available." so I went to debug why. I figured out that setting tcp stack back to default freebsd stack solved the issue, it only h...

X Description: My application suddenly start spamming ff_socket: "No buffer space available." so I went to debug why. I figured out that setting tcp stack back to default freebsd stack solved the issue,...

Opengraph URL: https://github.com/F-Stack/f-stack/issues/702

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"F-stack rack and BBR both causes PCB memory leak","articleBody":"My application suddenly start spamming `ff_socket: \"No buffer space available.\"` so I went to debug why. I figured out that setting tcp stack back to default freebsd stack solved the issue, it only happens on tcp stack to rack/bbr. Also does not happen unless socket is bound and connected (leak is in pcb), so test case must cover that.\r\n\r\nAfter debugging for a couple hours, i think it is stemming from tcphpts. \r\nI spewed logs in certain places to get insight. Hopefully the info can be helpful for you to get to the bottom of it.\r\n\r\nHere is logs when using freebsd stack.\r\nFirst log shows that a 4th pcb has been allocated, for total of 4 currently allocated. Middle lines show the socket creation and instant destruction, basically `ff_socket, ff_bind, ff_connect, ff_close` combo. Expected refcnt increases/decreases. Very last line shows that the pcb is getting freed, and down to 3 currently handed out. Looks good!\r\n```\r\nALLOC 4\r\ntcp_newtopcb do thing 0\r\nIN_PCBREF INCR REF: 1 -\u003e 2\r\ntcp_usr_detach\r\nDISCARD CB!\r\nDRAINCNT IS 0\r\nDO PCB RELE\r\nIN_PCBRELE_WLOCKED DECR REF: 2 -\u003e 1\r\nRELEASE RET ZERO! 1\r\nin_pcbfree CALLED! SCHEDULE DEFERRED.\r\nin_pcbfree_deferred!\r\nIN_PCBRELE_WLOCKED DECR REF: 1 -\u003e 0\r\nPCB RELE WLOCKED 3\r\n```\r\n\r\nHere's logs with rack/bbr stack enabled. Now we see tcp hpts is adding a refcnt, which didn't happen before, but does not seem to be  decreasing it. I have twiddled with tcp timewait/keepalive settings and brought them down to very low values, and let it sit there for hours in hopes to see it eventually release, but nope. Socket was not given nearly enough time to *actually* connect so i don't think that would be the issue anyways.\r\n\r\nso, in_pcbfree sets `INP_FREED` flag, which is picked up during in_pcbfree_deferred's call to in_pcbrele_wlocked, however during that call the refcnt is still 2, so somebody else is holding ref (appears to be tcphpts) meaning it can't be freed yet. \r\n\r\n```\r\nALLOC 4\r\ntcp_newtopcb do thing 0\r\nIN_PCBREF INCR REF: 1 -\u003e 2\r\nhpts do thing 0\r\nIN_PCBREF INCR REF: 2 -\u003e 3\r\ntcp_usr_detach\r\nDISCARD CB!\r\nDRAINCNT IS 0\r\nDO PCB RELE\r\nIN_PCBRELE_WLOCKED DECR REF: 3 -\u003e 2\r\nRELEASE RET ZERO! 2\r\nin_pcbfree CALLED! SCHEDULE DEFERRED.\r\nin_pcbfree_deferred!\r\nIN_PCBRELE_WLOCKED DECR REF: 2 -\u003e 1\r\nRELEASE RET ZERO! 1\r\nFLAG IS FREED!\r\n```\r\n\r\nTest case can be similar to #679 except also binds/connects to some host, then instant ff_close.\r\n\r\nWill run forever with freebsd stack without issue, will exit with these logs on bbr or rack stack:\r\n```\r\nff_socket: No buffer space available\r\nff_socket failed, fd:-1, errno:105, No buffer space available\r\nDone 262154\r\n```","author":{"url":"https://github.com/MrSonicMaster","@type":"Person","name":"MrSonicMaster"},"datePublished":"2022-10-14T19:49:07.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/702/f-stack/issues/702"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:7506ad5a-4ccc-8ca6-b43a-189482df1d54
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idE674:406C5:2B3E6A:3AABAE:69695A2B
html-safe-noncea061af41b15ecd9c537d422d3ff9a64982227726f9acbb9a2c39694bb6c69927
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNjc0OjQwNkM1OjJCM0U2QTozQUFCQUU6Njk2OTVBMkIiLCJ2aXNpdG9yX2lkIjoiNDA0MTY1MTMzMzUzNjI0MjIxOSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac8ff0c27b08375ce225f76bc48f79d4c65436fda062c720887e43006c971d36ce
hovercard-subject-tagissue:1409783971
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/F-Stack/f-stack/702/issue_layout
twitter:imagehttps://opengraph.githubassets.com/c3b35c4fc95244aba4678ce28dc1f9fd98bae8797adc9d066a47a98144f1be11/F-Stack/f-stack/issues/702
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/c3b35c4fc95244aba4678ce28dc1f9fd98bae8797adc9d066a47a98144f1be11/F-Stack/f-stack/issues/702
og:image:altMy application suddenly start spamming ff_socket: "No buffer space available." so I went to debug why. I figured out that setting tcp stack back to default freebsd stack solved the issue, it only h...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameMrSonicMaster
hostnamegithub.com
expected-hostnamegithub.com
None9db5f28da7e24035385d7f349f17890cbe016a939ddd7952be0f07b862094f5a
turbo-cache-controlno-preview
go-importgithub.com/F-Stack/f-stack git https://github.com/F-Stack/f-stack.git
octolytics-dimension-user_id26062241
octolytics-dimension-user_loginF-Stack
octolytics-dimension-repository_id88224621
octolytics-dimension-repository_nwoF-Stack/f-stack
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id88224621
octolytics-dimension-repository_network_root_nwoF-Stack/f-stack
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
release4e59fe66217d3c72925af2a341ae3a8f2b5b5b2a
ui-targetcanary-2
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/F-Stack/f-stack/issues/702#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FF-Stack%2Ff-stack%2Fissues%2F702
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%2FF-Stack%2Ff-stack%2Fissues%2F702
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=F-Stack%2Ff-stack
Reloadhttps://github.com/F-Stack/f-stack/issues/702
Reloadhttps://github.com/F-Stack/f-stack/issues/702
Reloadhttps://github.com/F-Stack/f-stack/issues/702
F-Stack https://github.com/F-Stack
f-stackhttps://github.com/F-Stack/f-stack
Notifications https://github.com/login?return_to=%2FF-Stack%2Ff-stack
Fork 953 https://github.com/login?return_to=%2FF-Stack%2Ff-stack
Star 4.2k https://github.com/login?return_to=%2FF-Stack%2Ff-stack
Code https://github.com/F-Stack/f-stack
Issues 306 https://github.com/F-Stack/f-stack/issues
Pull requests 0 https://github.com/F-Stack/f-stack/pulls
Actions https://github.com/F-Stack/f-stack/actions
Projects 0 https://github.com/F-Stack/f-stack/projects
Wiki https://github.com/F-Stack/f-stack/wiki
Security Uh oh! There was an error while loading. Please reload this page. https://github.com/F-Stack/f-stack/security
Please reload this pagehttps://github.com/F-Stack/f-stack/issues/702
Insights https://github.com/F-Stack/f-stack/pulse
Code https://github.com/F-Stack/f-stack
Issues https://github.com/F-Stack/f-stack/issues
Pull requests https://github.com/F-Stack/f-stack/pulls
Actions https://github.com/F-Stack/f-stack/actions
Projects https://github.com/F-Stack/f-stack/projects
Wiki https://github.com/F-Stack/f-stack/wiki
Security https://github.com/F-Stack/f-stack/security
Insights https://github.com/F-Stack/f-stack/pulse
New issuehttps://github.com/login?return_to=https://github.com/F-Stack/f-stack/issues/702
New issuehttps://github.com/login?return_to=https://github.com/F-Stack/f-stack/issues/702
F-stack rack and BBR both causes PCB memory leakhttps://github.com/F-Stack/f-stack/issues/702#top
questionhttps://github.com/F-Stack/f-stack/issues?q=state%3Aopen%20label%3A%22question%22
https://github.com/MrSonicMaster
https://github.com/MrSonicMaster
MrSonicMasterhttps://github.com/MrSonicMaster
on Oct 14, 2022https://github.com/F-Stack/f-stack/issues/702#issue-1409783971
#679https://github.com/F-Stack/f-stack/issues/679
questionhttps://github.com/F-Stack/f-stack/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.