调试curl未处理的异常

时间:2019-04-03 19:15:42

标签: c++ curl

对于我来说,这是一个很难调试的难题,因为它并非总是会发生,而是否发生似乎是偶然的问题。我正在做的是让用户设置几次。一个“到期日”时间和几个“警告”时间。这些时间过去后,他们会在提供的电话号码上收到文字。通常这是可行的,但是在极少数情况下,我会从curl提供的easy.c中得到未处理的异常。

#undef curl_easy_getinfo
CURLcode curl_easy_getinfo(struct Curl_easy *data, CURLINFO info, ...)
{
  va_list arg;
  void *paramp;
  CURLcode result;

  va_start(arg, info);
  paramp = va_arg(arg, void *);

  result = Curl_getinfo(data, info, paramp);

  va_end(arg);
  return result;
}

这发生在“结果= Curl_getinfo(data,info,paramp);”行上

引发未处理的异常:读取访问冲突。 数据为0x7E8DD8。发生

我不确定为什么会发生此错误,并且很难对其进行测试,因为即使在相同的情况下,这种错误也是如此罕见且不一致。

我确实保存了调用堆栈(如果有帮助的话),但我想知道是否有人对导致这种情况的原因有一个大致的了解,或者是否有任何技巧可以在这种不一致的情况下进行调试。

     Schedule490.exe!getinfo_long(Curl_easy * data, CURLINFO info, long * param_longp) Line 152    C
     Schedule490.exe!Curl_getinfo(Curl_easy * data, CURLINFO info, ...) Line 461    C
>    Schedule490.exe!curl_easy_getinfo(Curl_easy * data, CURLINFO info, ...) Line 844    C
     Schedule490.exe!twilio::Twilio::send_message(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &,bool)    C++
     Schedule490.exe!Schedule::dateWarnAlert(struct tm,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)    C++
     Schedule490.exe!Schedule::nextUpdate(void)    C++
     Schedule490.exe!std::_Invoker_pmf_refwrap::_Call<void ( Schedule::*)(void),class std::reference_wrapper<class Schedule> >(void ( Schedule::*)(void),class std::reference_wrapper<class Schedule> &&)    C++
     Schedule490.exe!std::invoke<void ( Schedule::*)(void),class std::reference_wrapper<class Schedule> >(void ( Schedule::*&&)(void),class std::reference_wrapper<class Schedule> &&)    C++
     Schedule490.exe!std::_LaunchPad<class std::unique_ptr<class std::tuple<void ( Schedule::*)(void),class std::reference_wrapper<class Schedule> >,struct std::default_delete<class std::tuple<void ( Schedule::*)(void),class std::reference_wrapper<class Schedule> > > > >::_Execute<0,1>(class std::tuple<void ( Schedule::*)(void),class std::reference_wrapper<class Schedule> > &,struct std::integer_sequence<unsigned int,0,1>)    C++
     Schedule490.exe!std::_LaunchPad<class std::unique_ptr<class std::tuple<void ( Schedule::*)(void),class std::reference_wrapper<class Schedule> >,struct std::default_delete<class std::tuple<void ( Schedule::*)(void),class std::reference_wrapper<class Schedule> > > > >::_Run(class std::_LaunchPad<class std::unique_ptr<class std::tuple<void ( Schedule::*)(void),class std::reference_wrapper<class Schedule> >,struct std::default_delete<class std::tuple<void ( Schedule::*)(void),class std::reference_wrapper<class Schedule> > > > > *)    C++
     Schedule490.exe!std::_LaunchPad<class std::unique_ptr<class std::tuple<void ( Schedule::*)(void),class std::reference_wrapper<class Schedule> >,struct std::default_delete<class std::tuple<void ( Schedule::*)(void),class std::reference_wrapper<class Schedule> > > > >::_Go(void)    C++
     Schedule490.exe!std::_Pad::_Call_func(void *)    C++
     Schedule490.exe!invoke_thread_procedure(unsigned int(__stdcall*)(void *) procedure, void * const context) Line 92    C++
     Schedule490.exe!thread_start<unsigned int (__stdcall*)(void *)>(void * const parameter) Line 115    C++
     kernel32.dll!@BaseThreadInitThunk@12()    Unknown
     ntdll.dll!__RtlUserThreadStart()    Unknown
     ntdll.dll!__RtlUserThreadStart@8()    Unknown

0 个答案:

没有答案