>From the stack trace it looks like s is not a valid pointer.  I don't know
why that would be, though.  If you could send me a small but complete demo
program (including VS project files) I could try to debug it.

On Mon, Feb 23, 2009 at 11:08 AM, Tracey Wiedmeyer <
tracey.wiedme...@gmail.com> wrote:

> Here's the trace - It seems to be coming from this line consistently
> in stl_util-inl.h.
>
> inline void STLStringResizeUninitialized(string* s, size_t new_size) {
>  s->resize(new_size); // <<<<<
> }
>
>        Runner.exe!_CxxThrowException(void * pExceptionObject=0x0012ef48,
> const _s__ThrowInfo * pThrowInfo=0x01219618)  Line 161  C++
>        Runner.exe!std::_String_base::_Xran()  Line 18 + 0x2e bytes     C++
>
>  Runner.exe!std::basic_string<char,std::char_traits<char>,std::allocator<char>
> >::erase(unsigned int _Off=12, unsigned int _Count=4294967295)  Line
> 1265    C++
>
>  Runner.exe!std::basic_string<char,std::char_traits<char>,std::allocator<char>
> >::resize(unsigned int _Newsize=12, char _Ch=0)  Line 1684      C++
>
>  Runner.exe!std::basic_string<char,std::char_traits<char>,std::allocator<char>
> >::resize(unsigned int _Newsize=12)  Line 1678  C++
>        Runner.exe!google::protobuf::STLStringResizeUninitialized()  + 0x2a
> bytes
>        Runner.exe!google::protobuf::io::CodedInputStream::ReadString()  +
> 0x5f bytes
>        Runner.exe!google::protobuf::internal::WireFormat::ReadString()  +
> 0x67 bytes
>
>  
> Runner.exe!google::protobuf::FileDescriptorProto::MergePartialFromCodedStream()
>  + 0xa0 bytes
>        Runner.exe!google::protobuf::Message::MergeFromCodedStream()  + 0x55
> bytes
>        Runner.exe!google::protobuf::Message::ParseFromCodedStream()  + 0x45
> bytes
>
>  Runner.exe!google::protobuf::Message::ParseFromBoundedZeroCopyStream()
>  + 0x6d bytes
>        Runner.exe!google::protobuf::Message::ParseFromArray()  + 0x6b bytes
>
>  Runner.exe!google::protobuf::DescriptorPool::InternalBuildGeneratedFile()
>  + 0x1aa bytes
>        Runner.exe!protobuf_BuildDesc_sample_2eproto()  Line 72 C++
>
>  
> Runner.exe!StaticDescriptorInitializer_sample_2eproto::StaticDescriptorInitializer_sample_2eproto()
>  Line 78        C++
>        Runner.exe!`dynamic initializer for
> 'static_descriptor_initializer_sample_2eproto_''()  Line 79 + 0x13
> bytes   C++
>        Runner.exe!_initterm(void (void)* * pfbegin=0x01068c7c, void (void)*
> * pfend=0x01068f6c)  Line 903   C
>        Runner.exe!_cinit(int initFloatingPrecision=1)  Line 307 + 0xf bytes
>    C
>        Runner.exe!__tmainCRTStartup()  Line 249 + 0x7 bytes    C
>        Runner.exe!WinMainCRTStartup()  Line 182        C
>        kernel32.dll!760c4911()
>        ntdll.dll!7771e4b6()
>        ntdll.dll!7771e489()
>
> My .proto file looks like this - a real simple example
> //***********************************************
> package mypack;
>
> message Guy {
>  required string name = 1;
> }
>
> message People {
>  repeated Guy guy = 1;
> }
> //***********************************************
>
> Vista Ultimate / Visual Studio 08 Pro / Static linkage all around (/MTd)
>
> Thanks.
>
> On Mon, Feb 23, 2009 at 11:45 AM, Kenton Varda <ken...@google.com> wrote:
> > Not ringing any bells so far.  Can you provide a stack trace for the
> crash?
> >
> > On Sat, Feb 21, 2009 at 2:56 PM, <tracey.wiedme...@gmail.com> wrote:
> >>
> >> When debugging through the CRT the error starts during the static
> >> initializer functions
> >>
> >> StaticDescriptorInitializer_...
> >>
> >> Looks like some access faults but I can't tell what causes this.  I am
> >> compiling and linking fine so I can only assume something else with
> >> the build process went wrong?  A flag or directive missing?
> >>
> >> On Feb 21, 11:32 am, tracey.wiedme...@gmail.com wrote:
> >> > I've got a C++ program (.exe) that is compiled in Debug mode using /
> >> > MTd (multi-threaded debug).  It compiles fine, and has been a working
> >> > program for some time (debug and release).  I'm using Visual Studio
> >> > 2008 Pro on Vista Ultimate.
> >> >
> >> > I want to integrate protocol buffers into it, so I pulled down the
> >> > latest 2.0.3, and compiled libprotobuf in debug mode using /MTd.  It
> >> > compiles fine, I choose "Link Library Dependencies=No" for the project
> >> > properties.
> >> >
> >> > Then I created a small sample proto file and generated the c++ source,
> >> > still good up to this point.  I added my sample.pb.h and sample.pb.cc
> >> > into my project and added the libprotobuf header files to my
> >> > additional include path and libprotobuf.lib to the additional library
> >> > setting.
> >> >
> >> > Everything compiles fine, and links fine, so I actually get an debug
> >> > executable.  However when I run the program I get an immediate fault,
> >> > which breaks to _crtdebugbreak();
> >> >
> >> > If I compile both in release mode it seems to work fine, executable
> >> > runs without issue.
> >> >
> >> > I've gone through great lengths to make sure the compile and linkage
> >> > settings for my program and the protobuf library are the same. It
> >> > seems like I've made it through the hard part of compiling and linking
> >> > so I'm hoping the collective brain can help me out of this.  Any ideas
> >> > on what to try from here, short of trying thrift, which I won't be
> >> > able to compile the compiler in visual studio anyway :)
> >> >
> >> > Thanks.
> >> > >>
> >
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to protobuf@googlegroups.com
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to