Re: How do I report a suspected bug to INFORMIX?
Posted in 1994
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) { int ret; struct tm *tm_info; char time_string[81]; $datetime year to second informix_time; /* First Convert unix_time to a "standard" char string */ tm_info = localtime (unix_time); strftime(time_string, 80, "%Y-%m-%d %H:%M:%S", tm_info); /* Now convert the "standard" char string to the Informix struct */ if(ret = dtcvasc(time_string, &informix_time)) { return_struct = (dtime_t *) NULL; return; } else { /* then the conversion was successful */ return_struct->dt_qual = informix_time.dt_qual; return_struct->dt_dec.dec_exp = informix_time.dt_dec.dec_exp; return_struct->dt_dec.dec_pos = informix_time.dt_dec.dec_pos; return_struct->dt_dec.dec_ndgts = informix_time.dt_dec.dec_ndgts; 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?? Greg Letendre Hewlett Packard Vancouver Division CIM Engineering