Bug Report 2001/10/19-v1.0b26-br05


[MAIN]
[News]
[Intro]
[Features]
[Download]
[Installation]
[Support]
[Support+]
[Docu]
[Tutorial]
[Bugs]
[forum ]
[wiki]
[Mirror]
[Authors]
[Future]
[License]
[Win98 Setup Bug]
[Subscribe]
Bug Report id=2001/10/19-v1.0b26-br05
Affected versions:v1.0b26 Solaris only
Severity:High

Bug Description

ScriptBasic built on Solaris crashes for any program.

Bug Reason, What Causes the Bug

The string table contains long values storing the length of the individual strings. These values are not aligned. The gcc compiler creates code accessing these variables that causes the Bus error on Solaris.

Solution

There are three locations where modification of code has to be applied.

In the file builder.c the line 275

lLen = * ((long *)(pBuild->StringTable + ulIndex));

has to be altered to
memcpy( &lLen, pBuild->StringTable + ulIndex , sizeof(long));

In the file execute.c the line 901

slen = *((long *)(s-sizeof(long)));

has to be altered to
memcpy(&slen, s-sizeof(long), sizeof(long));

In the file memory.c the definition of the structure struct _FixSizeMemoryObject has to be changed to

typedef struct _FixSizeMemoryObject {

  union _fsmoval{
    PBYTE pValue; // the value of the object
    long lValue;  // the long value of the object
    double dValue;// the double value of the object
    struct _FixSizeMemoryObject **aValue;
    } Value;
. . . rest of the definition is not altered

to name the union. Later in the code the line 1068

mypVar->Value = pVar->Value;

has to be altered to
memcpy(&(mypVar->Value),&(pVar->Value),sizeof(union _fsmoval));

Bug Workaround Until Solution is Available

There is no workaround, the patch has to be applied in order to successfully compile the program under Solaris.

Acknowledgement

N/A

This page was generated January 28, 2010 9:58:43