I've managed to further narrow down the source of the problem to the fact that I've got two joysticks (the yoke and the pedals).
If I remove the pedals, everything works fine.
I also checked the exception code, and it's access violation. Maybe event.jbutton.which returns a number that is different from 0 or 1? I noticed that in eventsystem::Init() the joystick vector is simply built in the order the controllers are enumerated but doesn't check SDL_Joystick.instance_id. But in eventsystem:
rocessEvents() it uses the value of event.jbutton.which as an index into the joystick vector.
It could be a complete red herring though.