는 코드입니다
* ./HttpProxy '오류 '더블 무료 또는 손상 (fasttop) : 0x00007f6fe000a6b0 *STL의 vector.clear() 원인 메모리를 두 번 무료 또는 여기 손상
그리고 GDB BT :
,5 ~basic_string (this=0x7f6fe0000960, __in_chrg=<optimized out>)
at /usr/include/c++/4.8.3/bits/basic_string.h:539
6 ~pair (this=0x7f6fe0000960, __in_chrg=<optimized out>)
at /usr/include/c++/4.8.3/bits/stl_pair.h:96
7 _Destroy<std::pair<std::basic_string<char>, int> > (__pointer=0x7f6fe0000960)
at /usr/include/c++/4.8.3/bits/stl_construct.h:93
8 __destroy<std::pair<std::basic_string<char>, int>*> (__last=<optimized out>,
__first=0x7f6fe0000960) at /usr/include/c++/4.8.3/bits/stl_construct.h:103
9 _Destroy<std::pair<std::basic_string<char>, int>*> (__last=<optimized out>,
__first=<optimized out>) at /usr/include/c++/4.8.3/bits/stl_construct.h:126
10 _Destroy<std::pair<std::basic_string<char>, int>*, std::pair<std::basic_string<char>, int> > (
__last=0x7f6fe0000970, __first=0x7f6fe0000960)
at /usr/include/c++/4.8.3/bits/stl_construct.h:151
11 _M_erase_at_end (this=<optimized out>, __pos=0x7f6fe0000960)
at /usr/include/c++/4.8.3/bits/stl_vector.h:1352
12 clear (this=0x7f6fe000a0f8) at /usr/include/c++/4.8.3/bits/stl_vector.h:1126
감사의 말을 전합니다.
나의 조언 : make a [mcve]. 이것만으로도 버그를 찾는데 도움이되지 않는다면, 다른 사람들이 여러분을 도울 수있게 도와 줄 것입니다. – user463035818
libcurl을 사용하고 있다면 코드 쓰레드를 안전하게하기 위해 몇 가지 추가 단계를 수행해야합니다. https://curl.haxx.se/libcurl/c/threadsafe.html. 특별히 "TLS"헤더를 확인하고 OpenSSL을 사용하고 있는지 확인하고 필요한 잠금을 구현해야하는지 확인하십시오. 필요한 경우이 정보가 필요한지 다시 질문하십시오. –
@ The Marlboro Man Only 사육사가 사용되었습니다. 이유를 찾아 내고 싶지만 원인이 너무 이상합니다.'service_hosts [service] .clear();'라고 말하면 충돌이 없습니다. – EmilyAvon