visy / oscpack

Automatically exported from code.google.com/p/oscpack
Other
0 stars 0 forks source link

Throw osc::OutOfBufferMemoryException in release mode (Win32 VS2010 CL) #16

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Platform :

Windows 7 / CMAKE GUI 2.8.12.2 generated VS2010 express 32bit project.

When the project is set to Release/MinSizeRel/RelWithDebInf

Whenever any message is added after osc::BeginMessage("..."), the error will 
throw.
eg:
osc::OutboundPacketStream p( buffer, OUTPUT_BUFFER_SIZE );
p << osc::BeginMessage( "/test" ) << osc::EndMessage;  // OK
p << osc::BeginMessage( "/test" ) << osc::Nil << osc::EndMessage;  // throw 
error.

Also warning C4702: unreachable code during compilation, in 
OutboundPacketStream << operator overload.
Seems any code after "CheckForAvailableArgumentSpace(X);" won't run.

The warning can be surpressed by turning off the optimization, but the error 
will still throw.

Could I know the direction how to debug it (I'm not an expert in C++, so need 
some advices).

Thanks.

Original issue reported on code.google.com by victor...@gmail.com on 13 May 2014 at 5:03

GoogleCodeExporter commented 8 years ago
Found the error.

OscOutBoundPacketStream.cpp

Line 262
Insert: if( required > Capacity() )

Needed for windows platform

Original comment by victor...@gmail.com on 13 May 2014 at 5:30