Re: Segmentation Fault

From: David Brown <dbrown_at_nyahnyahspammersnyahnyah>
Date: Thu Feb 02 2012 - 04:01:08 MST

FYI to ncl-talk users:

The fix that Wei submitted has been incorporated into NetCDF.
 -dave

Begin forwarded message:

> From: Russ Rew <russ@unidata.ucar.edu>
> Subject: Re: [netcdfgroup] Problem to read slices from chunked and compressed data
> Date: February 1, 2012 4:00:20 PM MST
> To: Wei Huang <huangwei@ucar.edu>
> Cc: dmh@unidata.ucar.edu
>
> Thanks Wei!
>
> I'm incorporating the fix into our snapshot for 4.2-rc2 now. I'm
> changing the fix slightly, from your
>
> if (!scalar && provide_fill)
> {
> void *filldata;
> size_t real_data_size = 0;
> size_t fill_len;
>
> /* Skip past the real data we've already read. */
> if (!no_read)
> {
> for (real_data_size = 1, d2 = 0; d2 < var->ndims; d2++)
> real_data_size *= (count[d2] - start[d2]);
> real_data_size *= file_type_size;
> }
>
> to
>
> if (!scalar && provide_fill)
> {
> void *filldata;
> size_t real_data_size = 0;
> size_t fill_len;
>
> /* Skip past the real data we've already read. */
> if (!no_read)
> {
> for (real_data_size = file_type_size, d2 = 0; d2 < var->ndims; d2++)
> real_data_size *= (count[d2] - start[d2]);
> }
>
> for stylistic reasons, if you agree that does the same thing. I've
> checked it on all our tests, and it seems to work fine.
>
> We really appreciate your figuring out what was wrong and supplying this
> fix! I've looked for other similar bugs in the code using the regular
> expression
>
> grep -nH -e " \*= .*\*" *.c
>
> and fortunately didn't find any, so I think your fix eliminates all
> occurrences of this specific kind of bug.
>
> --Russ

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Feb 2 04:01:27 2012

This archive was generated by hypermail 2.1.8 : Mon Feb 06 2012 - 14:24:56 MST