summaryrefslogtreecommitdiff
path: root/Bugs
diff options
context:
space:
mode:
Diffstat (limited to 'Bugs')
-rwxr-xr-xBugs/assignglob34
-rwxr-xr-xBugs/crash123
-rw-r--r--Bugs/crash21
-rw-r--r--Bugs/minmax12
-rw-r--r--Bugs/misparse2
5 files changed, 72 insertions, 0 deletions
diff --git a/Bugs/assignglob b/Bugs/assignglob
new file mode 100755
index 0000000000..f36e9e2150
--- /dev/null
+++ b/Bugs/assignglob
@@ -0,0 +1,34 @@
+#!./perl
+
+#!/usr/bin/perl
+$month = (split(' ',`date`))[1];
+
+while (<DATA>) {
+ next if 1 .. ?^$month\b?o;
+ next unless /deposit/;
+ ($day) = /(\d+)/;
+ local(*where) = m:([^/]+)$:;
+ # with the local, you get bad free's. with it, you get a core dump
+ $where{$day}++;
+}
+
+@days = sort { $a <=> $b } keys %personal;
+
+foreach $place ('tivoli', 'lists', 'personal') {
+ *where = $place;
+ foreach $day (@days) {
+ printf "Aug %02d: %3d in %s\n", $day, $where{$day}, $place;
+ }
+}
+
+__END__
+Aug 27 10:40:20 New mail from hess
+Aug 27 10:40:20 deposit into /home/wraeththu/tchrist/Mail/in.coming/tivoli
+Aug 27 10:42:27 New mail from jcarson
+Aug 27 10:42:27 deposit into /home/wraeththu/tchrist/Mail/in.coming/tivoli
+Aug 27 10:48:18 New mail from dean
+Aug 27 10:48:18 deposit into /home/wraeththu/tchrist/Mail/in.coming/tivoli
+Aug 27 11:05:56 New mail from hess
+Aug 27 11:05:56 deposit into personal
+Aug 27 11:13:28 New mail from hess
+Aug 27 11:13:28 deposit into personal
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";
+
diff --git a/Bugs/crash2 b/Bugs/crash2
new file mode 100644
index 0000000000..c726e2ef3b
--- /dev/null
+++ b/Bugs/crash2
@@ -0,0 +1 @@
+sleep(1) &sort
diff --git a/Bugs/minmax b/Bugs/minmax
new file mode 100644
index 0000000000..4251f81587
--- /dev/null
+++ b/Bugs/minmax
@@ -0,0 +1,12 @@
+#!./perl
+
+sub minmax {
+ eval '@_ = sort { $a '.shift().' $b } @_';
+ (shift, pop(@_));
+}
+
+($x, $y) = &minmax('<=>', 2, 4, 1, 0, 3);
+print "x = $x, y = $y\n";
+($x, $y) = &minmax('cmp', "foo", "bar", "zot", "xyzzy");
+print "x = $x, y = $y\n";
+
diff --git a/Bugs/misparse b/Bugs/misparse
new file mode 100644
index 0000000000..a76710cdce
--- /dev/null
+++ b/Bugs/misparse
@@ -0,0 +1,2 @@
+print STDERR "Can't open $mib_name: $!\n"
+&objviews'Exit;