Quote: "My application would segfault and quit at ambiguous points in the code. This did not happen in the build where the appup stuff was excluded."
@Mnemonix, can you give further details about the crash?
I have a similar problem here.
When testing with the Intel SDK, everything seems to work fine.
Now that I have submitted the application, I can test with the Intel store and the Intel production GUID, and it does random silent crashes to desktop (CTDs).
This could be a real disaster if the applications are validated by Intel and make it into the store with a random crash bug.
Intel may not notice because applications must be running for a while to crash.
This is a little bit more harder to test, because a real GUID must be used, and the computer must be authorized.
To be able to test:
1- Submit an application and add your own email address to the 'beta testers' fields (last page of submission).
2- Register in the Intel Store with that email address. No need to give credit card information.
3- Enter the store and download your own application for testing.
4- Let it run for a while (5-6 minutes).
Here the application dissapears and the windows desktop is shown without any error messages, a silent crash.
Here comes an interesting part:
Since the 1st execution with the production GUID, your PC will be authorized to execute that software, even if the store is not running or there is no internet connection (at least that's what is happening here).
This allows to test the original code with the compiler (DBPro or VS 2008).
I have prepared a simple code that also crashes, but you must replace the debug GUID with your own real production GUID in these lines:
//Use your application GUID
int iGUID1 = 0x11111111;
int iGUID2 = 0x11111111;
int iGUID3 = 0x11111111;
int iGUID4 = 0x11111111;
This is the source code to test, I attach the project as well:
#include "windows.h"
#include "DarkGDK.h"
#include "tchar.h"
/*
DGDK is statically linked, and Intel SDK requires dynamic linking with Shared MFC (not good combo).
The solution is to use the APPUPDLL.DLL found in the last newsletter and load this at run-time,
performing the same calls as demonstrated in the APPUPEXAMPLE program:
*/
//This helps if an error raises and you need more info
//not strictly needed
void ErrorExit(LPTSTR lpszFunction) ;
//Exit routine
void terminate_execution(void);
void DarkGDK ( void )
{
//char mypassword[256];
int myuniquevalue = 0;
int XanswerX = 929; //Change 929 in this line for your code
bool g_bIsNETBOOKVersion = true;
if ( g_bIsNETBOOKVersion==true )
{
HINSTANCE AppUpHandle = LoadLibrary(_T("appupplugin.dll"));
if ( AppUpHandle )
{
typedef int (*pApproveAppType)(int,int,int,int,DWORD);
pApproveAppType pApproveApp = (pApproveAppType) GetProcAddress( AppUpHandle, "?ApproveApp@@YAHKKKKPAD@Z" );
if ( pApproveApp )
{
LPSTR pMyPassword = "anythingiwanthere"; // response is XanswerX
//Use your application GUID
int iGUID1 = 0x11111111;
int iGUID2 = 0x11111111;
int iGUID3 = 0x11111111;
int iGUID4 = 0x11111111;
//iGUID1 = iGUID2 = iGUID3 = iGUID4 = 0; // debug mode (use Atom Dev SDK client test BAT)
int iReturnValue = pApproveApp ( iGUID1, iGUID2, iGUID3, iGUID4, (DWORD)pMyPassword );
if ( iReturnValue!=XanswerX )
{
//CloseHandle ( AppUpHandle );
if (!FreeLibrary ( AppUpHandle )) ErrorExit(TEXT("ERROR CLOSING HANDLE"));
//return FALSE;
terminate_execution();
return;
}
myuniquevalue = iReturnValue;
}
// finished with appup DLL
//CloseHandle ( AppUpHandle );
if (!FreeLibrary ( AppUpHandle )) ErrorExit(TEXT("ERROR CLOSING HANDLE"));
}
else
{
MessageBox( NULL, _T("Failed to find appupplugin DLL"), _T("Error"), MB_OK );
//return FALSE;
terminate_execution();
return;
}
}
//Comment this line once you know the code
dbPrint ( dbStr(myuniquevalue) ) ; dbWaitKey();
if (myuniquevalue == XanswerX)
{
dbPrint ("application is approved!");
}
else
{
terminate_execution();
return;
}
//Your application
dbPrint ("your application goes here");
dbPrint ("press any key to continue");
dbWaitKey();
//...
dbSyncOn();
dbSyncRate(60);
dbMakeObjectCube (1, 100.0f);
while ( LoopGDK ( ) )
{
dbYRotateObject (1, dbObjectAngleY(1)+1);
dbSync();
}
return;
}
void terminate_execution()
{
dbPrint ("application not approved, now quitting...");
dbSleep (1000);
return;
}
//This helps if an error raises and you need more info
//not strictly needed
#include <strsafe.h>
void ErrorExit(LPTSTR lpszFunction)
{
// Retrieve the system error message for the last-error code
LPVOID lpMsgBuf;
LPVOID lpDisplayBuf;
DWORD dw = GetLastError();
FormatMessage(
FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,
dw,
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPTSTR) &lpMsgBuf,
0, NULL );
// Display the error message and exit the process
lpDisplayBuf = (LPVOID)LocalAlloc(LMEM_ZEROINIT,
(lstrlen((LPCTSTR)lpMsgBuf) + lstrlen((LPCTSTR)lpszFunction) + 40) * sizeof(TCHAR));
StringCchPrintf((LPTSTR)lpDisplayBuf,
LocalSize(lpDisplayBuf) / sizeof(TCHAR),
TEXT("%s failed with error %d: %s"),
lpszFunction, dw, lpMsgBuf);
MessageBox(NULL, (LPCTSTR)lpDisplayBuf, TEXT("Error"), MB_OK);
LocalFree(lpMsgBuf);
LocalFree(lpDisplayBuf);
ExitProcess(dw);
}
More details: The output window in VS2008 gives a long list of user errors when the .dll is called:
Quote: "First-chance exception at 0x7c812afb in Project.exe: Microsoft C++ exception: CL_EXCEPCION_FINAL_FUNCION at memory location 0x00116b4f.."
Anyone using VS2008 should be able to see that...
When the error happens, this is the message, only if executed from VS2008:
Quote: "Unhandled exception at 0x0b67a86a in Project.exe: 0xC0000005: Access violation reading location 0x0b67a86a."
The call stack is full with calls to 'ntdll.dll'.
As said, this takes like 4-5 minutes to happen.
If anyone submitting wants me to test his/her application, just add '
[email protected]' as beta tester when submitting. I'll give it a try as time allows me.
Pending to test if this CTD happens with DBPro as well, but anyone who already has submitted should be able to test the submission.
@Rick, Lee, talking about the TGC games and products in the store.
This could be a real problem... Could it be that the .dll has been produced with the
debug libraries instead of the release ones?
Please test, only 6 days left, and we could be needing some changes!