I'm using several MCP23017 GPIO chips in my project. The MCP23017's serve a number of buttons, switches, alarm signals, lights, etcetera. For software I'm using Nick Gammon's example code on how to operate an MCP23017 using interrupts and i2c, there is a slightly modified version here. After a while I noticed in my project that it is possible for the communication between Arduino and MCP23017 to get stuck, apparently the MCP23017 is hanging. After some digging I found that this is due to the fact that the MCP23017 stops generating interrupts.
The problem occurs when pressing more than one button, all connected to the same MCP23017, in quick succession. At least one button must be connected to GPIOA, and at least one button must be connected to GPIOB. I.e. if all buttons are connected to GPIOA, or if all buttons are connected to GPIOB, no problem ever occurs.
I then went back to Nick Gammon's original code, and found that it suffers from the same problem.
After many hours of digging, on this forum, the MCP23017 data sheet, and in the code, I found the solution here (in German).
This post only serves in the hope that it will make it easier for others, stumbling across the same problem as I did, to find the solution.