{"record":{"id":"b204c748308acb53","repo":"junegunn/fzf","slug":"could-not-create-mutex-profile-w","errorCode":null,"errorMessage":"could not create MUTEX profile: %w","messagePattern":"could not create MUTEX profile: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/options_pprof.go","lineNumber":67,"sourceCode":"\t\t\truntime.GC()\n\t\t\tstopProfile(\"allocs\", f)\n\t\t})\n\t}\n\n\tif o.BlockProfile != \"\" {\n\t\truntime.SetBlockProfileRate(1)\n\t\tf, err := os.Create(o.BlockProfile)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"could not create BLOCK profile: %w\", err)\n\t\t}\n\t\tutil.AtExit(func() { stopProfile(\"block\", f) })\n\t}\n\n\tif o.MutexProfile != \"\" {\n\t\truntime.SetMutexProfileFraction(1)\n\t\tf, err := os.Create(o.MutexProfile)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"could not create MUTEX profile: %w\", err)\n\t\t}\n\t\tutil.AtExit(func() { stopProfile(\"mutex\", f) })\n\t}\n\n\treturn nil\n}\n","sourceCodeStart":49,"sourceCodeEnd":74,"githubUrl":"https://github.com/junegunn/fzf/blob/bd4efa277b49ef34ca4025bff9b1a288e1980eff/src/options_pprof.go#L49-L74","documentation":"In a pprof build, fzf could not create the mutex-profile output file specified by --profile-mutex. The mutex fraction is set, then os.Create runs; failure wraps the OS error and stops initialization.","triggerScenarios":"Passing --profile-mutex pointing at an unwritable or nonexistent location.","commonSituations":"Identical to the other profile-output errors: bad paths, missing directories, restricted permissions in the profiling environment.","solutions":["Ensure the parent directory exists and is writable","Prefer absolute paths under /tmp for profiling runs","Validate all four --profile-* paths once in your profiling wrapper script"],"exampleFix":"# before\nfzf --profile-mutex /proc/mutex.prof\n# after\nfzf --profile-mutex /tmp/mutex.prof","handlingStrategy":"validation","validationCode":"d=/tmp/fzf-prof; mkdir -p \"$d\" && [ -w \"$d\" ] || exit 1\nfzf --profile-mutex \"$d/mutex.prof\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Share one prepared profiling directory across --profile-cpu/mem/block/mutex","Fail the wrapper early if the directory is not writable instead of inside fzf"],"tags":["fzf","pprof","profiling","mutex","filesystem"],"backgroundTag":null,"analyzedSha":"bd4efa277b49ef34ca4025bff9b1a288e1980eff","analyzedAt":"2026-08-15T06:11:46.983Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}