The program below will fail as indicated (or not run correctly, depending on platform) when pragma profile (Restricted) is in effect. Failures vary a little. On Mac OS X 10.6.8, GCC 4.7.0 x86_64-apple-darwin10.8.0 from 20111002: $ ./rstr rsrt Illegal instruction $ A seemingly hanging program (Debian 6, GCC 4.7.0 i686-pc-linux-gnu from 20110610). Stack traces in the debugger have varied a bit (on Mac), but mostly list subprograms to do with PO entry calls (waiting) and (pthread) mutex locking, judging by the names. Program receives SIGSEGV in debugger. $ gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/opt/GCC-4.7/libexec/gcc/x86_64-apple-darwin10.8.0/4.7.0/lto-wrapper Target: x86_64-apple-darwin10.8.0 Configured with: /Users/bauhaus/src/GCC/configure --enable-languages=c,ada --disable-nls --prefix=/opt/GCC-4.7 Thread model: posix gcc version 4.7.0 20111002 (experimental) (GCC) If the program text is in file "rstr.ada", then $ gnatchop -r -w rstr.ada && gnatmake rstr pragma Profile (Restricted); package Tsk is task Nop is pragma Priority (5); end Nop; end Tsk; with Report; package body Tsk is task body Nop is begin Report.Put_Line ("Nop"); end Nop; end Tsk; with Tsk; with Report; procedure Rstr is begin Report.Put_Line ("rsrt"); end Rstr; package Report is procedure Put_Line (Message : String); private protected Output is entry Wait; procedure Release; private Available : Boolean := True; end Output; end Report; with Ada.Text_IO; package body Report is procedure Put_Line (Message : String) is begin Output.Wait; Ada.Text_IO.Put_Line (Message); Ada.Text_IO.Flush; Output.Release; end Put_Line; protected body Output is entry Wait when Available is begin Available := False; end Wait; procedure Release is begin Available := True; end Release; end Output; end Report;
Still fails on mainline.
Still hangs on mainline.