drmpeg / gr-paint

An OFDM Spectrum Painter for GNU Radio
GNU General Public License v3.0
135 stars 25 forks source link

CXXFLAGS="-D_GLIBCXX_ASSERTIONS" catches some issues #21

Closed ZeroChaos- closed 1 year ago

ZeroChaos- commented 1 year ago

When built with -D_GLIBCXX_ASSERTIONS (Gentoo and a few other distros default) we get failures:

/usr/lib/gcc/x86_64-pc-linux-gnu/12/include/g++-v12/bits/stl_vector.h:1123: std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](size_type) [with _Tp = const void*; _Alloc = std::allocator<const void*>; reference = const void*&; size_type = long unsigned int]: Assertion '__n < this->size()' failed.

These failures resolve when built with -U_GLIBCXX_ASSERTIONS, however, the preferred solution is to fix the code. I can't easily troubleshoot this to be honest, but if you can simply add -D_GLIBCXX_ASSERTIONS to your CXXFLAGS it should be reproducible.

ZeroChaos- commented 1 year ago

Clarification as discussed on discord, this error pops out at runtime using any flow graph using the paint block. Unfortunately I am not aware of how to catch these bugs at compile time.

ZeroChaos- commented 1 year ago

This bug was in 6cf1568eb9e32c25bf6414ad45f75048a5a2b74c and I accidentally built that version again when I intended to test the current HEAD to confirm the bug. This bug is not in current HEAD, I apologize for the noise.