Under some conditions the hopper will run to satisfy a payout from a winning spin, even if you power off the machine and then power it up again it is supposed to complete any payout that is due to the player. This may be seen as a "runaway" hopper, it's actually just trying to do its job that the mpu has instructed. Or if someone pressed the "cashout" button and there are a lot of credits on the machine and the hopper runs out of coins it will still try to run each time you power the machine up. If the machine was in the middle of a payout and ran out of coins you have to put coins back into the hopper and let it finish the payout.
But if there really is a defect then on some machines you can remove the mpu board, power up the machine and see if the hopper runs continuously. If the hopper no longer runs continuously then the mpu board is suspect. But if the hopper runs all the time while the mpu is removed then the hopper & its control board is likely where the problem is. Swapping in known good parts is a good way to find the problem.