Hello,
After upgrading to Cygwin 3.6.10, opening a fifo endpoint causes a
deadlock.
(Found in the LLVM testsuite,
llvm/unittests/Analysis/MLModelRunnerTest.cpp:
InteractiveModelRunner::Evaluation).
reproducer:
$ gcc fifotest.c && ./a
trying to open /tmp/thetestfifo.pipe for write
trying to open /tmp/thetestfifo.pipe for read
(hangs here, and some of runs ignore Ctrl+C)
Opening a fifo is blocked correctly until another endpoint is opened.
However, Cygwin 3.6.10 never returns, even after both endpoints are
requested to be opened.
Downgrading to Cygwin 3.6.9 results in successful runs:
$ gcc fifotest.c && ./a
trying to open /tmp/thetestfifo.pipe for write
trying to open /tmp/thetestfifo.pipe for read
wr = 3
rd = 4
fifotest.c:
#include <fcntl.h>
#include <unistd.h>
#include <stdio.h>
#include <pthread.h>
const char *name = "/tmp/thetestfifo.pipe";
void *bg() {
printf("trying to open %s for read\n", name);
int rd = open(name, O_RDONLY);
printf("rd = %d\n", rd);
close(rd);
return 0;
}
int main() {
mkfifo(name, 0666);
pthread_t thr;
pthread_create(&thr, 0, bg, 0);
printf("trying to open %s for write\n", name);
int wr = open(name, O_WRONLY);
printf("wr = %d\n", wr);
close(wr);
void *thret;
pthread_join(thr, &thret);
unlink(name);
}
Regards,
--
Tomohiro Kashiwada (@kikairoya)
#include <fcntl.h>
#include <unistd.h>
#include <stdio.h>
#include <pthread.h>
const char *name = "/tmp/thetestfifo.pipe";
void *bg() {
printf("trying to open %s for read\n", name);
int rd = open(name, O_RDONLY);
printf("rd = %d\n", rd);
close(rd);
return 0;
}
int main() {
mkfifo(name, 0666);
pthread_t thr;
pthread_create(&thr, 0, bg, 0);
printf("trying to open %s for write\n", name);
int wr = open(name, O_WRONLY);
printf("wr = %d\n", wr);
close(wr);
void *thret;
pthread_join(thr, &thret);
unlink(name);
}
--
Problem reports: https://cygwin.com/problems.html
FAQ: https://cygwin.com/faq/
Documentation: https://cygwin.com/docs.html
Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple