Opened 8 years ago

Last modified 2 years ago

#13544 assigned bug

Possible bug in setvbuf handling

Reported by: miqlas Owned by:
Priority: normal Milestone: Unscheduled
Component: Applications/Terminal Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

The latest fish-shell doesn't print newline character after the commands. The fish developers concluded it could be abug in the setvbuf handling in Haiku:

I've determined the problem is due to a bug in the setvbuf() function on Haiku. Fish calls it to set stdout to fully unbuffered. That causes any subsequent writes using that file handle to discard the output. It only seems to affect wide char output. If you compile and run the following program you'll see that "goodbye" isn't seen:


{{{
#include <stdio.h>
#include <wchar.h>
int main() {
    fwprintf(stdout, L"hello\n");
    setvbuf(stdout, NULL, _IONBF, 0);
    fwprintf(stdout, L"goodbye\n");
}
}}}


If you switch to fprintf() it works.

I think I'm still going to replace the fputwc() calls with simple write() calls since that should be okay but you should file a bug with the Haiku project about this.

Original issue at fish-shell page: https://github.com/fish-shell/fish-shell/issues/4100

Change History (5)

comment:1 by waddlesplash, 8 years ago

fish has worked around the bug upstream; the reduced testcase is valid of course.

comment:2 by miqlas, 7 years ago

Maybe relevant:

The current fish version in HaikuPorts is completly broken on current Haiku. I'm sure i used this Fish version on earlier Haiku revision without problems like this.

comment:3 by miqlas, 6 years ago

Should we mark this as beta-blocker?

comment:4 by pulkomandy, 6 years ago

No. A beta is feature complete but it may have bugs. These can get fixed in later updates, and then released in beta2 (we will try very hard to not release it in 2025).

comment:5 by jackburton, 2 years ago

Owner: jackburton removed
Status: newassigned
Note: See TracTickets for help on using tickets.