Condition raised when stderr is missing
Bug #1887913 reported by
Pierre Neidhardt
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Incomplete
|
Undecided
|
Unassigned |
Bug Description
If I start a Common Lisp program that outputs to stderr and then remove the stderr file descriptor, the program will raise a condition when emitting warnings for instance.
Example using Bash:
$ ./foo-program &
$ exit
I suppose this is normal that SBCL raises a condition when stderr is missing and it tries to output a warning. (Is it specified by the standard?) Is there a way to handle these conditions so that the program does not hang on warnings?
See https:/
To post a comment you must log in.
There's a lot of missing information in this report.
I don't know what "foo-program" is, nor what "nyxt" is so that's not really an example of SBCL behavior at any rate.
As to the problem statement: "It outputs to stderr and then ... remove" - is this to imply that "It outputs to stderr" with success, i.e. visibly? Then I'm not sure what the point is.
Or is it meant to suggest that some output was placed in *ERROR-OUTPUT* which was buffered prior to closing stderr?
The solution could be to call (FORCE-OUTPUT) if you're asking how to make missing output appear.
SBCL's *error-output* is line-buffered, the same as stdio's stderr.
(I'm assuming that "removed" means "closed" - "removed" is not a concept that pertains to a file descriptor, though it may pertain to an on-disk object)
If you're asking to have no condition be raised when a file descriptor is not writable, then I don't know why you would want that.