[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[Libevent-users] a crash when running my own http client



I've try to write a http client for downloading files from the internet, and get stuck with a strange crash for me.
My client make all requests for a bunch of given files (use the range header, multiple requests for a file), and execute event_base_dispatch, then in the callback_handler, free the request.
But when downloads , it may crash, with probability about 25%. I don't know what is wrong.

I use VS2012 compile the libevent and pass all tests, and then add them to my project. 
And when crash happens, it says that access violation at a given address, the stack info as following:
  ntdll.dll!77a415de()
  ntdll.dll!77a415de()
  ntdll.dll!77a3014e()
> DowloaderNew.exe!_bufferevent_disable () C
  DowloaderNew.exe!__bufferevent_run_readcb () C
  DowloaderNew.exe!_bufferevent_new () C
  DowloaderNew.exe!_event_base_stop_iocp () C
  DowloaderNew.exe!__event_debug_map_HT_REP_IS_BAD () C
  DowloaderNew.exe!_event_base_stop_iocp () C
  DowloaderNew.exe!_event_base_loop () C
  DowloaderNew.exe!_event_base_dispatch () C
  DowloaderNew.exe!Run() 行 76 C++
  DowloaderNew.exe!main() 行 96 C++
  DowloaderNew.exe!__tmainCRTStartup() 行 536 C
  DowloaderNew.exe!mainCRTStartup() 行 377 C
  kernel32.dll!76c233aa() 未知
  ntdll.dll!77a59ef2() 未知
  ntdll.dll!77a59ec5() 未知

I turn for help of search engine, but there seems no relevant info, either does stackoverflow.