+Tue Jan 25 21:01:43 WST 2005 John Darrington <john@darrington.wattle.id.au>
+
+ * aggregate.c: Initialised the complete agr_proc structure.
+ Closes bug #11675
+
+
Sun Jan 23 23:02:21 2005 Ben Pfaff <blp@gnu.org>
* print.c: (print_trns_free) Close the dfm writer if there is one,
/* Have we seen these subcommands? */
unsigned seen = 0;
- agr.writer = NULL;
- agr.sink = NULL;
+ memset(&agr, 0 , sizeof (agr));
agr.missing = ITEMWISE;
- agr.sort = NULL;
- agr.break_vars = NULL;
- agr.agr_vars = NULL;
- agr.dict = NULL;
- agr.case_cnt = 0;
- agr.prev_break = NULL;
agr.dict = dict_create ();
dict_set_label (agr.dict, dict_get_label (default_dict));
}
if (agr->dict != NULL)
dict_destroy (agr->dict);
+
case_destroy (&agr->agr_case);
}
\f
--- /dev/null
+#!/bin/sh
+
+# This program tests for a bug which crashed pspp when doing a aggregate
+# procedure
+
+TEMPDIR=/tmp/pspp-tst-$$
+TESTFILE=$TEMPDIR/`basename $0`.sps
+
+here=`pwd`;
+
+# ensure that top_srcdir is absolute
+cd $top_srcdir; top_srcdir=`pwd`
+
+export STAT_CONFIG_PATH=$top_srcdir/config
+
+
+cleanup()
+{
+ rm -rf $TEMPDIR
+}
+
+
+fail()
+{
+ echo $activity
+ echo FAILED
+ cleanup;
+ exit 1;
+}
+
+
+no_result()
+{
+ echo $activity
+ echo NO RESULT;
+ cleanup;
+ exit 2;
+}
+
+pass()
+{
+ cleanup;
+ exit 0;
+}
+
+mkdir -p $TEMPDIR
+
+cd $TEMPDIR
+
+activity="create program"
+cat > $TESTFILE <<EOF
+INPUT PROGRAM.
+LOOP c=1 TO 20.
+COMPUTE x=UNIFORM(10)
+END CASE.
+END LOOP.
+END FILE.
+END INPUT PROGRAM.
+
+AGGREGATE /BREAK=x .
+EOF
+if [ $? -ne 0 ] ; then no_result ; fi
+
+
+# The above input is invalid.
+# So this will have a non zero error status.
+# But it shouldn't crash!
+activity="run_program"
+$SUPERVISOR $here/../src/pspp $TESTFILE > /dev/null
+if [ $? -ne 1 ] ; then fail ; fi
+
+
+pass;