summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/tests/tex-closeout.test
blob: 7f18d7aba6efe4e1cecf084ac5f66a12c2d791ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#! /bin/sh -vx
# $Id$
# Copyright 2019-2023 Karl Berry <tex-live@tug.org>
# You may freely use, modify and/or distribute this file.
# Check for a double free bug.

BinDir=${BinDir:-.}
ExeExt=${ExeExt:-}
_tex=$BinDir/tex$ExeExt

# in case we're invoked standalone instead of from make.
test -z "$srcdir" && srcdir=`cd \`dirname $0\`/.. && pwd` # web2c/
TEXMFCNF=$srcdir/../kpathsea; export TEXMFCNF

# Resulted in a double free with glibc on x86_64-linux ca.2019.
# We expect TeX to exit with bad status since the \openout
# of /tmp/a should not be allowed.
$_tex -ini '\batchmode \immediate\openout1=b \openout1=/tmp/a \end'

# If TeX crashed, we won't get here. The exit status will be something
# like 134 on GNU/Linux, but we don't want to rely on that.
fail=0

exit $fail