Re: How do I report a suspected bug to INFORMIX?
Posted in 1994
}From: gregl@vcd.hp.com (Greg Letendre) }Subject: Re: How do I report a suspected bug to INFORMIX? }Date: Fri, 24 Jun 1994 03:34:21 GMT }X-Informix-List-Id: <news.7335> } }Speaking of running purify on informix code..... }I am getting this UMR on a simple time conversion utility }we wrote here: } }---------------------------------------------------------- }Purify (umr): uninitialized memory read: } * This is occurring while in: } strncpy [fp_fvs, pc=0x1b128] } unix_time_to_informix_time [line 228, pcat_time_utils.ec, pc=0x97aec] } set_feeder_row [line 103, set_feeder_row.ec, pc=0x95f74] } } * Reading 8 bytes from 0x7b033bba on the stack } (1 byte at 0x7b033bc1 uninit). } * This is 8 bytes past start of local variable "informix_time" in function } unix_time_to_informix_time. }---------------------------------------------------------- } }Here is the .ec code on this: } }void unix_time_to_informix_time (time_t *unix_time, dtime_t *return_struct) { } ... } char time_string[81]; } $datetime year to second informix_time; } ... } strncpy(return_struct->dt_dec.dec_dgts, } informix_time.dt_dec.dec_dgts, } DECSIZE); } ... }The UMR is on the last strncpy. So I am suspecting that somthing }is amiss with the sizes of DECSIZE and the datetime struct. }Any ideas?? Not all the digits in the decimal structure are needed to store a DATETIME, so not all the digits have been initialized, so you get UMRs when you read them. Solution: don't read that which hasn't been written. Change DECSIZE into return_struct->dt_dec.dec_ndgts. Yours, Jonathan Leffler (johnl@informix.com) #include <disclaimer.h>