{"record":{"id":"752029fa0bdda23a","repo":"junegunn/fzf","slug":"could-not-create-block-profile-w","errorCode":null,"errorMessage":"could not create BLOCK profile: %w","messagePattern":"could not create BLOCK profile: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/options_pprof.go","lineNumber":58,"sourceCode":"\t\t}\n\t}\n\n\tif o.MEMProfile != \"\" {\n\t\tf, err := os.Create(o.MEMProfile)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"could not create MEM profile: %w\", err)\n\t\t}\n\t\tutil.AtExit(func() {\n\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":40,"sourceCodeEnd":74,"githubUrl":"https://github.com/junegunn/fzf/blob/bd4efa277b49ef34ca4025bff9b1a288e1980eff/src/options_pprof.go#L40-L74","documentation":"In a pprof build, fzf could not create the block-profile output file specified by --profile-block. The runtime block rate is set first, then os.Create is attempted; failure aborts with the wrapped OS error.","triggerScenarios":"Passing --profile-block with a path in a nonexistent/read-only directory or a path that is itself a directory.","commonSituations":"Profiling scripts assuming a scratch directory exists; read-only containers where the only writable path is /tmp.","solutions":["Create and verify the output directory: mkdir -p /tmp/prof && touch /tmp/prof/block.out","Use /tmp or another guaranteed-writable path","Read the wrapped error for the precise cause"],"exampleFix":"# before\nfzf --profile-block ./out/block.prof   # ./out missing\n# after\nmkdir -p ./out && fzf --profile-block ./out/block.prof","handlingStrategy":"validation","validationCode":"d=/tmp/fzf-prof; mkdir -p \"$d\" && [ -w \"$d\" ] || exit 1\nfzf --profile-block \"$d/block.prof\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate profile paths once in a wrapper script","Avoid profiling into read-only mount points like /proc or /sys"],"tags":["fzf","pprof","profiling","block","filesystem"],"backgroundTag":null,"analyzedSha":"bd4efa277b49ef34ca4025bff9b1a288e1980eff","analyzedAt":"2026-08-15T06:11:46.983Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}