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

[Bug]: xqc_h3_request_send_body导致的内存不断增长问题 #245

Open
adcen0107 opened this issue Sep 24, 2022 · 0 comments
Open

[Bug]: xqc_h3_request_send_body导致的内存不断增长问题 #245

adcen0107 opened this issue Sep 24, 2022 · 0 comments
Assignees

Comments

@adcen0107
Copy link

What happened?

1、xqc_h3_request_send_body 发送http数据,最终进入如下函数:

xqc_h3_stream_write_data_to_buffer(xqc_h3_stream_t *h3s, unsigned char *data, uint64_t data_size,

/* write DATA frame */
ret = xqc_h3_frm_write_data(&h3s->send_buf, data + write, size, flag);
if (ret != XQC_OK) {
xqc_log(h3s->log, XQC_LOG_ERROR, "|write DATA frame error|%d|stream_id:%ui|fin:%d|",
ret, h3s->stream_id, (unsigned int)fin);
return ret;
}
write += size;
xqc_log_event(h3s->log, HTTP_FRAME_CREATED, h3s, XQC_H3_FRM_DATA, size);

    /* send DATA frame */
    ret = xqc_h3_stream_send_buffer(h3s);

2、xqc_h3_frm_write_data 将data不断拷到内存并添加到send-buf链表;
3、xqc_h3_stream_send_buffer 不断消耗h3s->send_buf链表的buf,若quic层传输速率过小,远小于应用层写入数据速率,且应用层不断写入数据,最终会导致数据在h3s->send_buf不断堆积,内存消耗越来越大,程序出错。

Steps To Reproduce

1、限制发送端到接收端的链路带宽为1Mbps;
2、发送端同一个流不断调用 xqc_h3_request_send_body 发数据;
3、可以观察到h3s->send_buf链表不断增长,内存不断增大,最终程序被系统kill掉。

Relevant log output

No response

@Kulsk Kulsk self-assigned this Jul 12, 2023
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