Skip to content
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

tests fail #2

Closed
mr-c opened this issue Dec 14, 2018 · 6 comments
Closed

tests fail #2

mr-c opened this issue Dec 14, 2018 · 6 comments

Comments

@mr-c
Copy link
Contributor

mr-c commented Dec 14, 2018

Hello,

I'm packaging gbwt for Debian; thank you for your contribution to open source scientific software.

One of the tests fail. Can you give us some advice?

$ uname -a
Linux mrcdev 4.18.0-2-amd64 #1 SMP Debian 4.18.10-2 (2018-11-02) x86_64 GNU/Linux
mcrusoe@mrcdev:~/debian/gbwt$ gcc --version
gcc (Debian 8.2.0-12) 8.2.0
[----------] 6 tests from BasicHaplotypes/VariantTest
[ RUN      ] BasicHaplotypes/VariantTest.VariantPathsStatistics/0
test_variants: /usr/include/sdsl/int_vector_buffer.hpp:217: sdsl::int_vector_buffer<t_width>& sdsl::int_vector_buffer<t_width>::operator=(sdsl::int_vector_buffer<t_width>&&) [with unsigned char t_width = 8]: Assertion `m_ifile.good()' failed. 

The current patches are at https://salsa.debian.org/med-team/gbwt/tree/master/debian/patches

@jltsiren
Copy link
Owner

Was this the first test you ran? Many of the tests write temporary files to the current directory, and the error message suggests that opening the file failed.

@mr-c
Copy link
Contributor Author

mr-c commented Dec 14, 2018

Hello @jltsiren. I ran the tests via cd tests && make test.

@jltsiren
Copy link
Owner

This is fundamentally an SDSL issue. A default constructed sdsl::int_vector_buffer is not backed by any file. When you move assign the default constructed object to another sdsl::int_vector_buffer, the assignment operator tries to open a file with an empty name, which obviously fails. If you compile without -DNDEBUG, the assertion m_ifile.good() then fails. Otherwise the code works correctly.

On a certain level, the issue is that you compile code using SDSL without -DNDEBUG. People rarely do that. As a result, incorrect assertions can remain unnoticed for years, if the code itself works correctly. I've seen similar issues with SDSL before, and the solution has always been -DNDEBUG.

@mr-c
Copy link
Contributor Author

mr-c commented Jan 10, 2019

Thank you @jltsiren for the reply; I've added -DNDEBUG to our build and that has fixed the tests. Perhaps it should be mentioned in the README or the Makefile amended?

@jltsiren
Copy link
Owner

There is a mention in README now. The makefile takes the options from $(SDSL_DIR)/Make.helper, where -DNDEBUG is enabled by default.

@mr-c
Copy link
Contributor Author

mr-c commented Jan 11, 2019

Thanks!

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

No branches or pull requests

2 participants