Peter Keenan wrote:
This allowed me generate 64 bit programs. My program contained a reference to the memavail function in system.pas. I had earlier had some problems with this function in 32 bit mode when it gave an error http://www.gnu-pascal.de/crystal/gpc/en/mail11086.htm
In 64 bit mode the use of this function did not report an error but partly disabled the operating system, which should have been quite impossible for a normal user without root privileges!
That would indicate a system bug, because GPC compiled programs can't do anything the system doesn't allow them to do, of course. If such a program can partly disable the OS incidentally, a malicious program could do as least as much damage.
Now, I'm not sure what it actually disabled -- perhaps it just went trashing swap memory or occupying all virtual memory -- things that, indeed, any normal program can do. The usual cure would be to set ulimit reasonably. (Though a well-designed OS, in case of virtual memory shortage, should IMHO kill the most memory-intensive, non-system-critical processes first, which would be this program in this case, so things should go well. Apparently it didn't.)
BTW, you did read the comments about MemAvail in the System unit? The bottom line is that you probably don't want to use it. They're provided for compatibility with a 20 years old 16 bit compiler on a single-user system, and not very useful for modern programs for several reasons.
Frank