Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Mon Oct 16, 2017 5:04 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Plugins crash on some Vista machines in try...catch
PostPosted: Wed Mar 12, 2008 1:59 pm 
Offline

Joined: Wed May 10, 2006 5:16 pm
Posts: 19
Location: Lawrenceville, NJ
I need to find a resolution to this issue which I believe involves the initialization of the C-Runtime library used by the plugin. This means that it is tied into whatever mechanism REALbasic uses to load and initialize the plugin code on Windows.

I have a product that is running without issue on thousands of XP and Vista machines. On a handful of Vista machines I am experiencing a crash in my plugin code. By crash I mean that Vista says "xyz has stopped working" and the crash details indicate "access violation".

I cannot reproduce this on any of my own machines so debugging has required sending test versions with increasing amounts of logging code to cooperative users who have this issue. Based on the conclusions from this painful debugging process I wrote a simple plugin which duplicates the crash.

The crash happens the first time the plugin execution reaches a throw statement or the closing brace of a try block.

This indicates an issue with the C-Runtime Library support. Either it is not being initialized correctly or some conflicting combination of Runtime library versions are being encountered.

In the shipping product the plugins are built using Visual Studio 6 and the application is built with REALbasic 2007r4.

Below, I list the test plugin that illustrates this issue. The test application calls the plugin as: val = TryCatch(5)

When this is run on a machine that exhibits the issue, Vista reports that the program "has stopped working" and the log file contains these lines:
>>>> TryCatch
**** TryCatch 1

And that is it. This matches the failure point that I tracked down in the real plugin (crashes the first time a throw statement is encountered.)

I have placed a zip archive of the full project here:
http://homepage.mac.com/danamac32/.Publ ... Sample.zip

This contains the VS6 project for building the plugin and also the RB project that uses the plugin. A built application is also included - try it on your Vista machine and tell me if it "stops working" or not.

//-------------------
void
LogWrite( char* str )
{
FILE *logFILE;

logFILE = fopen( "TestApp.log", "a" );
if( logFILE ) fprintf( logFILE, "%s\n", str );
if( logFILE ) fclose( logFILE );
}

//-------------------
int TryCatch(int v)
{
LogWrite( ">>>> TryCatch" );

try
{
LogWrite( "**** TryCatch 1" );

if( v ) throw(0);
LogWrite( "**** TryCatch 2" );
}

catch(...)
{
LogWrite( "**** TryCatch 3" );
}

LogWrite( "<<<< TryCatch" );

return v + 5;
}


Top
 Profile  
Reply with quote  
 Post subject: Re: Plugins crash on some Vista machines in try...catch
PostPosted: Tue Mar 25, 2008 2:18 am 
Offline

Joined: Sat Oct 01, 2005 5:13 am
Posts: 603
Location: Shanghai, China
Sound like call throw(0); causes that issue.

_________________
ToringoCrypto Plugin - RSA (128 to 1024), DES/3DES/TDEA, etc.
ToringoDRMInfo Plugin - Uniquely identify computers via hardware information.
【My Company: Are you looking for someone to help you work on your projects?


Top
 Profile  
Reply with quote  
 Post subject: Re: Plugins crash on some Vista machines in try...catch
PostPosted: Tue Mar 25, 2008 8:22 pm 
Offline
Real Software Engineer

Joined: Sat Dec 24, 2005 8:18 pm
Posts: 7858
Location: Canada, Alberta, Near Red Deer
You're using C++ exceptions ?
Almost 100% the initialization of the C++ runtime is not done when the plugin is loaded UNLESS you do it (manually or otherwise)

_________________
Norman Palardy (Real Software)


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group