Changes between Initial Version and Version 3 of Ticket #3074
- Timestamp:
- 2015-01-13T23:15:00Z (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #3074
- Property Component Unknown → Backend
- Property Milestone Future → 1.9.2
- Property Priority high → critical
- Property Cc added
- Property Summary Multiple problems with assert statements → Insufficient information about assertion violations
-
Ticket #3074 – Description
initial v3 1 Please consider the attached test package, which demonstrates a number of problems regarding the handling of asserts in OMC.1 Apologies, the first issue of this ticket was wrong due to a typo in the code. I have modified it to reflect the actual status with the corrected code. 2 2 3 If you simulate TestErrorVariable2, you get the following error message: 4 Variable x is too big 3 Please consider the attached test package, which demonstrates how OMC does not provide essential information to the user when handling asserts. 5 4 6 Unfortunately, the message doesn't tell you an essential piece of information, i.e., ''where'' in the model has this error been triggered. Is it m1, m2 or m3? 5 Simulate TestWarningConstant. You get the following warning message: 6 Warning: Variable x is probably too big 7 Unfortunately, the message doesn't tell you an essential piece of information, i.e., ''where'' in the model M has this error been triggered. Is it m1, m2 or m3? It also doesn't tell ''when'' the warning has been triggered 7 8 8 9 One option is to enhance the error message like this: 9 The following assertion has been violated: m2.x < 10 10 Error message: Variable x is too big 10 The following assertion has been violated at initialization: 11 m3.x < 5 12 Warning: Variable x is probably too big 11 13 12 Incidentally, I think the "Process crashed" final message is inappropriate. It seem to hint to the fact that some uncontrolled error has taken place, such as a memory access violation in some external function, which is definitely not the case here. I would suggest to use "Process aborted", which seems more appropriate. 14 Simulate TestWarningVariable. You get the same message as before 15 Warning: Variable x is probably too big 16 you should get something like: 17 The following assertion has been violated at time = 0.8333 18 m3.x < 5 19 Warning: Variable x is probably too big 13 20 21 Simulate TestWarningRecurring. You still get 22 Warning: Variable x is probably too big 23 According to the non-normative text of the Modelica Specification, Section 8.3.7, you should get something like 24 The following assertion has been violated at time = 0.1577 25 m3.x < 5 26 Warning: Variable x is probably too big 14 27 15 TestWarningConstant is terminated by an assertion violation at initialization. However, this assertion has AssertionLevel.warning, so according to the Modelica Spec. 8.3.7, a warning should be issued, then the simulation should continue. 28 The following assertion is no longer violated at time = 0.3465 29 m3.x < 5 30 Warning: Variable x is probably too big 16 31 17 TestWarningVariable is terminated when the warning assert is violated. According to the spec, a warning message should be issued once, then the simulation should continue. 32 Simulate TestErrorConstant. Here you should see: 33 The following assertion has been violated at initialization: 34 m2.x < 10 35 Error: Variable x is too big 18 36 19 TestErrorConstant is handled correctly, besides the above-mentioned lack of information, which is common to all cases. 37 Simulate TestErrorVariable. The information here is quite confusing. What you should get here is 38 The following assertion has been violated at time = 0.25 39 m2.x < 5 40 Warning: Variable x is probably too big 20 41 21 TestErrorVariable is terminated when the warning assert is violated. According to the spec, a warning message should be issued once, then the simulation should continue until the error assert is violated, then aborted. 42 The following assertion has been violated at time = 0.5 43 m2.x < 10 44 Error: Variable x is too big 22 45 23 Last, but not least, I would suggest to add these test cases to the Modelica Language Compliance Test library, as other tools seem to have the same kind of problems.46 Incidentally, I think the "Process crashed" final message in the last case is inappropriate. It seem to hint to the fact that some uncontrolled error has taken place, such as a memory access violation in some external function, which is definitely not the case here. Evertything here is under control and we have reported the reason for the simulation to stop. I would suggest to use "Process aborted", which seems more appropriate.