System crash
by Nabarro · in Torque 3D Professional · 06/30/2010 (6:12 am) · 1 replies
System sometimes crash, and it stops at below point by using MS VS 2005:
stringTable.cpp:
void _StringTable::resize(const U32 newSize)
{
Node *head = NULL, *walk, *temp;
U32 i;
// reverse individual bucket lists
// we do this because new strings are added at the end of bucket
// lists so that case sens strings are always after their
// corresponding case insens strings
for(i = 0; i < numBuckets; i++) {
walk = buckets[i];
while(walk)
{
temp = walk->next; (crash and stop here)
walk->next = head;
head = walk;
walk = temp;
}
}
...
It seems that temp's value is illigal: 0xffffffbe.
Also in this function:
buckets = (Node **) dRealloc(buckets, newSize * sizeof(Node));
Should it be:
buckets = (Node **) dRealloc(buckets, newSize * sizeof(Node *));
Anyone may help to look at this? Thanks,
stringTable.cpp:
void _StringTable::resize(const U32 newSize)
{
Node *head = NULL, *walk, *temp;
U32 i;
// reverse individual bucket lists
// we do this because new strings are added at the end of bucket
// lists so that case sens strings are always after their
// corresponding case insens strings
for(i = 0; i < numBuckets; i++) {
walk = buckets[i];
while(walk)
{
temp = walk->next; (crash and stop here)
walk->next = head;
head = walk;
walk = temp;
}
}
...
It seems that temp's value is illigal: 0xffffffbe.
Also in this function:
buckets = (Node **) dRealloc(buckets, newSize * sizeof(Node));
Should it be:
buckets = (Node **) dRealloc(buckets, newSize * sizeof(Node *));
Anyone may help to look at this? Thanks,
Torque Owner Tobias B.
mercatronics
More important is, that buckets were initialized in a correct manner via
or you write your own fast memfill function instead. ;-)
this should help you in your crash problem!
//Edit: changed code for realloc function!