Linux CLI 0.83.0: SIGABRT in URLSession teardown during getWithOptional

Aperta
#4,926 3 commenti 1 reazione 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
38/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
javascript, swift
Ambito
backend, cli

Direzione di ricerca

Start at the host HTTP implementation called by ctx.http.getWithOptional, then trace how its URLSession and optional request are created and torn down. Reproduce the Linux crash with the reported plugin command and inspect the teardown path around _MultiHandle. Done means the CLI returns a snapshot or provider error without aborting; the issue names no source files or tests, and the cause is still unproven.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

clawsweeper:fix-shape-clear clawsweeper:needs-maintainer-review clawsweeper:no-new-fix-pr impact:crash-loop issue-rating: 🦪 silver shellfish P1

Summary

CodexBar CLI 0.83.0 intermittently terminates with SIGABRT while a user plugin fetches a required dashboard and optional usage history through ctx.http.getWithOptional.

Two systemd coredumps show the same invocation and crash signature. The failure occurs in native URLSession teardown, so the plugin cannot handle it with JavaScript try/catch.

Environment

  • Platform: Arch Linux / Omarchy, x86_64
  • Version: CodexBar CLI 0.83.0
  • Distribution: upstream prebuilt CLI, packaged as codexbar-cli 0.83.0-1

Trigger

The affected command is:

codexbar plugins fetch shanhe-cli --json

The plugin uses host-injected Cookie authentication and fetches the dashboard and history together:

const response = await ctx.http.getWithOptional(
  dashboardURL,
  recordsURL,
  { optionalBudgetSeconds: 5 },
);

This is an intermittent failure observed in normal use; a deterministic minimal reproducer has not been established.

Expected: return a usage snapshot or a provider error without terminating the CLI.

Actual: the entire CLI process aborts with SIGABRT.

Crash evidence

The core contains the following diagnostic excerpt:

_MultiHandle deallocated with non-zero retain count 2

Abbreviated crashing stack, with intermediate frames omitted:

abort
  → swift::fatalError
  → swift_deallocClassInstance
  → FoundationNetworking.URLSession deinit
  → BlockOperation deinit
  → _Block_release
  → _dispatch_worker_thread

Another thread was waiting in QuickJSProviderPluginEngine.hostHTTP. No OOM-kill records were found around the failures.

Investigation and plugin-side workaround

The evidence establishes a native object-lifetime failure during session teardown. A concurrency race is a hypothesis; the precise cause remains unproven.

As a local workaround, only the plugin was changed to fetch the dashboard and history sequentially. The CLI binary was unchanged.

After that change, 10 consecutive real CLI invocations succeeded, preserving both usage windows and the history chart. This short validation supports the workaround but does not establish a permanent fix for the native lifetime problem.

Related reports

No matching _MultiHandle issue was found during the duplicate search. #2243 reports a different crash stack.

No credentials, response bodies, or core dumps are attached.

Lingua principale
Swift
Stelle
23.1k
Fork
2.2k
Merge medio
1g 4h
PR unite (30g)
386

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di steipete/CodexBar

Tutte le issue di steipete/CodexBar

Issue simili

Altre issue su Swift

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.