Skip to content

Commit 20e32cb

Browse files
committed
Skip pseudo-libraries like [vdso] during symbolication
Pseudo-modules such as [vdso], [vsyscall], [heap], [stack] and [anon:...] are kernel- or allocator-provided mappings that have no symbol files, so requesting symbols for them is always pointless. Worse, it is now actively harmful because the Mozilla symbolication server (Eliot) rejects the entire batched /symbolicate/v5 request with an HTTP 400 ("job N has invalid modules: module index 0 has an invalid debug_filename") when any job's module name contains brackets. Because we batch up to 10 libraries into a single request, that 400 has no `results` field and our response validation throws for the whole chunk, so every other library in it (most importantly libxul) fails to symbolicate too. The net effect is a profile with no symbols at all, even though the symbols are available on the server. This was previously harmless, Eliot (I think) used to tolerate [vdso], returning found_modules: false for that job while symbolicating the rest, which only produced a per-library warning in the console.
1 parent 1a7c76c commit 20e32cb

2 files changed

Lines changed: 34 additions & 1 deletion

File tree

src/profile-logic/symbol-store.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,24 @@ export class SymbolStore {
245245
);
246246
return false;
247247
}
248+
// Skip pseudo-modules such as [vdso], [vsyscall], [heap], [stack] and
249+
// [anon:...]. These are kernel- or allocator-provided mappings with no
250+
// symbol files, so requesting them is always pointless. Worse, the
251+
// Mozilla symbolication server rejects the entire batched request with an
252+
// HTTP 400 ("invalid debug_filename") when any job's module name contains
253+
// brackets, which would prevent every other library in the same chunk
254+
// (e.g. libxul) from being symbolicated.
255+
if (debugName.startsWith('[')) {
256+
errorCb(
257+
request,
258+
new SymbolsNotFoundError(
259+
`Cannot symbolicate pseudo-library ${debugName}`,
260+
request.lib,
261+
new Error('Pseudo-library without symbols')
262+
)
263+
);
264+
return false;
265+
}
248266
return true;
249267
});
250268

src/test/unit/symbol-store.test.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,10 @@ describe('SymbolStore', function () {
270270
debugName: '',
271271
breakpadId: 'empty-debugname',
272272
},
273+
{
274+
debugName: '[vdso]',
275+
breakpadId: 'dont-care',
276+
},
273277
];
274278

275279
const symbolTable = new Map([
@@ -291,6 +295,9 @@ describe('SymbolStore', function () {
291295
const { debugName, breakpadId } = request.lib;
292296
expect(debugName).not.toEqual('');
293297
expect(breakpadId).not.toEqual('');
298+
// Pseudo-libraries must be filtered out before reaching the server,
299+
// otherwise they cause the whole batched request to be rejected.
300+
expect(debugName.startsWith('[')).toBe(false);
294301
await fakeSymbolStore.getSymbols(
295302
[request],
296303
(lib, results) => {
@@ -367,7 +374,7 @@ describe('SymbolStore', function () {
367374
// Empty debugNames or breakpadIds should cause errors. And if symbols are
368375
// not available from any source, all errors along the way should be included
369376
// in the reported error.
370-
expect([...failedLibs]).toBeArrayOfSize(3);
377+
expect([...failedLibs]).toBeArrayOfSize(4);
371378
expect(failedLibs.get('empty-breakpadid')).toEqual(
372379
expect.objectContaining({
373380
message: expect.stringContaining('Invalid debugName or breakpadId'),
@@ -379,6 +386,14 @@ describe('SymbolStore', function () {
379386
})
380387
);
381388

389+
// Pseudo-libraries such as [vdso] should fail without being sent to any
390+
// symbol source, so they can't take down the rest of the batch.
391+
expect(failedLibs.get('[vdso]')).toEqual(
392+
expect.objectContaining({
393+
message: expect.stringContaining('Cannot symbolicate pseudo-library'),
394+
})
395+
);
396+
382397
// For error objects, Jest's deep equality checks only check the message.
383398
expect(failedLibs.get('available-from-neither')).toEqual(
384399
new SymbolsNotFoundError(

0 commit comments

Comments
 (0)