Hello all,

I've been working on a new stable release and in the course of the usual checks, I noticed that pike farm builds are failing on netbsd (9.3). A little investigation shows that the benchmark is effectively timing out. I think this failure is caused by the code that limits a test to a given amount of time.

Basically, the elapsed time is calculated as final_time - start_time as returned by gethrvtime(), and it appears that on netbsd, there's (I'm assuming) an overflow that causes the elapsed time to become negative. It happens often enough that the total amount of time spent on a given set of test runs becomes increasingly negative, essentially running any test forever.

I"m sure that there's a better solution but I'd like to suggest that in the interim, a simple check be added to ignore any negative times:

In Tools.Shoot.run_sub():

From:

        tg += (hrt - start_cpu) / 1000000.0;


To:

        int te = hrt - start_cpu;
        if(te < 0 ) te = 0;
        tg += te / 1000000.0;

Does anyone have any objection to me making this change in 9.0 and 8.0?

Bill
  • gethrvtime() overf... william

Reply via email to