Python test failure on Mac

Sean Gillies sgillies at FRII.COM
Sat May 14 10:12:41 PDT 2005


On May 14, 2005, at 11:03 AM, David Huttleston Jr wrote:

> On Fri, May 13, 2005 at 04:54:35PM -0600, Sean Gillies wrote:
>>
>> On May 13, 2005, at 4:11 PM, David Huttleston Jr wrote:
>>>
>>> Hello All,
>>>
>>> I'm in the process of porting Mapserver and some of it's supporting
>>> libraries to Mac OS X.  The results of which will be released as part
>>> of the DarwinPort project for others to download and build.
>>>
>>> I've bumped into a byte order error on the MapCloningTestCase.  I
>>> haven't seen anything on google or the archives so I thought I'd ask
>>> the list before I get ugly with this.  I know others have used
>>> MapServer on a Mac, has anyone else seen this before?
>>>
>>> % python runalltests.py -v
>>> check attributes of a cloned class ... ok
>>> testConstructorNoArg (classtest.ClassObjTestCase) ... ok
>>> testConstructorWithArg (classtest.ClassObjTestCase) ... ok
>>> MapCloningTestCase.testClonedLayers: the layers of a cloned map equal
>>> the original ... ERROR 1: CPLVerifyConfiguration(): byte order set
>>> wrong.
>>
>> Never seen that before, and haven't heard anything from other OS X
>> (10.3) mapscript users.  Looks like a GDAL error.
>> MapCloningTestCase.testClonedLayers doesn't even render an image, so
>> I'm not sure where it comes into play.  Maybe there's an assert
>> somewhere?
>
> Yes, it looks assertion-like.  Here is what I found in the gdal source
> code, at line 405 of cpl_conv.cpp
>
> void CPLVerifyConfiguration()
> {
> /*
> --------------------------------------------------------------------
> */
> /*      Verify data types.
>  */
> /*
> --------------------------------------------------------------------
> */
>     CPLAssert( sizeof(GInt32) == 4 );
>     CPLAssert( sizeof(GInt16) == 2 );
>     CPLAssert( sizeof(GByte) == 1 );
>
>     if( sizeof(GInt32) != 4 )
>         CPLError( CE_Fatal, CPLE_AppDefined,
>                   "sizeof(GInt32) == %d ... yow!\n",
>                   sizeof(GInt32) );
>
> /*
> --------------------------------------------------------------------
> */
> /*      Verify byte order
>  */
> /*
> --------------------------------------------------------------------
> */
>     GInt32   nTest;
>
>     nTest = 1;
>
> #ifdef CPL_LSB
>     if( ((GByte *) &nTest)[0] != 1 )
> #endif
> #ifdef CPL_MSB
>     if( ((GByte *) &nTest)[3] != 1 )
> #endif
>         CPLError( CE_Fatal, CPLE_AppDefined,
>                   "CPLVerifyConfiguration(): byte order set wrong.\n"
> );
> }
>
>> You forgot to tell us the most important information: which mapserver
>> and GDAL versions are you building?
>
> Oops.  Here's the libraries related to gdal and mapserver:
>
>   mapserver  4.4.1
>   gdal       1.1.9_1
>   jpeg       6b_0
>   libgeotiff 1.2.1_0
>   libpng     1.2.8_1
>   proj       4.4.7_0
>   tiff       3.7.1_0
>   zlib       1.2.2_1
>
> It seems odd that this hasn't been hit before.  So, I'm suspicious now
> of how gdal was built.  :-/  Is there a good way to test gdal?
>
> Thanks for the help, Sean.
>
> Dave

Dave,

Norman Vine has confirmed that this is a GDAL bug that was only very
recently fixed.  The fix might be present in the latest GDAL release.
Check the change log to find out for sure.  At any rate, you should
really be using a newer GDAL.  I'd also recommend MapServer from the
CVS head of the 4.4 branch.  There have been some important fixes since
4.4.1.

cheers,
Sean

--
Sean Gillies
sgillies at frii dot com
http://zcologia.com



More information about the MapServer-users mailing list