Debian Codegraph @

texk/web2c/tests/tex-closeout.test

raw
1 #! /bin/sh -vx
2 # $Id: tex-closeout.test 68508 2023-10-10 22:01:41Z karl $
3 # Copyright 2019-2023 Karl Berry <[email protected]>
4 # You may freely use, modify and/or distribute this file.
5 # Check for a double free bug.
6
7 BinDir=${BinDir:-.}
8 ExeExt=${ExeExt:-}
9 _tex=$BinDir/tex$ExeExt
10
11 # in case we're invoked standalone instead of from make.
12 test -z "$srcdir" && srcdir=`cd \`dirname $0\`/.. && pwd` # web2c/
13 TEXMFCNF=$srcdir/../kpathsea; export TEXMFCNF
14
15 # Resulted in a double free with glibc on x86_64-linux ca.2019.
16 # We expect TeX to exit with bad status since the \openout
17 # of /tmp/a should not be allowed.
18 $_tex -ini '\batchmode \immediate\openout1=b \openout1=/tmp/a \end'
19
20 # If TeX crashed, we won't get here. The exit status will be something
21 # like 134 on GNU/Linux, but we don't want to rely on that.
22 fail=0
23
24 exit $fail