zhaopuming / quickfast

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

If DecoderConfiguration::setMessageType is not called - application cores (quickfast 1.3) #77

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
If messageHeaderType_ has not been set in client code, messageHeaderType_ is 
initialised to an invalid value and which causes the messageHeaderAnalyzer_ 
smart pointer to be null.

DecodeConnection::configure subsequently tries to dereference the 
messageHeaderAnalyzer_ pointer resulting in a core.

The previous version of quickfast (1.2) I tested did not require exhibit this 
behaviour. 

This easiest fix would be to initialise messageHeaderType_  in the 
DecoderConnection header.

Code below should produce a core

//==
QuickFAST::Application::DecoderConfiguration configuration;
QuickFAST::Application::DecoderConnection connection;

configuration.setTemplateFileName(s_baseDir + "/xml/my_template_def.xml");

configuration.setReceiverType(Application::DecoderConfiguration::RAWFILE_RECEIVE
R);
// will core without line below
//configuration.setMessageHeaderType(QuickFAST::Application::DecoderConfiguratio
n::NO_HEADER);

configuration.setFastFileName(/tmp/data/mydata.bin");
connection.configure(refData, configuration); // app cores
//==

Running on linux

Of slightly less importance the switch(configuration.messageHeaderType()) block 
has been pasted into DecodeConnection::configure twice.

Original issue reported on code.google.com by ian691@googlemail.com on 14 Feb 2011 at 10:05

GoogleCodeExporter commented 9 years ago
Thanks for reporting this.  It's fixed by revision 480 in the repository.

Original comment by dale.wil...@gmail.com on 14 Feb 2011 at 9:42