[Met_help] possible error in METv1.1

John Halley Gotway johnhg at rap.ucar.edu
Fri Aug 22 11:01:11 MDT 2008


Matt,

Did you ever receive my last email about a test program?  I got a weird bounce message indicating that it might not have gone through.  I've copied it below.

Also, regarding endianess.  MET was built and initially tested on little endian Linux machines.  However, we were able to port it to a big endian IBM machine - NCAR's supercomputers.  If your PowerPC
is big endian, you'll need to set some architecture flags at compile time.  Take a look in the top-level "Makefile_ibm" for an example, and look for the "ARCH_FLAGS" line:
ARCH_FLAGS   = -DIBM -DBIGENDIAN
You could try setting your ARCH_FLAGS to -DBIGENDIAN and recompiling.

Here's my other message:

Matt,

I'd like to find out more info about your system.  In particular, what's the size of a "char".  I've attached a simple test program that will dump out the sizes and alignments of basic types.  Please
do the following:

(1) Compile the attached test program with a C++ compiler:
g++ test_program.cc -o test_program

(2) Run the test program and send the output to a file:
./test_program > test.out

(3) Send me a copy of the "test.out" file.

I've been talking to another engineer here about this, and hopefully this info will help us figure out what's going on.

Thanks,
John



J Matt Clark wrote:
> John Halley Gotway wrote:
>> Matt,
>>
>> I looked through the vx_met_util library and added a print statement to the "get_column_format()" to dump the length of the "fmt_str".  The length of the "fmt_str" variable varies depending on the
>> line type, but here are the values I found: 35, 41, 47, 53, 65, 365, 371, 437
>>
>> And all of them are under 512 (max_str_len).  Perhaps something else is going on here.  I notice that 730 is exactly 2 * 365, which is one of the sting lengths I encountered.
>>
>> Can you tell me what OS you're running MET on?
>>
>> Thanks,
>> John Halley-Gotway
>> johnhg at ucar.edu
>>
>>   
> John,
> 
> I believe that my problems can be attributed to endianness - the sample data 
> files appear to be little-endian; the powerpc
> expects big-endian (or vice-versa - I never remember which is which....) So the 
> examples that read binary data won't rin.
> 
> Thanks,
> 
> Matt
>> J Matt Clark wrote:
>>   
>>> Sirs:
>>>
>>> I have installed and run METv1.1, and discovered a possible error in the
>>> grid_stat function,
>>> Reference ./lib/vx_met_util:
>>>
>>> In vsdb_columns.cc,  fimction get_column_format is called to build
>>> fmt_str, which is defined
>>>
>>> char fmt_str[max_str_len];
>>>
>>> and max_str_len is defined in constants.h:
>>>
>>> static const int max_str_len  = 512;
>>>
>>> However, get_column_format appears to pack 730 or so characters into
>>> char_fmt_str - which overflows and
>>> eventually causes a seg fault.
>>>
>>> Tnx,
>>>
>>> Matt
>>> _______________________________________________
>>> Met_help mailing list
>>> Met_help at mailman.ucar.edu
>>> http://mailman.ucar.edu/mailman/listinfo/met_help
>>>     
>>
>>   
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_program.cc
Type: text/x-c++src
Size: 5526 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/met_help/attachments/20080822/4f82264e/test_program.bin


More information about the Met_help mailing list