nikhilgupta10 / GridLAB-D

Other
1 stars 0 forks source link

#688 Add check for property size during initialization to prevent memory errors, #2428

Closed nikhilgupta10 closed 8 years ago

nikhilgupta10 commented 8 years ago

This is a follow-up to #653 for trunk. V2.3 has a temporary solution that cannot be migrated back to trunk. The better approach is to run a property_check() routine when during startup or when the properties are registered to make sure that the declared size in GridLAB-D matches the actual size on the host machine. When the declared size exceeds the actual size, the sim should abort with a fatal error. When the declared size is less than the actual a warning error should be output (it's not really bad, but it's not really good either).

Further issues connected with this problem:

  1. r1289 needs to be addressed because in V2.3 enumeration is 32 bits but it was designed to be 64 bits
  2. double_array and complex_array sizes are not declared properly
  3. real and float sizes are wrong on Mac
  4. bool needs to be sizeof(bool) and not sizeof(unsigned int) ,
nikhilgupta10 commented 8 years ago

nikhilgupta10 imported these comments from Sourceforge: "dchassin": * status changed from new to accepted

Started work with r3770.

,

"dchassin":Regarding enumeration, see http://stackoverflow.com/questions/1113855/is-the-sizeofenum-sizeofint-always for some interesting issues.

,

"dchassin":r3772 is a progress update for this issue. The fix approach proposed in #653 was introduced for the assert module and it seems to work fine in trunk.

,

"dchassin":r3878 is a partial update to integrate cumulative changes to trunk.

,

"dchassin": * owner changed from dchassin to andyfisher

Completed trunk update in r3879. 8 errors reported on debug/x64.

E      0.9  e:\gridlabd-688/core/autotest/test_stream_out.glm
E      0.2  e:\gridlabd-688/powerflow/autotest/test_fuse.glm
E      1.7  e:\gridlabd-688/residential/autotest/test_microwave_energy_accumulation.glm
E      1.4  e:\gridlabd-688/taxonomy_feeders/autotest/test_R1-12.47-2.glm
E      1.1  e:\gridlabd-688/taxonomy_feeders/autotest/test_R2-12.47-2.glm
E      2.7  e:\gridlabd-688/taxonomy_feeders/autotest/test_R2-12.47-3.glm
E      3.0  e:\gridlabd-688/taxonomy_feeders/autotest/test_R2-35.00-1.glm
E      1.2  e:\gridlabd-688/taxonomy_feeders/autotest/test_R5-12.47-1.glm

Ready for validation.

,

"dchassin": * priority changed from validate to critical

Updated the ticket with the current version of trunk. 32/64 bit windows and linux builds passed all autotests on my machines. Closing the ticket

,