René's URL Explorer Experiment


Title: lazy: refuse an instance whose data section failed to index, and three uninitialised reads around it by attixray · Pull Request #484 · stepcode/stepcode · GitHub

Open Graph Title: lazy: refuse an instance whose data section failed to index, and three uninitialised reads around it by attixray · Pull Request #484 · stepcode/stepcode

X Title: lazy: refuse an instance whose data section failed to index, and three uninitialised reads around it by attixray · Pull Request #484 · stepcode/stepcode

Description: A lazyDataSectionReader indexes its instances from its own constructor, through addLazyInstance(), under the section id it will be given — and lazyFileReader::initP21() registers it only afterwards, and only if the scan succeeded. A section that fails part way therefore leaves every instance it had already indexed naming a section that does not exist. lazyInstMgr::typeFromFile() indexes _dataSections with that id unconditionally, and loadInstance() does the same behind an assert() that Release compiles out. On an empty vector that is an access violation. Thirteen lines reproduce it — a DATA section holding one instance followed by a line that is not one — and that file is added here as src/cllazyfile/test/lazy_broken_section.stp and checked by the existing lazy_index test, which segfaults inside typeFromFile() without the fix. sourceRecord() already makes exactly this test. The other two entry points now make it too and answer 0 with a diagnostic, as they already do for an instance found in no section. The instances stay in the index — totalInstanceCount() still counts them and getInstances() still lists them; what changes is that asking for one of them fails the way every other unloadable instance fails. Three smaller things in the same code, each its own commit: loadInstance() cached a null as a loaded instance. isNilSTEPentity( 0 ) returns false, so if( !isNilSTEPentity( inst ) ) is true for a null, and several arms of the switch above it can leave one. Nothing dereferences it — lazyRefs::init() rejects two null arguments — but _loadedInstanceCount, _materializations, _cacheHighWater and the resident source-byte total all advance for an instance that never materialized, and it never settles: releaseBatch() skips the entry with if( !inst ) continue; before the decrement and the erase, so the phantom cannot be evicted. This one is also what keeps the bounds fix above from simply moving the crash to process exit. namedLazyInstance::name is the one member nextInstance() does not initialise, and its assignment is behind if( _file.good() ). Nothing observes the uninitialised value today — the closing invalid-instance branch is reached on the same condition and assigns 0 — but that is a control-flow argument spanning forty lines rather than an invariant the code states. the same branch deletes i.refs without nulling it, two lines above a delete i.componentTypes; i.componentTypes = 0; that does both. Only the section-bounds fix is a crash; the three above are stated as hardening in their commit messages, not as live bugs. The commits are ordered so that the null guard comes first: the new break in loadInstance() leaves inst null, so without it the bounds test moves the failure from the call to process exit rather than removing it. Verified both ways on the same build tree (Release, shared libs, no schemas), rebuilding clean between runs: ctest -R lazy_index segfaults on unmodified develop with the new fixture and assertions, and passes with the four commits. The new case gives its lazyInstMgr the test's empty registry, so it does not trip loadInstance()'s assert( _mainRegistry ) in a Debug build.

Open Graph Description: A lazyDataSectionReader indexes its instances from its own constructor, through addLazyInstance(), under the section id it will be given — and lazyFileReader::initP21() registers it only afterwards...

X Description: A lazyDataSectionReader indexes its instances from its own constructor, through addLazyInstance(), under the section id it will be given — and lazyFileReader::initP21() registers it only afterwards...

