#endif
+void (*ext_fatal)(void) = NULL;
+
static unsigned powerUps;
static unsigned cycleStarts;
static unsigned cycleEnds;
static void FatalError(int lineNo)
{
printf("Integrity error %d\n",lineNo);
+ if(ext_fatal)
+ ext_fatal();
+
while(1){
sleep(1);
}
#!/bin/bash
+iterations=100000
-for ((i=0; i < 100000; i++))
+[ -z $1 ] || iterations=$1
+
+
+rm iteration-max-*
+touch iteration-max-$iterations
+
+echo " Running $iterations iterations"
+sleep 2
+
+for ((i=0; i < $iterations; i++))
do
seed=$RANDOM
echo $seed>seed-nand-for-run-$i
rm emfile-2k-0-*$j
cp emfile-2k-0 emfile-2k-0-$i
- echo
- echo
- echo "######### Run $i with seed $seed"
+ echo "#########"
+ echo "#########"
+ echo "#########"
+ echo "######### Run $i of $iterations with seed $seed"
+ echo "#########"
+ echo "#########"
+ echo "#########"
./yaffs_test -u -f -p -s$seed yaffs2
done
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
+#include <signal.h>
#include "yaffsfs.h"
#include "nor_stress.h"
#include "yaffs_fsx.h"
-
+void (*ext_fatal)(void);
int random_seed;
exit(2);
}
+void test_fatal(void)
+{
+ printf("fatal yaffs test pid %d sleeping\n",getpid());
+ while(1)
+ sleep(1);
+
+}
+
+void bad_ptr_handler(int sig)
+{
+ printf("signal %d received\n",sig);
+ test_fatal();
+}
int main(int argc, char **argv)
{
int ch;
-
+ ext_fatal = test_fatal;
+ signal(SIGSEGV,bad_ptr_handler);
+ signal(SIGBUS,bad_ptr_handler);
+ signal(SIGABRT,bad_ptr_handler);
+
while ((ch = getopt(argc,argv, "filn:ps:u"))
!= EOF)
switch (ch) {
* This is only intended as test code to test persistence etc.
*/
-const char *yaffs_flashif2_c_version = "$Id: yaffs_fileem2k.c,v 1.20 2009-10-15 00:45:46 charles Exp $";
+const char *yaffs_flashif2_c_version = "$Id: yaffs_fileem2k.c,v 1.21 2009-11-07 22:35:15 charles Exp $";
#include "yportenv.h"
if(simulate_power_failure &&
remaining_ops < 1){
printf("Simulated power failure after %d operations\n",nops_so_far);
- printf(" Fail simulated on chunkInNAND %d, at fail point %d\n",
+ printf(" power failed on chunkInNAND %d, at fail point %d\n",
chunkInNAND, failPoint);
exit(0);
}