The problem flow is this:
* The stepper reports a candidate (`p' is `P_STEP', and `proc' returns
`PGEN_TRY').
* We decide to (a) report an event (set `A_EVENT' in `act'), and (b)
initialize the tester (set `p = P_TEST', `proc = test', and `rq =
PGEN_BEGIN'.
* We call the event handler, but it returns `PGEN_ABORT'. We notice
that `p == P_TEST', and set `A_ENDTEST'.
* This causes us to call `test' with `PGEN_DONE'. Alas, the tester
hasn't been initialized, because we haven't actually called it with
`PGEN_BEGIN' yet. Result: segfault.
We can notice this because `rq == PGEN_BEGIN': don't set `A_ENDTEST'
if this is the case.
rc = PGEN_ABORT;
if (!(act & A_DONE)) {
act |= A_ENDSTEP | A_DONE;
- if (p == P_TEST)
+ if (p == P_TEST && rq != PGEN_BEGIN)
act |= A_ENDTEST;
}
}