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

Offen
#396 10 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
48/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
c, haskell

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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.

Vorherrschende Sprache
Haskell
Sterne
91
Forks
93
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Entwicklungsumgebung

Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus haskell/process

Alle Issues in haskell/process

Ähnliche Issues

Weitere Issues zu Haskell

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.