MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / printCrashDiagnostics

Function printCrashDiagnostics

freebuff/cli/release/index.js:524–570  ·  view source on GitHub ↗
(code, signal)

Source from the content-addressed store, hash-verified

522}
523
524function printCrashDiagnostics(code, signal) {
525 // Windows NTSTATUS codes (unsigned DWORD)
526 const unsignedCode = getUnsignedExitCode(code)
527 const isIllegalInstruction =
528 signal === 'SIGILL' ||
529 (process.platform === 'win32' && unsignedCode === 0xC000001D)
530 const isAccessViolation =
531 signal === 'SIGSEGV' ||
532 (process.platform === 'win32' && unsignedCode === 0xC0000005)
533 const isBusError = signal === 'SIGBUS'
534 const isAbort =
535 signal === 'SIGABRT' ||
536 (process.platform === 'win32' && unsignedCode === 0xC0000409)
537
538 if (!isIllegalInstruction && !isAccessViolation && !isBusError && !isAbort) return
539
540 const exitInfo = signal ? `signal ${signal}` : `code ${code}`
541 console.error('')
542 console.error(`❌ ${packageName} exited immediately (${exitInfo})`)
543 console.error('')
544
545 if (isIllegalInstruction) {
546 console.error('Your CPU may not support the required instruction set (AVX2).')
547 console.error('This typically affects CPUs from before 2013.')
548 console.error('Unfortunately, this binary is not compatible with your system.')
549 console.error('')
550 } else if (isAccessViolation) {
551 console.error('The binary crashed with an access violation.')
552 console.error('')
553 } else if (isBusError) {
554 console.error('The binary crashed with a bus error.')
555 console.error('This may indicate a platform compatibility issue.')
556 console.error('')
557 } else if (isAbort) {
558 console.error('The binary crashed with an abort signal.')
559 console.error('')
560 }
561
562 console.error('System info:')
563 console.error(` Platform: ${process.platform} ${process.arch}`)
564 console.error(` Node: ${process.version}`)
565 console.error(` Binary: ${CONFIG.binaryPath}`)
566 console.error('')
567 console.error('Please report this issue at:')
568 console.error(' https://github.com/CodebuffAI/codebuff/issues')
569 console.error('')
570}
571
572function getInstalledBinaryStatus() {
573 try {

Callers 2

checkForUpdatesFunction · 0.70
exitListenerFunction · 0.70

Calls 1

getUnsignedExitCodeFunction · 0.70

Tested by

no test coverage detected