{"record":{"id":"26bdff608c9fc17a","repo":"can1357/oh-my-pi","slug":"ar-archive-member-name-references-a-missing-l","errorCode":null,"errorMessage":"Ar archive member '${name}' references a missing long-name table","messagePattern":"Ar archive member '(.+?)' references a missing long-name table","errorType":"exception","errorClass":"ArchiveError","httpStatus":null,"severity":"error","filePath":"packages/utils/src/ar/unix-ar.ts","lineNumber":160,"sourceCode":"\treturn { name: decodeName(nameBytes, limits), byteLength: nameBytes.byteLength };\n}\n\nfunction isMetadataName(name: string): boolean {\n\treturn name === \"/\" || name === \"//\" || name === \"/SYM64/\" || name === \"__.SYMDEF\" || name === \"__.SYMDEF SORTED\";\n}\n\nfunction materializeEntries(\n\trecords: RawArMember[],\n\tlongNames: Uint8Array | undefined,\n\tsource: ByteSource,\n\toptions: FormatReadOptions,\n): ArchiveIndexEntry[] {\n\tconst entries = new Map<string, ArchiveIndexEntry>();\n\tfor (const record of records) {\n\t\tlet name = record.name;\n\t\tlet nameByteLength = record.nameByteLength;\n\t\tif (/^\\/\\d+$/.test(name)) {\n\t\t\tif (!longNames) throw new ArchiveError(`Ar archive member '${name}' references a missing long-name table`);\n\t\t\tconst resolved = resolveLongName(name, longNames, options.limits);\n\t\t\tname = resolved.name;\n\t\t\tnameByteLength = resolved.byteLength;\n\t\t} else {\n\t\t\tname = shortName(name);\n\t\t}\n\t\tif (isMetadataName(name)) continue;\n\t\tassertArchivePathBytes(nameByteLength, \"member path\", options.limits.maxPathBytes);\n\t\tassertArchiveMemberSize(record.size, name, options.limits);\n\t\tconst path = normalizeArchiveEntryPath(name);\n\t\tif (!path) continue;\n\t\tconst isDirectory = record.mode !== undefined && (record.mode & FILE_TYPE_MASK) === DIRECTORY_TYPE;\n\t\tconst entry: ArchiveIndexEntry = {\n\t\t\tpath,\n\t\t\tisDirectory,\n\t\t\tsize: isDirectory ? 0 : record.size,\n\t\t\t...(record.mtimeSeconds !== undefined ? { mtimeMs: record.mtimeSeconds * 1000 } : {}),\n\t\t\t...(record.mode !== undefined ? { mode: record.mode } : {}),","sourceCodeStart":142,"sourceCodeEnd":178,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/utils/src/ar/unix-ar.ts#L142-L178","documentation":"A member header uses the '/NNN' long-name convention, but no '//' long-name table member was seen earlier in the archive. Without the table the name cannot be resolved, so the reader rejects the archive rather than fabricating a name.","triggerScenarios":"Parsing an ar archive containing a header whose raw name matches /^\\/\\d+$/ while the '//'-named table member is absent, out of order (after the referring member), or was consumed under different limits.","commonSituations":"Archives produced by tools that emit long names but omit or misorder the '//' table; concatenated archives where the table lives in the first segment; corruption that dropped the table member.","solutions":["Rebuild the archive with ar so the long-name table is emitted correctly.","Check the archive is complete and not concatenated from partial segments.","Extract with a tolerant tool (e.g. `ar x`) to recover members, then repack.","If you produce archives, ensure the '//' member precedes any member with a '/NNN' name."],"exampleFix":"// before\n$ ar rcs bad.a file-with-a-very-long-name.txt  // tool failed to emit table\n// after: repack with a conforming ar\n$ ar rcs good.a file-with-a-very-long-name.txt","handlingStrategy":"validation","validationCode":"function referencesLongNames(names: string[]): boolean {\n  return names.some(n => /^\\/\\d+$/.test(n));\n}\n// scan raw headers first; if any '/NNN' name exists, require a '//' member before parsing","typeGuard":null,"tryCatchPattern":"try {\n  return await readUnixAr(source);\n} catch (err) {\n  if (err instanceof ArchiveError && err.message.includes('missing long-name table')) {\n    throw new Error('archive malformed: member names reference an absent // table');\n  }\n  throw err;\n}","preventionTips":["Always create archives with a conforming ar (GNU/binutils) rather than custom writers.","Never concatenate ar archives with member-rewriting tools that drop the '//' member.","Use short filenames (<16 chars) when you control naming, avoiding the long-name path entirely.","Test generated archives with `ar t` and this parser before shipping."],"tags":["archive","ar-format","parsing","corrupt-file"],"backgroundTag":"missing-ar-long-name-table","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}