POPLOG V16 BUG/PROBLEM REPORTS This is http://www.cs.bham.ac.uk/research/projects/poplog/V16/known-problems.txt Problems reported in Poplog V16 (64 bit) For more information see http://www.cs.bham.ac.uk/research/projects/poplog/V16/AREADME.html CONTENTS - (Use g to access required sections) -- 16 Dec 2019 sys_host_name (Aaron Sloman) (now FIXED) -- 6 Jan 2020 big integer problem Hakan Kjellerstrand -- 6 Jan 2020 Above error fixed by Waldek Hebisch -- 6 Jan 2020 Patch installed -------------------------------------------------------------------------- PROBLEMS -- 16 Dec 2019 sys_host_name (Aaron Sloman) (now FIXED) sys_host_name defined in $usepop/pop/src/sys_host_name.p Returns instead of hostname. -------------------------------------------------------------------------- -- 6 Jan 2020 big integer problem Hakan Kjellerstrand Subject: (POP-FORUM) Problem with round(sqrt)) on large integers in Poplog 16 Parts/Attachments: 1 Shown 139 lines Text (charset: UTF-8) 2 OK ~91 lines Text (charset: UTF-8) ---------------------------------------- Here is a strange behaviour in Poplog 16 using round and round(sqrt(i)): vars i; for i from 2 to 10000 do [^i ^(2**i) ^(round(sqrt(2**i)))]=>; endfor; Poplog 16 throws an error for 2**126: """ ..... ** [123 10633823966279326983230456482242756608 3260954456333195264] ** [124 21267647932558653966460912964485513216 4611686018427387904] ** [125 42535295865117307932921825928971026432 6521908912666390528] <<<<<<< System Error: Signal = 8, PC = 00000000005B31F7 >>>>>>> ;;; MISHAP - serr: SYSTEM ERROR (see above) ;;; FILE : /home/hakank/poplog/me/test_sqrt.p LINE NUMBER: 16 ;;; PRINT DOING ;;; DOING : round trycompile """ It is the same error if intof(sqrt(i)) is used. vars i; for i from 2 to 10000 do [^i ^(2**i) ^(intof(sqrt(2**i)))]=>; endfor; The previous Poplog version ("Version 15.65 Sat May 5 06:42:58 CEST 2012") managed to handle 2**1024 without any problem, and after that it throws a FLOATING POINT OVERFLOW error. If just sqrt(i) is used then Poplog16 manage to handle 2**1024, then a System error is thrown: vars i; for i from 2 to 10000 do [^i ^(2**i) ^(sqrt(2**i))]=>; endfor; """ ** [1024 179769313486231590772930519078902473361797697894230657273430081157732 6758055009631327084773224075360211201138798713933576587897688144166224 9284743063947412437776789342486548527630221960124609411945308295208500 5768838150682342462881473913110540827237163350510684586298239947245938 <<<<<<< System Error: Signal = 8, PC = 00000000005B330E >>>>>>> 479716304835356329624224137216 ;;; MISHAP - serr: SYSTEM ERROR (see above) ;;; FILE : /home/hakank/poplog/me/test_sqrt.p LINE NUMBER: 19 ;;; PRINT DOING ;;; DOING : => trycompile """ Interestingly, if 2,0**i is used then Poplog16 only mangage to 2**1023 and then throws an explicit FLOATING-POINT ERROR vars i; for i from 2 to 10000 do [^i ^(2**i) ^(2.0**i)]=>; endfor; """ .... ** [1023898846567431157953864652595394512366808988489471153286367150405788663 3790275048156635423866120376801056005693993569667882939488440720831124 6423715319737062188883946712432742638151109800623047059726541476042502 8844190753411712314407369565552704136185816752553422931491199736229692 39858152417678164812112068608 8988465674311600000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000.0] ;;; MISHAP - FLOATING-POINT OVERFLOW ;;; INVOLVING: 2.0 1024 ;;; FILE : /home/hakank/poplog/me/test_sqrt.p LINE NUMBER: 19 ;;; PRINT DOING ;;; DOING : ** trycompile """ Perhaps it's more clear with the following interaction in Poplog16: """ $ rlwrap pop11 Sussex Poplog (Version 16.0 sun 5 jan 2020 07:38:08 CET) Copyright (c) 1982-1999 University of Sussex. All rights reserved. : dataword(sqrt(2**1024))=> ** decimal : dataword(sqrt(2**1025))=> ;;; MISHAP - FLOATING-POINT OVERFLOW (converting biginteger) Hakan Kjellerstrand http://www.hakank.org -------------------------------------------------------------------------- -- 6 Jan 2020 Above error fixed by Waldek Hebisch It is unintended difference between 32 and 64 bit ports. The attached patch fixes this. But there seem to be other problem, I am looking at them. ..... > If just sqrt(i) is used then Poplog16 manage to handle 2**1024, then a > System error is thrown: > vars i; > for i from 2 to 10000 do > [^i ^(2**i) ^(sqrt(2**i))]=>; > endfor; > > """ > ** [1024 > 179769313486231590772930519078902473361797697894230657273430081157732 > 6758055009631327084773224075360211201138798713933576587897688144166224 > 9284743063947412437776789342486548527630221960124609411945308295208500 > 5768838150682342462881473913110540827237163350510684586298239947245938 > > <<<<<<< System Error: Signal = 8, PC = 00000000005B330E >>>>>>> Error is normal: the number is too big to fit into a float. However, probably there should be normal MISHAP message about overflow. > 479716304835356329624224137216 > ;;; MISHAP - serr: SYSTEM ERROR (see above) > ;;; FILE : /home/hakank/poplog/me/test_sqrt.p LINE NUMBER: 19 > ;;; PRINT DOING > ;;; DOING : => trycompile > """ > > Interestingly, if 2,0**i is used then Poplog16 only mangage to 2**1023 and > then throws an explicit FLOATING-POINT ERROR > > vars i; > for i from 2 to 10000 do > [^i ^(2**i) ^(2.0**i)]=>; > endfor; > > """ > .... > ** [1023 > 898846567431157953864652595394512366808988489471153286367150405788663 > 3790275048156635423866120376801056005693993569667882939488440720831124 > 6423715319737062188883946712432742638151109800623047059726541476042502 > 8844190753411712314407369565552704136185816752553422931491199736229692 > 39858152417678164812112068608 8988465674311600000000000000000000000000 > 0000000000000000000000000000000000000000000000000000000000000000000000 > 0000000000000000000000000000000000000000000000000000000000000000000000 > 0000000000000000000000000000000000000000000000000000000000000000000000 > 0000000000000000000000000000000000000000000000000000000000.0] > > ;;; MISHAP - FLOATING-POINT OVERFLOW > ;;; INVOLVING: 2.0 1024 > ;;; FILE : /home/hakank/poplog/me/test_sqrt.p LINE NUMBER: 19 > ;;; PRINT DOING > ;;; DOING : ** trycompile > """ AFAICS that is OK, already 2**1024 is too big. I am not sure why integer version works, probably due to rounding error, but I need to check. -- Waldek Hebisch Patch: --- ../trunk/pop/extern/lib/c_core.c 2019-06-09 15:17:51.000000000 +0000 +++ pop/extern/lib/c_core.c 2020-01-06 17:55:48.639430365 +0000 @@ -635,7 +635,7 @@ if (__pop_in_user_extern == -1) _exit(1); /* outside Pop */ -#if defined(i386) +#if defined(i386)||defined(__x86_64__) if (sig == SIGFPE) { extern greg_t __pop_fpe_handler; if (__pop_fpe_handler) -------------------------------------------------------------------------- -- 6 Jan 2020 Patch installed The above patch has been installed. Pop11 behaves as expected