FMSLogo 8.4.0 has an infinite regress if it tries to run a procedure that isn't defined, such that there's a file whose name matches the procedure, ending in .lgo, and that file doesn't define the procedure and also tries to run the procedure.
I have also reproduced this in ucblogo 6..2.
Steps to Reproduce:
Step 1: Save a file named bug610.lgo with the following contents
TO CRASH
; Assuming that BUG610 is not defined, running
; BUG610 loads this file recursively to define it.
; That tries to run BUG610 again, which loads
; this file again, until the stack is exhausted
; and fmslogo crashes.
BUG610
END
MAKE "startup [ CRASH ]
Step 2: Load the file in FMSLogo. You can also do this by double-clicking on the file.
What Happens:
fmslogo crashes. If run under a debugger, the stack trace implicates recursive:
(gdb) bt 40
#0 0x00007ffff688c077 in malloc_consolidate (av=av@entry=0x7ffff69f6ac0 <main_arena>) at malloc.c:4929
#1 0x00007ffff688e7a8 in _int_malloc (av=av@entry=0x7ffff69f6ac0 <main_arena>, bytes=bytes@entry=4096) at malloc.c:4174
#2 0x00007ffff688f259 in __libc_malloc2 (bytes=4096) at malloc.c:3458
#3 0x00007ffff6868b0c in __GI__IO_file_doallocate (fp=0xa94d00) at filedoalloc.c:91
#4 0x00007ffff6878d06 in __GI__IO_doallocbuf (fp=0xa94d00) at /usr/src/debug/glibc-2.42-11.fc43.x86_64/libio/libioP.h:1041
#5 __GI__IO_doallocbuf (fp=fp@entry=0xa94d00) at genops.c:368
#6 0x00007ffff6877b35 in __GI__IO_file_xsgetn (fp=0xa94d00, data=0x7fffff7ff25d, n=3) at fileops.c:1349
#7 0x00007ffff6869d7b in __GI__IO_fread (buf=<optimized out>, size=1, count=3, fp=0xa94d00) at iofread.c:38
#8 0x000000000047ac0c in read_character_encoding (Stream=0xa94d00) at unicodefile.cpp:252
#9 0x00000000004291e6 in fileload (Filename=...) at fileswnd.cpp:85
#10 0x0000000000427c97 in silent_load (arg=0xab4560, prefix=0x0) at files.cpp:1021
#11 0x0000000000420d5a in load_procedure_if_necessary (ProcNode=0xab5df0) at eval.cpp:131
#12 0x0000000000464936 in paren_expr (expr=0x7fffff7ff858, inparen=false) at paren.cpp:263
#13 0x0000000000464b2e in paren_line (line=0x0) at paren.cpp:343
#14 0x0000000000464fcf in treeify_line (newtree=0x5d09f70) at paren.cpp:556
#15 0x00000000004645c6 in treeify_body (body=0x5d09fc0) at paren.cpp:114
#16 0x00000000004226c0 in evaluator (list=0x5d09fc0, where=begin_line) at eval.cpp:1625
#17 0x000000000042452b in eval_driver (line=0x5d02ef0) at eval.cpp:2549
#18 0x0000000000427a7d in runstartup (oldst=0x5cfdc00) at files.cpp:924
#19 0x00000000004292d1 in fileload (Filename=...) at fileswnd.cpp:115
#20 0x0000000000427c97 in silent_load (arg=0xab4560, prefix=0x0) at files.cpp:1021
#21 0x0000000000420d5a in load_procedure_if_necessary (ProcNode=0xab5df0) at eval.cpp:131
#22 0x0000000000464936 in paren_expr (expr=0x7fffff800068, inparen=false) at paren.cpp:263
#23 0x0000000000464b2e in paren_line (line=0x0) at paren.cpp:343
#24 0x0000000000464fcf in treeify_line (newtree=0x5d04c80) at paren.cpp:556
#25 0x00000000004645c6 in treeify_body (body=0x5d04cd0) at paren.cpp:114
#26 0x00000000004226c0 in evaluator (list=0x5d04cd0, where=begin_line) at eval.cpp:1625
--Type <RET> for more, q to quit, c to continue without paging--c
#27 0x000000000042452b in eval_driver (line=0x5cfdc00) at eval.cpp:2549
#28 0x0000000000427a7d in runstartup (oldst=0x5cf8910) at files.cpp:924
#29 0x00000000004292d1 in fileload (Filename=...) at fileswnd.cpp:115
#30 0x0000000000427c97 in silent_load (arg=0xab4560, prefix=0x0) at files.cpp:1021
#31 0x0000000000420d5a in load_procedure_if_necessary (ProcNode=0xab5df0) at eval.cpp:131
#32 0x0000000000464936 in paren_expr (expr=0x7fffff800878, inparen=false) at paren.cpp:263
#33 0x0000000000464b2e in paren_line (line=0x0) at paren.cpp:343
#34 0x0000000000464fcf in treeify_line (newtree=0x5cff990) at paren.cpp:556
#35 0x00000000004645c6 in treeify_body (body=0x5cff9e0) at paren.cpp:114
#36 0x00000000004226c0 in evaluator (list=0x5cff9e0, where=begin_line) at eval.cpp:1625
#37 0x000000000042452b in eval_driver (line=0x5cf8910) at eval.cpp:2549
#38 0x0000000000427a7d in runstartup (oldst=0x5cf3620) at files.cpp:924
#39 0x00000000004292d1 in fileload (Filename=...) at fileswnd.cpp:115
Expected Result:
FMSLogo hangs for a bit, then prints something out that indicates there was a problem. Either a "I don't know how to" error, a stack overflow error, or a new error like "maximum number of recursive loads exceeded".
Note: A simpler file which explicitly calls LOAD throws a file system error and doesn't crash, so whatever strategy LOAD uses may also be applicable to silent_load.