Testing

Hal Murray hmurray at megapathdsl.net
Sun Nov 22 02:40:47 UTC 2015


I ran into a bug in ntpq from NTP Classic 4.3.79   A cleanup had changed an 
int to a size_t.  That broke an end test which turned into a SEGFAULT from a 
stack buffer overflow.  (I'm assume size_t is unsigned.)

The first observation is that a TESTFRAME would have caught this.  That 
assumes we had captured an appropriate data set.  We should be sure to apply 
TESTFRAME to other programs rather than just ntp, and we should try to 
capture test data for every bug where it makes sense.

The next observation is that I don't know how to do arithmetic with mixed 
signed/unsigned types.  Or maybe I don't know how to do subtracts with 
unsigned,  Is there a good tutorial on this?  How much can the compiler help?

We don't get any compiler warnings.  Is that because our code is clean or 
because we don't have enough flags turned on?




-- 
These are my opinions.  I hate spam.





More information about the devel mailing list