There is no end of song marker. Most times projects that go past where you think they should, there is some data way down the timeline. It can be an automation node, midi event or loop like the one you just experienced. If you want to assure the length of an export, in addition to selecting the tracks to export, select the time range. There are several ways to specify the time range. One way is drag across the timeline.