FMUComplianceChecker icon indicating copy to clipboard operation
FMUComplianceChecker copied to clipboard

Improve allocation diagnosis

Open tbeu opened this issue 7 years ago • 2 comments

With FMUComplianceChecker v2.0.4 I can see an error message if freeMemory was called less often than allocateMemory, e.g.,

[ERROR][FMUCHK] Memory leak: freeMemory was not called for 1 block(s) allocated by allocateMemory
FMU check summary:
FMU reported:
	0 warning(s) and error(s)
Checker reported:
	0 Warning(s)
	1 Error(s) 

It would be more convenient if the FMUComplianceChecker directly prints the leaked pointer(s), at least if the log level is verbose or debug. This way, I could run the FMUComplianceChecker with log level verbose or debug and can directly see the leaked pointer(s), which simplifies the actual debugging of the leaks.

Technically, you can use troydhanson/uthash to build lists or hash maps in C in order to keep track of the allocated pointers.

tbeu avatar Nov 17 '17 11:11 tbeu