Overview
Features
Download
Documentation
Community
Add-Ons & Services

Crash on VS2005

A general discussion forum.

Crash on VS2005

Postby kbw » 23 Nov 2010, 13:56

I've just started looking at Poco and have been seeing a weird crash on Visual Studio 2005. I have a minimal sample that reproduces this crash. The crash always happens on the first line in Process on the third (recursive) call in to Process.

I believe my Runtime Library Settings are correct, I''ve double checked them against the poco Visual Studio project settings, Multi-threaded Debug DLL (/MDd) for debug builds. I've rebuild poco just to be sure the libs are correct.

It does work correctly under Visual Studio 2008. My guess is there's some build/link issue resulting in some incompatibility between the C++ runtime libs--but I'm not sure how to resolve this. I've not seen this sort of problem with VS2005 before.

Can anyone shed any light on what's going on here? Thanks.
Code: Select all
#include <Poco/Path.h>
#include <Poco/DirectoryIterator.h>

void Process(const Poco::Path &path, const std::string &file)
{
   std::string filename = path.toString() + file;   

   for (Poco::DirectoryIterator p(path); p != Poco::DirectoryIterator(); ++p)
   {
      if (p->isDirectory())
      {
         Process(p->path(), file);
      }
   }
}

int main()
{
   Process("C:\\Temp\\", ".MAP");
   return 0;
}
kbw
 
Posts: 4
Joined: 15 Nov 2010, 02:47

Re: Crash on VS2005

Postby kbw » 23 Nov 2010, 18:31

It also crashes under VS2003. Here's the call stack.
Code: Select all
    kernel32.dll!7c812afb()    
    kernel32.dll!7c812afb()    
    msvcr71d.dll!_nh_malloc_dbg(unsigned int nSize=1, int nhFlag=3, int nBlockUse=1241596, const char * szFileName=0x00000000, int nLine=0)  Line 267 + 0x7   C
    msvcr71d.dll!_CxxThrowException(void * pExceptionObject=0x0012f218, const _s__ThrowInfo * pThrowInfo=0x005b6150)  + 0x39   C++
    msvcp71d.dll!std::_Nomemory()  Line 10   C++
    msvcp71d.dll!operator new(unsigned int size=3435973837)  Line 15   C++
    msvcp71d.dll!std::_Allocate<char>(unsigned int _Count=3435973837, char * __formal=0x00000000)  Line 34 + 0x9   C++
    msvcp71d.dll!std::allocator<char>::allocate(unsigned int _Count=3435973837)  Line 143 + 0xb   C++
    msvcp71d.dll!std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Copy(unsigned int _Newsize=3435973836, unsigned int _Oldlen=0)  Line 1458 + 0xf   C++
    msvcp71d.dll!std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Grow(unsigned int _Newsize=3435973836, bool _Trim=false)  Line 1485   C++
    msvcp71d.dll!std::basic_string<char,std::char_traits<char>,std::allocator<char> >::assign(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & _Right={...}, unsigned int _Roff=0, unsigned int _Count=4294967295)  Line 599 + 0x10   C++
    msvcp71d.dll!std::basic_string<char,std::char_traits<char>,std::allocator<char> >::basic_string<char,std::char_traits<char>,std::allocator<char> >(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & _Right={...})  Line 326   C++
    pftest1.exe!std::operator+<char,std::char_traits<char>,std::allocator<char> >(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & _Left={...}, const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & _Right={...})  Line 22 + 0x12   C++
>   pftest1.exe!Process(const Poco::Path & path={...}, const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & file={...})  Line 6 + 0x46   C++
    pftest1.exe!main()  Line 19 + 0x52   C++
    pftest1.exe!mainCRTStartup()  Line 398 + 0x11   C
    kernel32.dll!7c817077()    
kbw
 
Posts: 4
Joined: 15 Nov 2010, 02:47

Re: Crash on VS2005

Postby guenter » 23 Nov 2010, 18:35

Just to rule out the obvious issue: you for sure have compiled POCO with the same Visual Studio version as your application? Linking POCO DLLs built with VS2008 to an application linked with VS2005 or VS2003 won't result in anything useful...
guenter
 
Posts: 1107
Joined: 11 Jul 2006, 16:27
Location: Austria

Re: Crash on VS2005

Postby kbw » 23 Nov 2010, 18:40

It's all my fault!

I had previously installed the Commercial vs2008 version and it was in the path. I've fixed that and the VS2003 build is happy now. I expect the VS2005 build will be too. I'll post my confirmation once I've tested it.

Thanks.
kbw
 
Posts: 4
Joined: 15 Nov 2010, 02:47


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest