ETSI's Bug Tracker - Part 01: TTCN-3 Core Language
View Issue Details

ID | Project | Category | View Status | Date Submitted | Last Update
0006710 | Part 01: TTCN-3 Core Language | Technical | public | 03-04-2014 13:33 | 05-01-2015 17:51

Reporter | Tomas Urban |
Assigned To | Gyorgy Rethy |
Priority | normal | Severity | minor | Reproducibility | N/A
Status | closed | Resolution | fixed |
Platform |  | OS |  | OS Version |
Product Version | v4.5.1 (published 2013-04) |
Target Version | v4.7.1 (published 2015-06) | Fixed in Version | v4.7.1 (published 2015-06) |
Clause Reference(s) | 20.5.2
Source (company - Author) | Elvior

Summary | 0006710: Activate using timers declared in control block

Description

The TTCN-3:2014 specification allows to use timers declared in the control block as parameters of altstep used in the activate operation (restriction 20.5.2.b). However, it is not clear if the rule allows to use timers from a child blocks of the control block or not. I think that the timers from the child block shall not be allowed, because the default might be processed after exiting the child block, i.e. when the timer has been already destroyed as in the following example:
altstep(timer t) {
[] t. timeout { stop; }
}
control {
var boolean v_bCondition := false;
timer t_global := 10.0;
t_global.start;
if (v_bCondition) {
timer t_local := 1.0;
t_local.start;
activate(a(t_local)); // activation using local timer
...
}
// local timer t_local no longer exists, but the default will be activated
// in the following alt:
t_global.timeout;
}
Proposal:
The restriction 20.5.2.b shall mention that the rule doesn't include timers declared in child statement blocks of the module control part.

Steps To Reproduce |
Additional Information |
Tags | No tags attached.
Relationships |
Attached Files | CR6710_update_proposal.docx (16,751) 10-04-2014 14:46 http://oldforge.etsi.org/mantis/file_download.php?file_id=3005&type=bug CR6710_v2.docx (17,077) 18-06-2014 08:11 http://oldforge.etsi.org/mantis/file_download.php?file_id=3042&type=bug

Issue History
Date Modified | Username | Field | Change
03-04-2014 13:33 | Tomas Urban | New Issue |
08-04-2014 10:49 | Gyorgy Rethy | Assigned To | => Axel Rennoch
08-04-2014 10:49 | Gyorgy Rethy | Status | new => assigned
08-04-2014 10:49 | Gyorgy Rethy | Target Version | => v4.7.1 (published 2015-06)
10-04-2014 14:46 | Axel Rennoch | File Added: CR6710_update_proposal.docx |
10-04-2014 14:46 | Axel Rennoch | Assigned To | Axel Rennoch => Gyorgy Rethy
10-04-2014 14:46 | Axel Rennoch | Note Added: 0012011 |
10-04-2014 14:46 | Axel Rennoch | Status | assigned => confirmed
11-04-2014 13:05 | Gyorgy Rethy | Note Added: 0012025 |
11-04-2014 13:06 | Gyorgy Rethy | Assigned To | Gyorgy Rethy => Tomas Urban
11-04-2014 13:06 | Gyorgy Rethy | Status | confirmed => assigned
11-04-2014 13:23 | Tomas Urban | Note Added: 0012027 |
18-06-2014 08:11 | Tomas Urban | File Added: CR6710_v2.docx |
18-06-2014 08:12 | Tomas Urban | Note Added: 0012115 |
18-06-2014 08:12 | Tomas Urban | Assigned To | Tomas Urban => Gyorgy Rethy
18-06-2014 08:12 | Tomas Urban | Status | assigned => confirmed
06-10-2014 15:49 | Gyorgy Rethy | Assigned To | Gyorgy Rethy => Jens Grabowski
07-10-2014 15:13 | Jens Grabowski | Note Added: 0012256 |
07-10-2014 15:13 | Jens Grabowski | Assigned To | Jens Grabowski => Gyorgy Rethy
07-10-2014 15:13 | Jens Grabowski | Status | confirmed => assigned
07-10-2014 15:13 | Jens Grabowski | Status | assigned => resolved
07-10-2014 15:13 | Jens Grabowski | Resolution | open => fixed
05-01-2015 17:51 | Gyorgy Rethy | Note Added: 0012627 |
05-01-2015 17:51 | Gyorgy Rethy | Status | resolved => closed
05-01-2015 17:51 | Gyorgy Rethy | Fixed in Version | => v4.7.1 (published 2015-06)

Notes

(0012011)
Axel Rennoch
10-04-2014 14:46

Problem: local timer defined in control part statement blocks should not appear as a parameter to altstep (they are not existing anymore after leaving the statement block) Analysis definitions within local statement block do not exist anymore after leaving the behavior block. The activation is not anymore valid and thus should not be allowed

(0012025)
Gyorgy Rethy
11-04-2014 13:05

I agree, that would be a silly coding style, but in TTCN-3 it is allowed. Allk timers are objects of the component instance, in this case the control part "component". So, actually, t_local is destroyed when the block is left, "just" its name becomes directly inaccessible. I.e., yes, for the
t_global.timeout; statement, t_local will expire earlier and causing stop of execution.
Btw. t_local still can be accessed outside of the block indirectly, by e.g.
any timer.running;
all timer.stop;
Let discuss the CR at the next session.

(0012027)
Tomas Urban
11-04-2014 13:23

György, I am afraid that you are not right. Timeout doesn't survive exit from a scope block according to this note from the section 12: "Timers declared and started in scope units such as functions cease to exist when the scope unit is left. They do not contribute to the test behaviour once the scope unit is left."
(Maybe this should not be a note, but a rule, because it seems to constitute a mandatory behaviour.)
Besides, if we allow this kind of behaviour for local timers of a control block, it is a question why we cannot do the same for local component timers. The whole idea behind the original proposal and the way how timers in the versions that preceded 4.6.1 were handled was that users don't have to think about out-of-scope timers being processed in the default procedure.

(0012115)
Tomas Urban
18-06-2014 08:12

Slightly modified according to yesterday discussion. Please check.

(0012256)
Jens Grabowski
07-10-2014 15:13

Resolution is fine with me.

(0012627)
Gyorgy Rethy
05-01-2015 17:51

Added to draft V4.6.3