Hi Nigel,

Thanks for the bug.  Good catch.

sizeof(md.m_baseType)

should be like the line above:

OU::baseTypeSizes[md.m_baseType]/8

This will be in the next patch set.

Jim



On Jun 4, 2012, at 2:51 AM, Merritt, Nigel (Contractor) wrote:


UNCLASSIFIED

I'm getting an exception raised in OcpiRccWorker.cxx, in "prepareProperty" 
function - it's throwing the OU::PROPERTY_SET_EXCEPTION.

In the preceeding line ("if ( (md.m_offset+sizeof(md.m_baseType)) > 
m_dispatch->propertySize ) {"), m_offset is 61 and the "propertySize" is 64.  
Since m_baseType is a typedef from BaseType which is an enumeration and 
therefore 4 bytes, the error is triggered.

This has only appeared since adding a Bool property in the worker 
specification.  It works fine with the equivalent HDL by the way.

Looking at the generated worker .h file, the properties are:

typedef struct {
  uint8_t       data_opcode;
  uint8_t       rslt_opcode;
  uint8_t       startup_dly;
  char pad0_[1];
  uint32_t      ddc_init;
  uint32_t      duc_init;
  uint32_t      noise_init;
  uint16_t      motion_prd;
  char pad1_[2];
  uint32_t      update_prd;
  uint16_t      update_prd_inc;
  RCCBoolean    freq_ctrl;
  char pad2_[1];
  int16_t       freq_start;
  int16_t       freq_inc;
  RCCBoolean    delay_ctrl;
  char pad3_[1];
  uint16_t      delay_start;
  int16_t       delay_inc;
  RCCBoolean    gain_ctrl;
  char pad4_[1];
  uint16_t      gain_start;
  int16_t       gain_inc;
  RCCBoolean    first;
  char pad5_[3];
  uint32_t      target;
  uint16_t      noise_amp;
  uint8_t       repeat;
  char pad6_[1];
  uint32_t      busy;
  uint8_t       ocpistate;
  RCCBoolean    wrkReset;
} Gewc_targetgen_t0Properties;

Which totals 62 bytes (presumably propertySize is expanded to fit a 32-bit 
boundary).  Should the line from prepareProperty be checking for the size of 
the property itself, not the enumeration?

Cheers,
  Nigel

IMPORTANT: This email remains the property of the Department of Defence and is 
subject to the jurisdiction of section 70 of the Crimes Act 1914. If you have 
received this email in error, you are requested to contact the sender and 
delete the email.

_______________________________________________
opencpi_dev mailing list
[email protected]<mailto:[email protected]>
http://lists.opencpi.org/listinfo.cgi/opencpi_dev-opencpi.org

_______________________________________________
opencpi_dev mailing list
[email protected]
http://lists.opencpi.org/listinfo.cgi/opencpi_dev-opencpi.org

Reply via email to