{"record":{"id":"629a4faa4b344142","repo":"owasp-amass/amass","slug":"executable-path-is-empty","errorCode":null,"errorMessage":"executable path is empty","messagePattern":"executable path is empty","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/amass/process.go","lineNumber":36,"sourceCode":"\tc, err := client.NewClient(\"http://127.0.0.1:4000\")\n\tif err != nil {\n\t\treturn false\n\t}\n\tdefer c.Close()\n\n\tctx, cancel := context.WithTimeout(context.Background(), 2*time.Second)\n\tdefer cancel()\n\n\treturn c.HealthCheck(ctx)\n}\n\nfunc startEngine() error {\n\tp, err := os.Executable()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to get executable path: %w\", err)\n\t}\n\tif p == \"\" {\n\t\treturn fmt.Errorf(\"executable path is empty\")\n\t}\n\n\tcmd := initCmd(p)\n\tif cmd == nil {\n\t\treturn fmt.Errorf(\"failed to initialize command for %s\", p)\n\t}\n\tcmd.Stdout = io.Discard\n\tcmd.Stderr = io.Discard\n\tcmd.Stdin = os.Stdin\n\n\tcmd.Dir, err = os.Getwd()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn cmd.Start()\n}\n","sourceCodeStart":18,"sourceCodeEnd":54,"githubUrl":"https://github.com/owasp-amass/amass/blob/79299dce87b0085db0f2f4ef3e9c52cccb49f514/cmd/amass/process.go#L18-L54","documentation":"After os.Executable() succeeds, startEngine guards against an empty string path. An empty path would produce a meaningless child command, so this error is returned. In practice this is nearly unreachable when os.Executable() returns nil error, but it protects against platform quirks.","triggerScenarios":"os.Executable() returning (\"\", nil) on a non-conforming platform/runtime — extremely rare defensive branch.","commonSituations":"Custom or embedded Go runtimes, unusual sandboxing layers, or modified os package behavior where the executable path cannot be resolved yet no error is reported.","solutions":["Investigate the runtime environment — stock Go on Linux/macOS/Windows will not return an empty path with nil error.","Provide an explicit binary path alternative if you control the launch flow, rather than relying on os.Executable().","Upgrade the Go toolchain/runtime if using a non-standard port."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"p, err := os.Executable()\nif err != nil || p == \"\" {\n    return fmt.Errorf(\"executable path unavailable: %v\", err)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use a standard Go toolchain and OS; this branch is defensive only.","Validate os.Executable() output early in main rather than deep in startup."],"tags":["process","go","edge-case"],"backgroundTag":"executable-path-resolution-failed","analyzedSha":"79299dce87b0085db0f2f4ef3e9c52cccb49f514","analyzedAt":"2026-09-06T08:22:48.198Z","contentChangedAt":"2026-09-06T08:22:48.198Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}