Opengraph URL: https://github.com/stepcode/stepcode/pull/484

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.113.3

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:886e0a31-f2d6-bb77-8786-c674ab034ca6
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idB1AC:344084:45215B:618673:6B0470F6
html-safe-nonce080d312c6f82f4012a53ae43ac000a1a9e224393e70808a8994e521cc60d79aa
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMUFDOjM0NDA4NDo0NTIxNUI6NjE4NjczOjZCMDQ3MEY2IiwidmlzaXRvcl9pZCI6IjY3OTkwNzE4MTI3NzgyMjU5MTAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac09cf84eb4fbc0334ed5c2b028b6b1d609bffb37222ff33b736b4dbabbd13d2f1
hovercard-subject-tagpull_request:4334051111
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/stepcode/stepcode/pull/484/files
twitter:imagehttps://avatars.githubusercontent.com/u/9821141?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/9821141?s=400&v=4
og:image:altA lazyDataSectionReader indexes its instances from its own constructor, through addLazyInstance(), under the section id it will be given — and lazyFileReader::initP21() registers it only afterwards...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Noneae8802492f12d3ba4f6b0d814054e617a2a5616b6327bf8555c10cd5b0dc2a6f
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/stepcode/stepcode git https://github.com/stepcode/stepcode.git
octolytics-dimension-user_id1761770
octolytics-dimension-user_loginstepcode
octolytics-dimension-repository_id1975387
octolytics-dimension-repository_nwostepcode/stepcode
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1975387
octolytics-dimension-repository_network_root_nwostepcode/stepcode
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasecfb5f24c6e01d85f70804652a5107e5cac03a161
ui-targetcanary-1
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/stepcode/stepcode/pull/484/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fstepcode%2Fstepcode%2Fpull%2F484%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
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
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://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/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fstepcode%2Fstepcode%2Fpull%2F484%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=stepcode%2Fstepcode
Reloadhttps://github.com/stepcode/stepcode/pull/484/files
Reloadhttps://github.com/stepcode/stepcode/pull/484/files
Reloadhttps://github.com/stepcode/stepcode/pull/484/files
stepcodehttps://github.com/stepcode
stepcodehttps://github.com/stepcode/stepcode
Codehttps://github.com/stepcode/stepcode
Issues60 (60)https://github.com/stepcode/stepcode/issues
Pull requestshttps://github.com/stepcode/stepcode/pulls
Actionshttps://github.com/stepcode/stepcode/actions
Projectshttps://github.com/stepcode/stepcode/projects
Wikihttps://github.com/stepcode/stepcode/wiki
Security and qualityhttps://github.com/stepcode/stepcode/security
Insightshttps://github.com/stepcode/stepcode/insights
Sign up for GitHub https://github.com/signup?return_to=%2Fstepcode%2Fstepcode%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fstepcode%2Fstepcode%2Fissues%2Fnew%2Fchoose
starseekerhttps://github.com/starseeker
stepcode:develophttps://github.com/stepcode/stepcode/tree/develop
attixray:sc-fix-lazy-null-and-uninitialised-readshttps://github.com/attixray/stepcode/tree/sc-fix-lazy-null-and-uninitialised-reads
Conversation 0 https://github.com/stepcode/stepcode/pull/484
Commits 4 https://github.com/stepcode/stepcode/pull/484/commits
Checks 6 https://github.com/stepcode/stepcode/pull/484/checks
Files changed https://github.com/stepcode/stepcode/pull/484/files
Please reload this pagehttps://github.com/stepcode/stepcode/pull/484/files
lazy: refuse an instance whose data section failed to index, and three uninitialised reads around it https://github.com/stepcode/stepcode/pull/484/files#top
Show all changes 4 commits https://github.com/stepcode/stepcode/pull/484/files
54c89ed lazy: do not cache a null instance as a loaded one Aug 21, 2026 https://github.com/stepcode/stepcode/pull/484/commits/54c89ed13e1fd08f7b17ca158851beced03be057
c4d4373 lazy: initialise namedLazyInstance::name with the rest of the struct Aug 21, 2026 https://github.com/stepcode/stepcode/pull/484/commits/c4d437328050763665cf52428651e89dc5c7e296
b5e0082 lazy: null the reference list the invalid-instance path deletes Aug 21, 2026 https://github.com/stepcode/stepcode/pull/484/commits/b5e0082f569d0c4ba83873bcf03af9012dcc1ae1
18f7b43 lazy: refuse an instance whose data section failed to index Aug 21, 2026 https://github.com/stepcode/stepcode/pull/484/commits/18f7b43c99f56c2195301c0c604a670dbe42725e
Clear filters https://github.com/stepcode/stepcode/pull/484/files
Please reload this pagehttps://github.com/stepcode/stepcode/pull/484/files
Please reload this pagehttps://github.com/stepcode/stepcode/pull/484/files
lazyInstMgr.h https://github.com/stepcode/stepcode/pull/484/files#diff-4c1e3d579692a12b18358d10779cb267815861d292d478bccc661c665722caba
CMakeLists.txt https://github.com/stepcode/stepcode/pull/484/files#diff-2970833808d3b5e757a0c28c665d7e56a5b2a942dcc6f9ddcec617a9a9b10481
lazyInstMgr.cc https://github.com/stepcode/stepcode/pull/484/files#diff-f80507591036c89f3b65467f196112103bcfbc45d2d5abdc721b2132cb9eff7c
lazyP21DataSectionReader.cc https://github.com/stepcode/stepcode/pull/484/files#diff-8eeee2bcbc69908c6e68e2c955f7c628296d37f532ad252db5341c6f9b6226b3
lazy_index_test.cc https://github.com/stepcode/stepcode/pull/484/files#diff-844e9df090b4033a87b7ecb0dd5c1b1e2f965e0edc6936f8a3c7c567fe663c4f
lazy_broken_section.stp https://github.com/stepcode/stepcode/pull/484/files#diff-409a7b9c84bbeb1eae10c625d05a22d10a3ebc06498e4118289f74ce4d15d511
include/cllazyfile/lazyInstMgr.hhttps://github.com/stepcode/stepcode/pull/484/files#diff-4c1e3d579692a12b18358d10779cb267815861d292d478bccc661c665722caba
View file https://github.com/attixray/stepcode/blob/18f7b43c99f56c2195301c0c604a670dbe42725e/include/cllazyfile/lazyInstMgr.h
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/stepcode/stepcode/pull/484/{{ revealButtonHref }}
https://github.com/stepcode/stepcode/pull/484/files#diff-4c1e3d579692a12b18358d10779cb267815861d292d478bccc661c665722caba
https://github.com/stepcode/stepcode/pull/484/files#diff-4c1e3d579692a12b18358d10779cb267815861d292d478bccc661c665722caba
src/cllazyfile/CMakeLists.txthttps://github.com/stepcode/stepcode/pull/484/files#diff-2970833808d3b5e757a0c28c665d7e56a5b2a942dcc6f9ddcec617a9a9b10481
View file https://github.com/attixray/stepcode/blob/18f7b43c99f56c2195301c0c604a670dbe42725e/src/cllazyfile/CMakeLists.txt
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/stepcode/stepcode/pull/484/{{ revealButtonHref }}
https://github.com/stepcode/stepcode/pull/484/files#diff-2970833808d3b5e757a0c28c665d7e56a5b2a942dcc6f9ddcec617a9a9b10481
src/cllazyfile/lazyInstMgr.cchttps://github.com/stepcode/stepcode/pull/484/files#diff-f80507591036c89f3b65467f196112103bcfbc45d2d5abdc721b2132cb9eff7c
View file https://github.com/attixray/stepcode/blob/18f7b43c99f56c2195301c0c604a670dbe42725e/src/cllazyfile/lazyInstMgr.cc
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/stepcode/stepcode/pull/484/{{ revealButtonHref }}
https://github.com/stepcode/stepcode/pull/484/files#diff-f80507591036c89f3b65467f196112103bcfbc45d2d5abdc721b2132cb9eff7c
https://github.com/stepcode/stepcode/pull/484/files#diff-f80507591036c89f3b65467f196112103bcfbc45d2d5abdc721b2132cb9eff7c
https://github.com/stepcode/stepcode/pull/484/files#diff-f80507591036c89f3b65467f196112103bcfbc45d2d5abdc721b2132cb9eff7c
https://github.com/stepcode/stepcode/pull/484/files#diff-f80507591036c89f3b65467f196112103bcfbc45d2d5abdc721b2132cb9eff7c
src/cllazyfile/lazyP21DataSectionReader.cchttps://github.com/stepcode/stepcode/pull/484/files#diff-8eeee2bcbc69908c6e68e2c955f7c628296d37f532ad252db5341c6f9b6226b3
View file https://github.com/attixray/stepcode/blob/18f7b43c99f56c2195301c0c604a670dbe42725e/src/cllazyfile/lazyP21DataSectionReader.cc
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/stepcode/stepcode/pull/484/{{ revealButtonHref }}
https://github.com/stepcode/stepcode/pull/484/files#diff-8eeee2bcbc69908c6e68e2c955f7c628296d37f532ad252db5341c6f9b6226b3
https://github.com/stepcode/stepcode/pull/484/files#diff-8eeee2bcbc69908c6e68e2c955f7c628296d37f532ad252db5341c6f9b6226b3
https://github.com/stepcode/stepcode/pull/484/files#diff-8eeee2bcbc69908c6e68e2c955f7c628296d37f532ad252db5341c6f9b6226b3
https://github.com/stepcode/stepcode/pull/484/files#diff-8eeee2bcbc69908c6e68e2c955f7c628296d37f532ad252db5341c6f9b6226b3
src/cllazyfile/lazy_index_test.cchttps://github.com/stepcode/stepcode/pull/484/files#diff-844e9df090b4033a87b7ecb0dd5c1b1e2f965e0edc6936f8a3c7c567fe663c4f
View file https://github.com/attixray/stepcode/blob/18f7b43c99f56c2195301c0c604a670dbe42725e/src/cllazyfile/lazy_index_test.cc
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/stepcode/stepcode/pull/484/{{ revealButtonHref }}
https://github.com/stepcode/stepcode/pull/484/files#diff-844e9df090b4033a87b7ecb0dd5c1b1e2f965e0edc6936f8a3c7c567fe663c4f
https://github.com/stepcode/stepcode/pull/484/files#diff-844e9df090b4033a87b7ecb0dd5c1b1e2f965e0edc6936f8a3c7c567fe663c4f
https://github.com/stepcode/stepcode/pull/484/files#diff-844e9df090b4033a87b7ecb0dd5c1b1e2f965e0edc6936f8a3c7c567fe663c4f
src/cllazyfile/test/lazy_broken_section.stphttps://github.com/stepcode/stepcode/pull/484/files#diff-409a7b9c84bbeb1eae10c625d05a22d10a3ebc06498e4118289f74ce4d15d511
View file https://github.com/attixray/stepcode/blob/18f7b43c99f56c2195301c0c604a670dbe42725e/src/cllazyfile/test/lazy_broken_section.stp
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/stepcode/stepcode/pull/484/{{ revealButtonHref }}
Please reload this pagehttps://github.com/stepcode/stepcode/pull/484/files
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

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlno-cache

Viewport: width=device-width


URLs of crawlers that visited me.