summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
0a184d4)
A consumer stream's maximal subbuffer size is only initialized while
taking a snapshot. This unexpectedly leaves the max_sb_size at 0
causing the rotation target sequence number computation to crash with
a SIGFPE.
This fix initializes the value as soon as possible to provide a
behaviour in line with that of the ust-consumer.
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
- if (stream->max_sb_size == 0) {
- ret = kernctl_get_max_subbuf_size(stream->wait_fd,
- &stream->max_sb_size);
- if (ret < 0) {
- ERR("Getting kernel max_sb_size");
- goto end_unlock;
- }
- }
-
consumed_pos = consumer_get_consume_start_pos(consumed_pos,
produced_pos, nb_packets_per_stream,
stream->max_sb_size);
consumed_pos = consumer_get_consume_start_pos(consumed_pos,
produced_pos, nb_packets_per_stream,
stream->max_sb_size);
new_stream->chan = channel;
new_stream->wait_fd = fd;
new_stream->chan = channel;
new_stream->wait_fd = fd;
+ ret = kernctl_get_max_subbuf_size(new_stream->wait_fd,
+ &new_stream->max_sb_size);
+ if (ret < 0) {
+ pthread_mutex_unlock(&channel->lock);
+ ERR("Failed to get kernel maximal subbuffer size");
+ goto end_nosignal;
+ }
+
consumer_stream_update_channel_attributes(new_stream,
channel);
switch (channel->output) {
consumer_stream_update_channel_attributes(new_stream,
channel);
switch (channel->output) {