[tlbuild] expand_depth vs. sigsegv check

Nelson H. F. Beebe beebe at math.utah.edu
Tue Jun 2 01:05:50 CEST 2020

>> can you please try running
>> tex '\def\z{\number\z}\z'

I did this on Ubuntu 20.04, and various DragonflyBSD, FreeBSD, NetBSD,
OpenBSD, and Solaris 11.4 systems, and all produced the expected output:

	! TeX capacity exceeded, sorry [expansion depth=10000].

I also used the "limit" command to reduce the default stacksize
without changing the output, though the systems I tried it on would
not allow a stacksize below about 4MB.

However, I hit the jackpot on Solaris 11.4, where stacksize 2048
succeeds, but this fails:

	% limit stacksize 1024

	% tex '\def\z{\number\z}\z'
	This is TeX, Version 3.14159265 (TeX Live 2020/dev) (preloaded format=tex)
	Segmentation fault

I ran it under gdb, but there the output is expected, so it must jack
up the stacksize, and indeed, it does:
	(gdb) ! limit
	cputime      unlimited
	filesize     unlimited
	datasize     unlimited
	stacksize    32768 kbytes
	coredumpsize 512 kbytes
	vmemoryuse   unlimited
	descriptors  256 

Typically, on Unix, bad things happen when the stack is too small, and
there is generally no way to catch a stack overflow from deep
recursion: one just gets a segment violation and immediate
termination, and inside a debugger, the stack may be wiped out.

- Nelson H. F. Beebe                    Tel: +1 801 581 5254                  -
- University of Utah                    FAX: +1 801 581 4148                  -
- Department of Mathematics, 110 LCB    Internet e-mail: beebe at math.utah.edu  -
- 155 S 1400 E RM 233                       beebe at acm.org  beebe at computer.org -
- Salt Lake City, UT 84112-0090, USA    URL: http://www.math.utah.edu/~beebe/ -

More information about the tlbuild mailing list.