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

Function so_extract_crashes

tests/test_stack_overflow.c:416–442  ·  view source on GitHub ↗

Run cbm_extract_file in a forked child; true if the child died by signal. * Mirrors tests/test_lang_contract.c. On Windows run in-process (a genuine * crash there aborts the runner — hard, visible failure). */

Source from the content-addressed store, hash-verified

414 * Mirrors tests/test_lang_contract.c. On Windows run in-process (a genuine
415 * crash there aborts the runner — hard, visible failure). */
416static bool so_extract_crashes(const char *content, CBMLanguage lang, const char *relpath) {
417#if defined(_WIN32)
418 CBMFileResult *r =
419 cbm_extract_file(content, (int)strlen(content), lang, "so", relpath, 0, NULL, NULL);
420 if (r) {
421 cbm_free_result(r);
422 }
423 return false;
424#else
425 fflush(NULL);
426 pid_t pid = fork();
427 if (pid < 0) {
428 return false;
429 }
430 if (pid == 0) {
431 CBMFileResult *r =
432 cbm_extract_file(content, (int)strlen(content), lang, "so", relpath, 0, NULL, NULL);
433 if (r) {
434 cbm_free_result(r);
435 }
436 _exit(0);
437 }
438 int status = 0;
439 (void)waitpid(pid, &status, 0);
440 return WIFSIGNALED(status);
441#endif
442}
443
444#if !defined(_WIN32)
445/* Child-side alarm handler: a clean exit on the deadline — never reached on

Callers 1

Calls 2

cbm_extract_fileFunction · 0.85
cbm_free_resultFunction · 0.85

Tested by

no test coverage detected