Hi,

I was cutting and pasting some code from recent forum emails ("Interesting
Quora Problem") when I encountered a sequence that reliably crashes the
interpreter.

It goes like this:
   4!:55 <'digits'
1
   digits
|value error: digits

   F=: {{(#~ 0=x|]);(10*y)+&.> (<>:i.9) (-. digits) &.> y}}
   N1=: 1+i.9

   F=: {{(#~ 0=x|]);(10*y)+&.> (<y) (-. digits) &.> y}}
   9 F 8 F 7 F 6 F 5 F 4 F 3 F 2 F N1
|value error: digits
|   (#~0=x|]);(10*y)+&.>(<y)    (-.digits)&.>y
|F[:0]

Look at the stack:
      13!:1''
|value error
*   (#~0=x|]);(10*y)+&.>(<y)    (-.digits)&.>y
|F[:0]
|   9 F 8 F 7 F 6 F 5 F 4 F 3 F 2     F N1

Cut back the stack:
      dbr 1 [ dbr 0 NB. 13!:19''
|value error: F
|   (#~0=x|]);(10*y)+&.>(<y)(-.    digits)&.>y
|F[:0]


Cut back the stack again and crash:
      dbr 1 [ dbr 0 NB. 13!:19''

Process shell<1> exited abnormally with code 5

This is on Windows 10 for JVERSION
Engine: j9.5.0-beta5/j64avx2/windows
Build: commercial/2023-07-31T00:44:14/clang-15-0-7/SLEEF=1
Library: 9.5.3
Platform: Win 64
Installer: j9.5 install
InstallPath: c:/pgm/j9.5
Contact: www.jsoftware.com


-- 

Devon McCormick, CFA

Quantitative Consultant
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to