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

Function so_extract_crashes

tests/test_stack_overflow.c:415–441  ·  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

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

Callers 1

Calls 2

cbm_extract_fileFunction · 0.85
cbm_free_resultFunction · 0.85

Tested by

no test coverage detected