The following issue has been SUBMITTED. ====================================================================== http://www.cmake.org/Bug/view.php?id=15589 ====================================================================== Reported By: Martyn Gigg Assigned To: ====================================================================== Project: CMake Issue ID: 15589 Category: CMake Reproducibility: always Severity: crash Priority: normal Status: new ====================================================================== Date Submitted: 2015-05-27 16:26 EDT Last Modified: 2015-05-27 16:26 EDT ====================================================================== Summary: Crash when fetching larger data file with External Data on Windows Description: We have been using the external data mechanism with great success for several months.
Recently, an 800Mb file was added to our test data and on Windows cmake crashes with a std::bad_alloc during a curl callback. The download works fine on Linux and Mac OS X. The full stack trace from Visual Studio is: > msvcr110d.dll!_CxxThrowException(void * pExceptionObject, const > _s__ThrowInfo * pThrowInfo) Line 152 C++ msvcr110d.dll!operator new(unsigned int size) Line 63 C++ cmake.exe!std::_Allocate<char>(unsigned int _Count, char * __formal) Line 28 C++ cmake.exe!std::allocator<char>::allocate(unsigned int _Count) Line 591 C++ cmake.exe!std::_Wrap_alloc<std::allocator<char> >::allocate(unsigned int _Count) Line 877 C++ cmake.exe!std::vector<char,std::allocator<char> >::_Insert<char *>(std::_Vector_const_iterator<std::_Vector_val<std::_Simple_types<char> > > _Where, char * _First, char * _Last, std::forward_iterator_tag __formal) Line 1316 C++ cmake.exe!std::vector<char,std::allocator<char> >::insert<char *>(std::_Vector_const_iterator<std::_Vector_val<std::_Simple_types<char> > > _Where, char * _First, char * _Last) Line 1262 C++ cmake.exe!`anonymous namespace'::cmFileCommandCurlDebugCallback(void * __formal, curl_infotype __formal, char * chPtr, unsigned int size, void * data) Line 2519 C++ cmake.exe!showit(SessionHandle * data, curl_infotype type, char * ptr, unsigned int size) Line 608 C cmake.exe!Curl_debug(SessionHandle * data, curl_infotype type, char * ptr, unsigned int size, connectdata * conn) Line 661 C cmake.exe!Curl_readwrite(connectdata * conn, unsigned char * done) Line 1208 C cmake.exe!Transfer(connectdata * conn) Line 1819 C cmake.exe!Curl_perform(SessionHandle * data) Line 2378 C cmake.exe!curl_easy_perform(void * curl) Line 480 C cmake.exe!cmFileCommand::HandleDownloadCommand(const std::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > > & args) Line 2946 C++ cmake.exe!cmFileCommand::InitialPass(const std::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > > & args, cmExecutionStatus & __formal) Line 83 C++ cmake.exe!cmCommand::InvokeInitialPass(const std::vector<cmListFileArgument,std::allocator<cmListFileArgument> > & args, cmExecutionStatus & status) Line 68 C++ cmake.exe!cmMakefile::ExecuteCommand(const cmListFileFunction & lff, cmExecutionStatus & status) Line 418 C++ cmake.exe!cmWhileFunctionBlocker::IsFunctionBlocked(const cmListFileFunction & lff, cmMakefile & mf, cmExecutionStatus & inStatus) Line 73 C++ cmake.exe!cmMakefile::IsFunctionBlocked(const cmListFileFunction & lff, cmExecutionStatus & status) Line 2833 C++ cmake.exe!cmMakefile::ExecuteCommand(const cmListFileFunction & lff, cmExecutionStatus & status) Line 386 C++ cmake.exe!cmFunctionHelperCommand::InvokeInitialPass(const std::vector<cmListFileArgument,std::allocator<cmListFileArgument> > & args, cmExecutionStatus & inStatus) Line 179 C++ cmake.exe!cmMakefile::ExecuteCommand(const cmListFileFunction & lff, cmExecutionStatus & status) Line 418 C++ cmake.exe!cmForEachFunctionBlocker::IsFunctionBlocked(const cmListFileFunction & lff, cmMakefile & mf, cmExecutionStatus & inStatus) Line 57 C++ cmake.exe!cmMakefile::IsFunctionBlocked(const cmListFileFunction & lff, cmExecutionStatus & status) Line 2833 C++ cmake.exe!cmMakefile::ExecuteCommand(const cmListFileFunction & lff, cmExecutionStatus & status) Line 386 C++ cmake.exe!cmFunctionHelperCommand::InvokeInitialPass(const std::vector<cmListFileArgument,std::allocator<cmListFileArgument> > & args, cmExecutionStatus & inStatus) Line 179 C++ cmake.exe!cmMakefile::ExecuteCommand(const cmListFileFunction & lff, cmExecutionStatus & status) Line 418 C++ cmake.exe!cmIfFunctionBlocker::IsFunctionBlocked(const cmListFileFunction & lff, cmMakefile & mf, cmExecutionStatus & inStatus) Line 140 C++ cmake.exe!cmMakefile::IsFunctionBlocked(const cmListFileFunction & lff, cmExecutionStatus & status) Line 2833 C++ cmake.exe!cmMakefile::ExecuteCommand(const cmListFileFunction & lff, cmExecutionStatus & status) Line 386 C++ cmake.exe!cmMakefile::ReadListFile(const char * filename_in, const char * external_in, std::basic_string<char,std::char_traits<char>,std::allocator<char> > * fullPath, bool noPolicyScope) Line 699 C++ cmake.exe!cmake::ReadListFile(const std::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > > & args, const char * path) Line 551 C++ cmake.exe!cmake::SetCacheArgs(const std::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > > & args) Line 501 C++ cmake.exe!cmake::Run(const std::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > > & args, bool noconfigure) Line 2516 C++ cmake.exe!do_cmake(int ac, char * * av) Line 532 C++ cmake.exe!main(int ac, char * * av) Line 343 C++ cmake.exe!__tmainCRTStartup() Line 536 C cmake.exe!mainCRTStartup() Line 377 C kernel32.dll!74ed336a() Unknown ntdll.dll!772292b2() Unknown ntdll.dll!77229285() Unknown The insert line in cmFileCommand.cxx::cmFileCommandCurlDebugCallback causes a memory allocation error. Steps to Reproduce: I have placed an isolated test project at https://github.com/martyngigg/external-data-win32-crash that reproduces the error using one of our large files. Running cmake on the project and then building with msbuild ExternalDataTest.sln will reproduce the issue. ====================================================================== Issue History Date Modified Username Field Change ====================================================================== 2015-05-27 16:26 Martyn Gigg New Issue ====================================================================== -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake-developers