-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PipeFail test does not finish #25
Comments
Thanks for spending some time to look into this issue. It's weird to me that the problem is triggered with different number of lines or characters. Even on the same machine, I think I get slightly random failure points. As I noted in #2, I suspect the primary problem is that both the |
Hello, The ICANON mode, fixed for stdin, seems to cause the brutal termination of Putchar when the buffer is full. To avoid this simply replace putchar by the POSIX write system call (2). New version of cores/StdioSerial.cpp that works for me: /*
* Copyright (c) 2019 Brian T. Park
* MIT License
*/
#include <stdio.h>
#include <unistd.h>
#include "StdioSerial.h"
size_t StdioSerial::write(uint8_t c) {
int result=::write(STDOUT_FILENO, &c, 1);
return (result == EOF) ? 0 : 1;
}
void StdioSerial::flush() {
fflush(stdout);
}
StdioSerial Serial;
Thanks for Epoxy ;-) |
@supercc-arduino: Thanks for the note. I'm not sure that |
I believe I have finally fixed this with bf6248f. |
While trying to root-cause #2 I ran into a different issue.
I am running with a modified PipeFail.ino. With 2000 I can't reproduce this issue nor #2.
Now when I run PipeFail.out it looks like this:
It fails at different places but usually after 10k iterations.
It turns out the
putchar
inStdioSerial::write
returnsEOF
. When I played with it turned out errno is set to EAGAIN (Resource temporarily unavailable).The following patch fixes it for me:
The text was updated successfully, but these errors were encountered: