We suddenly encounter a failed assertion in RB2006R3(fc6):
Runtime Error 4: Failed Assertion
Location: runFileAccess.cpp:1079
Failed Condition: stream
Failure Message:
If we continue (do not quit) then we crash,
Thread 0 Crashed:
0 LaunchCFMApp 0xb8080c47 0xb8000000 + 527431
1 LaunchCFMApp 0xb807b116 0xb8000000 + 504086
2 LaunchCFMApp 0xb808f47a 0xb8000000 + 586874
3 LaunchCFMApp 0xb80e3f07 spin_lock_wrapper + 2511
Thread 1:
0 LaunchCFMApp 0xb81f326b strchr + 72
1 LaunchCFMApp 0xb818ebf6 pthread_cond_wait + 3114
2 LaunchCFMApp 0xb812ae90 catch_exception_raise_state_identity + 320
3 LaunchCFMApp 0xb812a3ba CallPPCFunctionAtAddressInt + 175496
4 LaunchCFMApp 0xb812a2b1 CallPPCFunctionAtAddressInt + 175231
5 LaunchCFMApp 0xb812af8e catch_exception_raise_state_identity + 574
6 LaunchCFMApp 0xb81c438c pthread_create + 1124
and could determine a possible cause. It relates to how we use
dynamic access when creating and handeling binary streams. An example:
void BinaryStream_Write(REALobject bStream, REALstring data)
{
static void (*_Write)(REALobject, REALstring) = nil;
if (!_Write)
_Write = (void(*)(REALobject, REALstring))REALLoadObjectMethod
(bStream, "Write(data as String)");
if (_Write)
_Write(bStream, data);
}
Note that we use static pointers, and that that leads to the above
failed assertion. We do the same thing to obtain function pointers
for the following RBRuntime folderItems:
_CreateBinaryFile = (REALobject(*)(REALfolderItem, REALstring))
REALLoadObjectMethod((REALobject)f,"CreateBinaryFile(type as
String) as BinaryStream");
_Close = (void(*)(REALobject))REALLoadObjectMethod(bStream, "Close()");
_FolderItemChild = (REALfolderItem(*)(REALfolderItem, REALstring))
REALLoadObjectMethod((REALobject)f,"Child(name as String) as
Folderitem");
_OpenAsBinaryFile = (REALobject(*)(REALfolderItem, Boolean))
REALLoadObjectMethod((REALobject)f,"OpenAsBinaryFile(write as
Boolean) as
BinaryStream");
_Write = (void(*)(REALobject, REALstring))REALLoadObjectMethod
(bStream, "Write(data as String)");
In addition we use folderItem.Directory and folderitem.Name:
REALGetPropValue((REALobject)fItem, "Directory", &isdirectory);
REALGetPropValue((REALobject)src, "Name", &name);
We use the new Plugin SDK, without defining FLAT_C_PLUGIN_HEADERS or
other macros (we do not believe that it relates to the plugin SDK,
but may need investigation). In the plugin we use above static
pointers repeatedly, but if we comment out the test whether the
static pointer was already created like:
void BinaryStream_Write(REALobject bStream, REALstring data)
{
static void (*_Write)(REALobject, REALstring) = nil;
// if (!_Write) <<------------------
_Write = (void(*)(REALobject, REALstring))REALLoadObjectMethod
(bStream, "Write(data as String)");
if (_Write)
_Write(bStream, data);
}
then we do not encounter the failed assertion. Note that we need to
disable all static pointers (see above) and therefore always obtain
new function pointers...
In my view, this is not correct..., or is it intentional?
Alfred
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>