{"record":{"id":"f96894973eb97d19","repo":"go-delve/delve","slug":"malformed-proc-pid-maps-on-line-d-q-permissio","errorCode":null,"errorMessage":"malformed /proc/pid/maps on line %d: %q (permissions column too short)","messagePattern":"malformed /proc/pid/maps on line (.+?): %q \\(permissions column too short\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/proc/native/dump_linux.go","lineNumber":106,"sourceCode":"\tv := strings.Split(fields[0], \"-\")\n\tif len(v) != 2 {\n\t\terr = fmt.Errorf(\"malformed /proc/pid/maps on line %d: %q (bad first field)\", lineno, in)\n\t\treturn\n\t}\n\tstart, err = strconv.ParseUint(v[0], 16, 64)\n\tif err != nil {\n\t\terr = fmt.Errorf(\"malformed /proc/pid/maps on line %d: %q (%v)\", lineno, in, err)\n\t\treturn\n\t}\n\tend, err = strconv.ParseUint(v[1], 16, 64)\n\tif err != nil {\n\t\terr = fmt.Errorf(\"malformed /proc/pid/maps on line %d: %q (%v)\", lineno, in, err)\n\t\treturn\n\t}\n\n\tperm = fields[1]\n\tif len(perm) < 4 {\n\t\terr = fmt.Errorf(\"malformed /proc/pid/maps on line %d: %q (permissions column too short)\", lineno, in)\n\t\treturn\n\t}\n\n\toffset, err = strconv.ParseUint(fields[2], 16, 64)\n\tif err != nil {\n\t\terr = fmt.Errorf(\"malformed /proc/pid/maps on line %d: %q (%v)\", lineno, in, err)\n\t\treturn\n\t}\n\n\tdev = fields[3]\n\n\t// fields[4] -> inode\n\n\tfilename = strings.TrimLeft(fields[5], \" \")\n\treturn\n\n}\n","sourceCodeStart":88,"sourceCodeEnd":124,"githubUrl":"https://github.com/go-delve/delve/blob/a23773e6c31361e43246bc43a424ee009679b174/pkg/proc/native/dump_linux.go#L88-L124","documentation":"The permissions column (fields[1]) of the maps line is shorter than the mandatory 4 characters ('rwxp' style: r/w/x plus shared/private flag). A shorter permissions string cannot encode the mapping's protection, so MemoryMap fails.","triggerScenarios":"parseSmapsHeaderLine receiving a maps line like '00400000-00401000 rw' — a truncated or hand-modified permissions column, or a non-Linux procfs emulation emitting 3-char permission strings.","commonSituations":"Custom seccomp/gVisor/FUSE procfs implementations that trim the private/shared flag; corrupted line from a race; hand-crafted test maps files missing the 4th perm char.","solutions":["Check the raw line: the perms column must be 4 chars (e.g. 'r-xp'); if the source file is hand-made, fix it to include the 4th character.","Test whether the sandbox (gVisor, LXC) alters /proc/pid/maps and run outside it if so.","Retry the read — transient truncation produces short fields.","If integrating with a custom procfs, make it emit kernel-compatible permission strings."],"exampleFix":"// before: hand-crafted maps line for tests\n\"00400000-00401000 r-x  00000000 08:01 1234  /bin/app\"\n// after\n\"00400000-00401000 r-xp 00000000 08:01 1234  /bin/app\"","handlingStrategy":"validation","validationCode":"perms := strings.Fields(line)[1]\nif len(perms) < 4 { return fmt.Errorf(\"perms column too short in %q\", line) }\nfor _, c := range perms[:4] { if !strings.ContainsRune(\"rwxps-\", c) { return fmt.Errorf(\"bad perm char %q\", c) } }","typeGuard":"func validPerms(s string) bool { return len(s) >= 4 && strings.Trim(s[:4], \"rwxps-\") == \"\" }","tryCatchPattern":"if err != nil && strings.Contains(err.Error(), \"permissions column too short\") {\n    // detect sandbox-altered procfs and warn the user\n    return fmt.Errorf(\"%w (sandboxed procfs suspected)\", err)\n}","preventionTips":["Ensure any generated maps fixtures include the 4-character permission string (e.g. 'r-xp').","Check whether your sandbox (gVisor, custom procfs) truncates permission columns.","Trim line endings so the perm field isn't merged/split incorrectly.","Diff your procfs output against standard kernel output when integrating custom emitters."],"tags":["linux","procfs","core-dump","delve"],"backgroundTag":"malformed-proc-maps-line","analyzedSha":"a23773e6c31361e43246bc43a424ee009679b174","analyzedAt":"2026-08-31T15:12:45.221Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}