From b3c462ede4ce9fcfc299c5cb6edd2db92b19cf90 Mon Sep 17 00:00:00 2001 From: Rongsong Shen Date: Wed, 26 Aug 2026 14:30:13 +0000 Subject: [PATCH] chore(wolf): checkpoint buglog.json (1057 bugs) --- .wolf/buglog.json | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.wolf/buglog.json b/.wolf/buglog.json index 8dc5d243..ba457e0d 100644 --- a/.wolf/buglog.json +++ b/.wolf/buglog.json @@ -19542,6 +19542,27 @@ ], "occurrences": 1, "last_seen": "2026-08-26T20:15:00Z" + }, + { + "id": "bug-1716", + "timestamp": "2026-08-26T14:25:00Z", + "error_message": "test_rcfile_load_directory_path_warns_and_returns_0:FAIL: Expected TRUE Was FALSE (stderr capture was empty -- no warning printed) when rcfile_load() opened a directory path", + "file": "src/controller/testsuite/rcfile.c", + "root_cause": "On this platform (glibc/Linux), fopen(path, \"r\") SUCCEEDS for a directory path -- it does not return NULL/set errno the way the design doc's error-handling section (and a naive reading of 'the file could not be opened for another reason') implied. The open failure only surfaces on the FIRST READ: getline() returns -1 with errno==EISDIR and ferror(f) set (feof(f) stays 0). rcfile_load()'s original implementation only checked `if (!f)` right after fopen() and had no post-loop check on the stream's error state, so a directory path silently produced rc=0 with zero lines processed and NO warning ever printed -- functionally 'safe' (no crash, no runner call) but silently violating the design's documented 'present but unreadable: print one stderr warning' contract for exactly this case.", + "fix": "Added a check after the getline() loop in rcfile_load(): `if (rc == 0 && ferror(f)) { fprintf(stderr, ...); }` -- prints the same warning message used for the fopen()-failure branch, keyed off ferror(f) rather than assuming the failure is only detectable at fopen() time. Confirmed live via a small standalone C repro (fopen(\"/tmp\",\"r\") then fread/getline) that fopen() returns a valid FILE* for a directory and the read call is what fails with EISDIR + ferror set.", + "tags": [ + "rcfile", + "fopen", + "EISDIR", + "directory", + "getline", + "xce-test-rc-file", + "controller-testsuite", + "stderr-warning" + ], + "related_bugs": [], + "occurrences": 1, + "last_seen": "2026-08-26T14:25:00Z" } ] }