Hi all,
I am getting failures for the marshal_028 test when compiled on Fedora
pre-9 that contains gcc 4.3. It fails in both openhpi 2.10.2 and the
current trunk and on both i386 and x86_64 architectures. I have tested
F-8 and RHEL-5 (both x86_64) with gcc 4.1.2 and there are no such
problems.
The real failure is somewhere inn the array marshaling functions as the
check what fails is "memcmp(value, result, sizeof(array))". Attached are
outputs from a bit modified marshal_028.c file.
Do you have any ideas or should I try to investigate the issue further?
Dan
--
Dan Horák
Software Engineer
Red Hat Czech s.r.o., Purkyňova 99, 612 45 Brno
len=288
54 65 73 74 20 50 61 72 61 6d 00 00 00 00 00 00 00 00 00 00 01 00 00 00 05 00
00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00
54 65 73 74 20 50 61 72 61 6d 00 00 00 00 00 00 00 00 00 00 01 00 00 00 05 00
00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00
PASS: marshal_028
len=288
54 65 73 74 20 50 61 72 61 6d 00 00 00 00 00 00 00 00 00 00 01 00 00 00 05 00
00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00
54 65 73 74 20 50 61 72 61 6d 00 00 00 00 00 00 00 00 00 00 01 00 00 00 05 00
00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00
00 00 00 00 00 00 00 00 60 f8 fc ab aa 2a 00 00 ff ff ff ff 00 00 00 00 00 00
00 00 00 00 00 00
00 00 00 00 00 00 00 00 c0 96 60 00 00 00 00 00 ff ff ff ff ff ff ff ff 00 00
00 00 00 00 00 00
d0 96 60 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00
ff ff ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 e5
fc ab aa 2a 00 00
00 00 00 00 ff ff ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00
array
FAIL: marshal_028
/*
* Copyright (c) 2004 by FORCE Computers.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. This
* file and program are licensed under a BSD style license. See
* the Copying file included with the OpenHPI distribution for
* full licensing terms.
*
* Authors:
* Thomas Kanngieser <[EMAIL PROTECTED]>
*/
#include "marshal.h"
#include "marshal_hpi_types.h"
#include <string.h>
#include <SaHpi.h>
void dump(unsigned char *data, long len);
typedef struct
{
tUint8 m_pad1;
tUint8 m_size;
tUint8 m_pad2;
SaHpiDimiTestVariableParamsT *m_array;
tUint8 m_pad3;
} cTest;
cMarshalType TestVarArrayType = dVarArray( SaHpiDimiTestVariableParamsType, 1 );
cMarshalType StructElements[] =
{
dStructElement( cTest, m_pad1 , Marshal_Uint8Type ),
dStructElement( cTest, m_size , Marshal_Uint8Type ),
dStructElement( cTest, m_pad2 , Marshal_Uint8Type ),
dStructElement( cTest, m_array, TestVarArrayType ),
dStructElement( cTest, m_pad3 , Marshal_Uint8Type ),
dStructElementEnd()
};
cMarshalType TestType = dStruct( cTest, StructElements );
SaHpiDimiTestVariableParamsT params_list[] = {
{
.ParamName = "Test Param",
.ParamType = SAHPI_DIMITEST_PARAM_TYPE_INT32,
.Value.paramint = 5
}
};
void dump(unsigned char * data, long len)
{
long i;
for(i = 0; i < len; i++)
{
printf("%02x ", data[i]);
if ((i+1) % 32 == 0)
printf("\n");
}
printf("\n");
}
int
main( int argc, char *argv[] )
{
cTest value =
{
.m_pad1 = 47,
.m_size = 1,
.m_pad2 = 48,
.m_array = params_list,
.m_pad3 = 49
};
unsigned char buffer[256];
cTest result;
unsigned int s1 = Marshal( &TestType, &value, buffer );
unsigned int s2 = Demarshal( MarshalByteOrder(), &TestType, &result, buffer );
printf("len=%ld\n", sizeof(SaHpiDimiTestVariableParamsT ));
dump((unsigned char *)value.m_array, sizeof(SaHpiDimiTestVariableParamsT ));
dump((unsigned char *)result.m_array, sizeof(SaHpiDimiTestVariableParamsT ));
if ( s1 != s2 )
return 1;
if ( value.m_pad1 != result.m_pad1 )
{
printf("pad1\n");
return 1;
}
if ( value.m_size != result.m_size )
{
printf("m_size\n");
return 1;
}
if ( value.m_pad2 != result.m_pad2 )
{
printf("pad2\n");
return 1;
}
if ( value.m_pad3 != result.m_pad3 )
{
printf("pad3\n");
return 1;
}
if ( memcmp( value.m_array, result.m_array, sizeof(SaHpiDimiTestVariableParamsT )) )
{
printf("array\n");
return 1;
}
return 0;
}
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Openhpi-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openhpi-devel