-
Notifications
You must be signed in to change notification settings - Fork 860
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
Several tests fail #3505
Comments
I suspect this to be a FreeBSD related issue, as it doesn't seem to happen on our CI, nor can I reproduce it locally on my own system. I'll set up a FreeBSD VM to test in when I have a chance to see if I can reproduce it then. |
FYI I see this same error on NetBSD when compiling with clang. (Compiling Yosys with GCC on NetBSD doesn't get this far through the tests). |
I have zeroed in on the code in libs/fst/fstapi.cc:fstReaderInit() where it starts with "if (zhandle)". About line 4276. So what appears to be happening on NetBSD is that the initial read of grom.fst via stdio is buffered and so even though ftell() reports that file position is 17, the seek position of the underlying file descriptor is 905 (the end of the file). The file descriptor is then dup()ed and the new file descriptor's seek position is shared with the original file descriptor and so it is still 905. gzread() then has nothing to read because we are at EOF. I added the line "lseek(zfd, ftell(xc->f), SEEK_SET);" just after line 4274 so that the new file descriptor was positioned where we have asked stdio to read upto. This unit test still doesn't work, but at least it doesn't exit after failing to read the FST file. |
I think I've fixed this and I've created PR #3512 for it. It's just two lines of code. |
Fixed with #3512 |
Version
0.22
Reproduction Steps
make test
Expected Behavior
n/a
Actual Behavior
The text was updated successfully, but these errors were encountered: