summaryrefslogtreecommitdiff
path: root/Bugs/crash1
diff options
context:
space:
mode:
authorLarry Wall <lwall@netlabs.com>1993-10-07 23:00:00 +0000
committerLarry Wall <lwall@netlabs.com>1993-10-07 23:00:00 +0000
commit79072805bf63abe5b5978b5928ab00d360ea3e7f (patch)
tree96688fcd69f9c8d2110e93c350b4d0025eaf240d /Bugs/crash1
parente334a159a5616cab575044bafaf68f75b7bb3a16 (diff)
downloadperl-79072805bf63abe5b5978b5928ab00d360ea3e7f.tar.gz
perl 5.0 alpha 2perl-5a2
[editor's note: from history.perl.org. The sparc executables originally included in the distribution are not in this commit.]
Diffstat (limited to 'Bugs/crash1')
-rwxr-xr-xBugs/crash123
1 files changed, 23 insertions, 0 deletions
diff --git a/Bugs/crash1 b/Bugs/crash1
new file mode 100755
index 0000000000..7e6eff7942
--- /dev/null
+++ b/Bugs/crash1
@@ -0,0 +1,23 @@
+#!./perl
+# These filenames doesn't seem to matter, as long as the first one exists,
+# and we have permission to create the second one.
+open(OLD_FILE, "/etc/passwd");
+open(NEW_FILE, ">/tmp/foobar");
+
+# This line is unnecessary to trigger death, but it helps to show where
+# we crash and burn.
+$| = 1;
+
+# Seemingly, this loop is necessary to activate the bug. If I just say
+# $_ = <OLD_FILE>
+# instead of the loop, everything works as expected.
+while (<OLD_FILE>) {
+ # This was originally just a random typing spaz on my part, but it causes
+ # perl to crash later.
+ print <NEW_FILE>;
+}
+
+print "About to die...\n";
+print "dest = '$dest'\n";
+print "Didn't die!\n";
+