Skip to content
Snippets Groups Projects
Commit f1fcede8 authored by Konstantin Osipov's avatar Konstantin Osipov
Browse files

iproto: fix a crashing bug on ec2.large instance

When entire contents of the output buffer is flushed, we must reset
write start and end positions. If the buffer can be recyced, they
both are reset to point to the beginning of the buffer, otherwise write start
is advanced to match write end.

The old code would always execute *begin = *end assignment, regardless
of whether it's case 1) (full reset) or 2) (advancing write start).

gcc 4.8 could reorder this assignment, and put it in front of conditional
iobuf_reset(). In that case, write start could point beyond write end,
since iobuf_reset() resets write end to zero.

A funny bug which would hit only under heavy load, only if there are
-O2 optimizations, and no debug prints.
parent dea02c8b
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment