[bug] `scip.scip.Index.deserializeBinary()` fails to deserialize ~2 GiB `index.scip` file
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 32/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- typescript
- Domain
- tooling
Research direction
Start with the provided TypeScript reproduction and the call to scip.scip.Index.deserializeBinary(buffer), using the large index.scip file to confirm where deserialization stops progressing. Read the generated SCIP deserialization entry point and inspect behavior with the roughly 2 GiB buffer. Done means the reproduction completes and the index metadata and document information can be read without hanging.
Written by the indexing model from the issue text.
Description
To reproduce run the following TS script and see that it hangs after Deserializing index...
// NODE_OPTIONS='--max-old-space-size=40960' pnpm ts-node main.ts
import { createReadStream } from 'fs';
import * as scip from '@sourcegraph/scip-typescript/dist/src/scip';
async function readLargeFile(filePath: string): Promise<Buffer> {
return new Promise((resolve, reject) => {
const chunks: Buffer[] = [];
const stream = createReadStream(filePath);
stream.on('data', (chunk) => chunks.push(Buffer.from(chunk)));
stream.on('error', (error) => reject(error));
stream.on('end', () => resolve(Buffer.concat(chunks)));
});
}
async function main() {
try {
// Read the binary SCIP file using streams
console.log('Reading SCIP file...');
const buffer = await readLargeFile('index.scip');
console.log('File read complete. Size:', buffer.length, 'bytes');
// Deserialize the SCIP index
console.log('Deserializing index...');
const index = scip.scip.Index.deserializeBinary(buffer);
// Log some basic information about the index
console.log('\nSCIP Index Information:');
const metadata = index.getMetadata();
if (metadata) {
console.log('Project Root:', metadata.getProjectRoot());
const toolInfo = metadata.getToolInfo();
if (toolInfo) {
console.log('Tool Name:', toolInfo.getName());
console.log('Tool Version:', toolInfo.getVersion());
}
}
const documents = index.getDocumentsList();
console.log('\nDocuments:', documents.length);
// Show information about the first few documents
documents.slice(0, 5).forEach((doc, i) => {
console.log(`\nDocument ${i + 1}:`);
console.log('Path:', doc.getRelativePath());
console.log('Language:', scip.scip.Language[doc.getLanguage()]);
console.log('Occurrences:', doc.getOccurrencesList().length);
console.log('Symbols:', doc.getSymbolsList().length);
});
} catch (error) {
console.error('Error processing SCIP file:', error);
}
}
main();
- Dominant language
- TypeScript
- Stars
- 115
- Forks
- 42
- Avg merge
- 12d 22h
- Merged PRs (30d)
- 6
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from sourcegraph/scip-typescript
-
graph/scip-typescript team/graph
Difficulty 4/5 3-5 days Newbie friendliness 38/100
sourcegraph/scip-typescript#443 · 1 comment ·
-
Error Command failed Opengraph/scip-typescript team/graph
Difficulty 4/5 3-5 days Newbie friendliness 35/100
sourcegraph/scip-typescript#410 · 1 comment ·
-
graph/scip-typescript team/graph
Difficulty 3/5 1-2 days Newbie friendliness 45/100
sourcegraph/scip-typescript#409 · 3 comments ·
-
graph/scip-typescript team/graph
Difficulty 3/5 1-2 days Newbie friendliness 48/100
sourcegraph/scip-typescript#394 · 2 comments · 1 reaction ·
-
Dependency Dashboard Opengraph/scip-typescript team/graph
Difficulty 4/5 3-5 days Newbie friendliness 15/100
All issues in sourcegraph/scip-typescript
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
copse-dev/agent-pane#2953 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·