From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: "J-P. Rosen" Newsgroups: comp.lang.ada Subject: Re: Assignment with Adjust and Task Safety Date: Sat, 26 Mar 2016 22:27:12 +0100 Organization: A noiseless patient Spider Message-ID: References: <2c50ad2f-e6d5-4dc9-b4d1-905409311a97@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Injection-Date: Sat, 26 Mar 2016 21:24:00 -0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="2b3884a634d8f846e0712b4e3a92507a"; logging-data="1021"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18Z2CKm8JSwpWNgD23cGcIf" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 In-Reply-To: Cancel-Lock: sha1:KPbDhV1r2VhJa+UlZOWyoIL73Ds= Xref: news.eternal-september.org comp.lang.ada:29901 Date: 2016-03-26T22:27:12+01:00 List-Id: Le 22/03/2016 19:50, Dmitry A. Kazakov a écrit : > Yes, it is a potentially a very dangerous problem. It would be great if > a tool like AdaControl could detect it. I hope J-P will comment on this. Something like this? (Excerpt form AdaControl User Guide): 5.21 Global_References This rule controls accesses to global elements that may be subject to race conditions, or otherwise shared. 5.21.1 Syntax global_references ( {, }); ::= all | read | written | multiple | multiple_non_atomic ::= | function | procedure | task | protected 5.21.2 Action This rule controls access to global variables from several entities (the roots). The must be subprograms, task types, single task objects, protected types, or single protected objects. As usual, the whole syntax for entities is allowed for . See Specifying an Ada entity name. The special keywords function, procedure, task, and protected are used to refer to all functions, procedures, tasks, and protected entities, respectively. The determines the kind of references that are controlled. If it is all, all references to global elements from the indicated entities are reported. If is read or written, only read (respectively write) accesses are reported. If is multiple, only global elements that are accessed by more than one of the indicated entities (i.e. shared elements) are reported. Note however that if a reference is found from a task type or protected type, it is always reported, since there are potentially several objects of the same type. If is multiple_non_atomic, references reported are the same as with multiple, except that global variables that are atomic or atomic_components and written from at most one of the indicated entities are not reported. Note that this latter case corresponds to a safe reader/writer use of atomic variables. This rule follows the call graph, and therefore finds references from subprogram and protected calls made (directly or indirectly) from the indicated entities. However, calls to subprograms from the Ada standard library are not followed. -- J-P. Rosen Adalog 2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00 http://www.adalog.fr