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: border2.nntp.ams.giganews.com!nntp.giganews.com!news.mixmin.net!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Will Ada-95 Programs Written in MS Windows Run in MacOS and Linux Without Some Tweaking. Date: Sun, 08 Dec 2013 17:17:45 +0000 Organization: A noiseless patient Spider Message-ID: References: <1d445f04-b670-444f-9858-55da271fe17a@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx05.eternal-september.org; posting-host="10c7eb3b0340aed81770a984b2485704"; logging-data="20170"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/F42FcE3orAjIqOvz0qM7QmWOz2PtqZ40=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (darwin) Cancel-Lock: sha1:KbTFMC7N39xtz1D2hrRkn1jHWII= sha1:aug4AiXiXwUMnkJsx/SwLi/uipw= Xref: number.nntp.dca.giganews.com comp.lang.ada:184140 Date: 2013-12-08T17:17:45+00:00 List-Id: Austin Obyrne writes: > Could I ask you to start again and download "SureCrypt Cipher" from > > http://www.adacryptpages.com Things are not as good as I'd hoped. The programs build OK (aside from a warning or two), but general_decryption_program_mark_1 fails immediately with Execution terminated by unhandled exception Exception name: STORAGE_ERROR Message: stack overflow at the start of the main program. This is usually a symptom of not having enough stack space, caused (in your case) by having lots of large arrays in the main program, not helped by initialising them - there was a recent thread[1] here about this. On the Mac there's a default stack limit of 8Mb; other OS's will have different limits, if limits at all. After poking at this for some time, there are two solutions: (a) move all the array declarations to a package of their own (for example, General_Decryption_Program_Mark_1_Arrays) and with/use it. The arrays are no longer on the stack (I'm not sure about the initializers). (b) increase the program's stack size. The help for gnatbind says I could add the switch -d16m for a 16 Mb stack, but this had no effect; instead, there's a Mac-specific way of doing this which I won't bore you with. Having got the program to start, I tried to decrypt the supplied CipherTextFile_1.dat and got Execution terminated by unhandled exception Exception name: ADA.IO_EXCEPTIONS.DATA_ERROR and as far as I can tell this was caused by the Windows line terminator[2] in the data file; that's to say, when I removed the CR character from the Windows CR/LF the program decoded correctly. I'm not sure of the best way to get an Ada program not to care what sort of input line terminators it's reading. --S [1] https://groups.google.com/forum/?hl=en#!searchin/comp.lang.ada/large$20array%7Csort:date/comp.lang.ada/d-HSSQR9jHo/NjNp6cl6WaIJ [2] http://en.wikipedia.org/wiki/Newline