Closed joergi-w closed 2 years ago
Yeah, this took me quite a while to figure out. The problem is that by default, std::cout
does not do any buffering. This is horrible for performance and something you never want unless you are mixing calls to std::cout
and printf()
(which you also shouldn't be doing!).
The correct workaround is to call this somewhere at the beginning of your program
std::ios::sync_with_stdio(false);
This will make std::cout
do regular buffering, which improves performance and will silence the assertion.
I will think about adding a buffering step when I see this situation.
I have now also added better handling of the situation to the library, so you will no longer get the assertion.
The problem is that
record.ref()
only accepts a single nucleotide, although its type isdna5_vector
. If I set multiple nucleotides, the program dies with a segmentation fault (release build) or Assertion failed: (buffer_space > 0) in function write_range (debug build).This is my minimal code example:
My current work-around is changing the type of
ref()
tostd::vector<char>
, which works as expected.