What causes "dieseling"

Ignition timing and or bad gas is my guess.
Both are easy to check.

Also, pull out the spark plugs, check them and clean them if needed.

Short story,
I had a nasty knock coming from my old Kohler K series in my tractor. The issue turned out to be bad gas that I had in the can which was causing the worst diesel/spark knock I have ever heard.