nodejs/node · error
0
0
Error message
%s:%d: Internal error, line too long (greater than 1023 chars)\n
What it means
In pkg_writeCharList (pkgtypes.c), a CharList string is being copied into a fixed 1024-byte buffer with uprv_strncpy(buffer,l->str,1023). If the string length is >= 1023 the function prints this internal error (with __FILE__ and __LINE__) and calls exit(0). Because exit code is 0, downstream tools may miss the failure — treat a 1024-char-plus list entry as a hard data defect.
Source
Thrown at deps/icu-small/source/tools/pkgdata/pkgtypes.c:87
}
l = l->next;
}
return NULL;
}
const char *pkg_writeCharList(FileStream *s, CharList *l, const char *delim, int32_t quote)
{
char buffer[1024];
while(l != NULL)
{
if(l->str)
{
uprv_strncpy(buffer, l->str, 1023);
buffer[1023]=0;
if(uprv_strlen(l->str) >= 1023)
{
fprintf(stderr, "%s:%d: Internal error, line too long (greater than 1023 chars)\n",
__FILE__, __LINE__);
exit(0);
}
if(quote < 0) { /* remove quotes */
if(buffer[uprv_strlen(buffer)-1] == '"') {
buffer[uprv_strlen(buffer)-1] = '\0';
}
if(buffer[0] == '"') {
uprv_strcpy(buffer, buffer+1);
}
} else if(quote > 0) { /* add quotes */
if(l->str[0] != '"') {
uprv_strcpy(buffer, "\"");
uprv_strcat(buffer, l->str);
}
if(l->str[uprv_strlen(l->str)-1] != '"') {
uprv_strcat(buffer, "\"");
}View on GitHub (pinned to 1b2de5e052)
Solutions
- Identify which CharList entry exceeds 1023 chars and shorten it (rename/split the resource).
- Regenerate the data file list so no single token is overlong.
- Audit upstream genrb/gencnval output for abnormally long names.
- Re-run with verbose output to find the offending entry before the abort.
Example fix
// before: a single CharList token > 1023 chars writeCharList emits a 2000-char path -> exit(0) // after: shorten/segment the resource name // keep each entry < 1023 chars, regenerate the list
Defensive patterns
Strategy: validation
Validate before calling
// Reject any CharList entry that would overflow the 1023-byte write buffer.
#include <string.h>
bool allEntriesFit(const char *entries[], size_t n) {
for (size_t i = 0; i < n; ++i)
if (entries[i] && strlen(entries[i]) >= 1023) return false;
return true;
} Prevention
- Keep every CharList token under 1023 characters.
- Rename/split overlong resource paths.
- Regenerate file lists so no single token is huge.
- Note the exit code is 0 — add your own length checks since tooling may not flag it.
When it happens
Trigger: Any CharList entry written via pkg_writeCharList that is 1023 characters or longer: a very long filename, a path, or a data item name. The buffer is fixed at compile time so there is no dynamic fallback.
Common situations: A locale/resource path with an extreme number of translit or subtags; a generated file list with a single concatenated token; malformed data producing an oversized name.
Related errors
- ## ERR: Path too long [%d chars]: %s\n
- U_ILLEGAL_ARGUMENT_ERROR
- Error generating assembly code for data.
- -1
- Error generating package data.
AI-assisted analysis of nodejs/node@1b2de5e052 (2026-08-13).
Data as JSON: /api/errors/06d266d3fba3553d.
Report an issue: GitHub.