Skip to content

http::Client crashed when add_header() was used #168

@Longxr

Description

@Longxr

调用add_header()后会直接crash,不调用就没问题

复现步骤:
在test/so/http_cli.cc中添加c.add_header("xx", "xxx");
QQ截图20210829111553

崩溃信息:

PS D:\workspace\GithubCode\co> xmake r http_cli -cout
checking for Microsoft Visual Studio (x64) version ... 2017
I0829 09:59:23.895 91636 test\so\http_cli.cc:15] get /
Error: EXCEPTION_ACCESS_VIOLATION
d:\workspace\githubcode\co\src\__\stackwalker.cpp (951): StackWalker::ShowCallstack
d:\workspace\githubcode\co\src\__\stack_trace_win.cc (206): `anonymous namespace'::StackTraceImpl::on_exception
00007FFDF4B990B6 (ntdll): (filename not available): RtlIsGenericTableEmpty
00007FFDF4B8A926 (ntdll): (filename not available): RtlRaiseException
00007FFDF4BC0C6E (ntdll): (filename not available): KiUserExceptionDispatcher
00007FF6E72FD565 (http_cli): (filename not available): Curl_strncasecompare
00007FF6E730891E (http_cli): (filename not available): Curl_checkheaders
00007FF6E7305C0B (http_cli): (filename not available): Curl_http_host
00007FF6E73019DB (http_cli): (filename not available): Curl_http
00007FF6E72E2AED (http_cli): (filename not available): curl_multi_wakeup
00007FF6E72E3AD5 (http_cli): (filename not available): curl_multi_wakeup
00007FF6E72E1AC4 (http_cli): (filename not available): curl_multi_socket_action
d:\workspace\githubcode\co\src\so\http.cc (342): http::Client::do_io
d:\workspace\githubcode\co\src\so\http.cc (252): http::Client::perform
d:\workspace\githubcode\co\test\so\http_cli.cc (17): fa
d:\workspace\githubcode\co\include\co\closure.h (41): co::xx::Function0p<void __cdecl(void)>::run
d:\workspace\githubcode\co\src\co\scheduler.cc (37): co::SchedulerImpl::main_func
00007FF6E72BF8C0 (http_cli): (filename not available): tb_context_make
error: execv(D:\workspace\GithubCode\co\build\windows\x64\release\http_cli.exe -cout) failed(-1073741819)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions