Skip to content

fstReaderOpen should not fail on empty FST file#15

Merged
tbybell merged 1 commit intogtkwave:mainfrom
nickg:empty-file
Apr 9, 2025
Merged

fstReaderOpen should not fail on empty FST file#15
tbybell merged 1 commit intogtkwave:mainfrom
nickg:empty-file

Conversation

@nickg
Copy link
Copy Markdown
Contributor

@nickg nickg commented Apr 8, 2025

I've received a couple of bug reports where users reported that GtkWave was unable to open FST files generated by NVC. This is often caused by the FST file being empty (e.g. nickg/nvc#1183 where the user accidentally excluded all signals).

If the FST file is valid but contains no data fstReaderOpen returns NULL. It seems better to return a valid handle instead.

Copy link
Copy Markdown
Contributor

@rfuest rfuest left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding a test for this. There seems to be some unrelated issue that makes the it fail on Linux and macOS, because out.fst already exists from running the previous test. If you change the filename in the empty file test to something distinct like empty_file.fst it should pass.

@nickg
Copy link
Copy Markdown
Contributor Author

nickg commented Apr 8, 2025

There seems to be some unrelated issue that makes the it fail on Linux and macOS, because out.fst already exists from running the previous test.

I think it's perhaps caused by meson test running the two tests concurrently. Should be fixed now.

@nickg nickg requested a review from rfuest April 8, 2025 20:39
Copy link
Copy Markdown
Contributor

@rfuest rfuest left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but I'll let @tbybell take another look and merge the PR.

I think it's perhaps caused by meson test running the two tests concurrently. Should be fixed now.

I hadn't thought about that as a possible cause for the issue, but I think you are right. I've tried to run the tests using meson test -j1 before applying your changes and I couldn't trigger the error.

@rfuest rfuest requested a review from tbybell April 9, 2025 02:10
@tbybell tbybell merged commit 6a52070 into gtkwave:main Apr 9, 2025
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants