Maybe the C code uses the global `errno` on illumos

Aperta
#396 10 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
c, haskell

Direzione di ricerca

Read cbits/posix/runProcess.c, cbits/posix/fork_exec.c, and cbits/posix/posix_spawn.c alongside the Solaris condition in process.cabal. Check how illumos exposes errno with and without _REENTRANT, then confirm whether the affected objects reference the global symbol in a threaded build. Done means establishing whether process calls can report another thread’s errno and identifying a supported fix.

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

Descrizione

bug

Hi,

I am new to Haskell and to illumos, so I may well have this wrong.

I use GHC 9.10.3 from SmartOS pkgsrc, with process 1.6.26.1. SmartOS is illumos.

On illumos, errno is per thread only when _REENTRANT, or a similar macro, is defined before <errno.h>. Without it, errno is one global int that belongs to the first thread.

runProcess.c, fork_exec.c and posix_spawn.c in cbits/posix include <errno.h> without it. elfdump -s shows the global errno in those three objects, and master looks the same.

So in the threaded RTS, an error from a process call made on another OS thread may be reported wrongly. I have not seen it happen. I only read the code and the symbols.

Maybe cc-options: -D_REENTRANT under if os(solaris) in process.cabal would help, but you know best.

Thank you very much for your time and for process.

Lingua principale
Haskell
Stelle
91
Fork
93
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

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 haskell/process

Tutte le issue di haskell/process

Issue simili

Altre issue su Haskell

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.