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!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Ada.Containers and concurrent modification exception. Date: Wed, 19 Sep 2018 17:47:08 +0100 Organization: A noiseless patient Spider Message-ID: References: <87musdtstw.fsf@jacob-sparre.dk> <87in31tqp7.fsf@jacob-sparre.dk> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: reader02.eternal-september.org; posting-host="44bd55d3000cda42d46ebd754f5c3151"; logging-data="7943"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19JPKoJToeB7sp/2myWSrEinKFQ9M6NT2I=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (darwin) Cancel-Lock: sha1:UEo+SJaS4j7SPCJ6HCxhAyRa0v4= sha1:H7BboRiToVMt+Yo8PJ4see/S6cU= Xref: reader02.eternal-september.org comp.lang.ada:54376 Date: 2018-09-19T17:47:08+01:00 List-Id: Jacob Sparre Andersen writes: > Simon Wright writes: > >> Jacob Sparre Andersen writes: >> >>> I've posted an executable example here: >>> >>> https://bitbucket.org/sparre/ada-2012-examples/src/default/src/container_tampering.adb >> >> On macOS this hangs. Also on debian stretch. No assertion failures. > > Even built with the project file? Strange. I'm running Debian/Stretch > (9.5) here. It hadn't even occurred to me that there might be a project file! I don't use bitbucket (in spite of having relatives working at Atlassian) and confused it with pastebin ... OK, building with -gnata to enable assertions does indeed produce assertion failures: $ ./container_tampering ABC SYSTEM.ASSERTIONS.ASSERT_FAILURE: Position cursor of Next is bad SYSTEM.ASSERTIONS.ASSERT_FAILURE: Position cursor of function Key is bad But, if I'd been writing the Containers, this would have been a Program_Error; it's a disaster (and quite legal to reward erroneous code with PE, too).