MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / rh_extract_crashes

Function rh_extract_crashes

tests/repro/repro_harness.h:170–193  ·  view source on GitHub ↗

TIER B: returns true if cbm_extract_file CRASHES (signal) on `content`. * Runs in a forked child so the crash doesn't take down the repro runner. */

Source from the content-addressed store, hash-verified

168/* TIER B: returns true if cbm_extract_file CRASHES (signal) on `content`.
169 * Runs in a forked child so the crash doesn't take down the repro runner. */
170static inline bool rh_extract_crashes(const char *content, CBMLanguage lang, const char *relpath) {
171#if defined(_WIN32)
172 CBMFileResult *r =
173 cbm_extract_file(content, (int)strlen(content), lang, "repro", relpath, 0, NULL, NULL);
174 if (r)
175 cbm_free_result(r);
176 return false;
177#else
178 fflush(NULL);
179 pid_t pid = fork();
180 if (pid < 0)
181 return false;
182 if (pid == 0) {
183 CBMFileResult *r =
184 cbm_extract_file(content, (int)strlen(content), lang, "repro", relpath, 0, NULL, NULL);
185 if (r)
186 cbm_free_result(r);
187 _exit(0);
188 }
189 int status = 0;
190 (void)waitpid(pid, &status, 0);
191 return WIFSIGNALED(status);
192#endif
193}
194
195#endif /* REPRO_HARNESS_H */

Callers

nothing calls this directly

Calls 3

cbm_extract_fileFunction · 0.85
cbm_free_resultFunction · 0.85
_exitFunction · 0.85

Tested by

no test coverage detected