What's new

Crash with Nrage 2.3c

DETOMINE

New member
I'm am using PJ64 1.6.1 with the Nrage input plugin (last version).

Bug : crash at the start of a game

How to reproduce :
1) (controller plugged in) lauch PJ64, set up nrage, play
2) quit PJ64
3) unplug the controller
4) launch PJ64, play (crash)

Expected result : well, I don't know, nrage should maybe complain that the controller isn't plugged in, but it shouldn't crash right?

Feel free to ask anything that may help.
 

squall_leonhart

The Great Gunblade Wielder
update your VC runtime to 2010sp1?

...actually, make sure you're realy using 2.3c

the dll version should be 2.3.0.2
 
Last edited:
OP
D

DETOMINE

New member
I upgraded the x64 version (windows update doesn't upgrade it automatically as it seems...).
I still have the crash when the controller is not plugged in though.

Well, it's not very important, I will try to find something.

Can you tell me if by hazard, nrage make use of one of the following dlls :
-msvcp100.dll
-msvcp60d.dll
-msvcrtd.dll
-msvcr71.dll
-msvcp71.dll
-msvcp70.dll
-msvcr70.dll
?

I'm using the ones provided by Bighead and I am thinking they may not be up-to-date...

edit : deleted the dll files provided by Bighead to make sure I am using the latest. Still crash :s
 
Last edited:
OP
D

DETOMINE

New member
msvcp100.dll and msvcrtd.dll should not be placed in the pj64 folder
Got it

msvcr71.dll msvcp71.dll msvcp70.dll msvcr70.dll and mfc71.dll should be.
As far as I know I'm not using plugins that need it, so I deleted them too.

I followed this guide

Here is the mini dump (app. 30 Mo)
Here is the full dump (app. 300 Mo)

Thanks in advance!

edit : uploading the full dump right now, may take a while
 
Last edited:
OP
D

DETOMINE

New member
I don't know if it may help, but the sandbox feature of avast is of course disabled.

edit : disabling (totally) avast doesn't change anything (controller unplugged = crash)
Do you want a dump with avast disabled?

edit2 : do you need the full dump? My connection is slow and it may really take a while before I can share it :s
 
Last edited:

squall_leonhart

The Great Gunblade Wielder
the mini dump only said "The thread tried to read from or write to a virtual address for which it does not have appropriate access."

doesn't really help me much at all.

are you launching the emulator from a front end or directly from the pj64 shortcut?
could you try with the emulator set to windows 7 compatibility?
 
OP
D

DETOMINE

New member
I'm using directly the PJ64's short cut.
I'm using it without any compatibility settings.

I will try with winxp compatibility and with admin's right.
The full dump is still being uploaded

edit :
winxp compatibility : still crash with controller unplugged
with administrator's rights : still crash with controller unplugged
 
Last edited:

squall_leonhart

The Great Gunblade Wielder
fixed

Code:
    case CHK_MODIFIER:
        // Modifiers format: controlnum bOffset bAxisID bBtnType bModType fToggle fStatus dwSpecific
        if ( dwSection == CHK_MODIFIERS || pController )
        {
            int controlnum = 0;
            MODIFIER modWorking;

            ZeroMemory(&modWorking, sizeof(modWorking));

            unsigned int tOffset, tAxisID, tBtnType, tModType, tToggle, tStatus, tSpecific;

            if (sscanf(pszLine, "%u %x %u %u %u %u %u %x", &controlnum, &tOffset, &tAxisID,
                    &tBtnType, &tModType, &tToggle, &tStatus, &tSpecific) != 8)
                return false;

            // done to overcome issues with sscanf and "small" data blocks
            modWorking.btnButton.bOffset = tOffset;
            modWorking.btnButton.bAxisID = tAxisID;
            modWorking.btnButton.bBtnType = tBtnType;
            modWorking.bModType = tModType;
            modWorking.fToggle = tToggle;
            modWorking.fStatus = tStatus;
            modWorking.dwSpecific = tSpecific; // looks stupid, but unsigned int might not always be DWORD32
            
            // Now we need to assign parentdevice. If we have a valid gGUID, we'll use that...
            int found = FindDeviceinList(gGUID);
            if (found != -1)
                modWorking.btnButton.parentDevice = &g_devList[found];
            else
            {
                // ... otherwise, we do the following in order:
                //   1. If bBtnType is of type DT_MOUSEBUTTON or DT_MOUSEAXE, set gGUID to that of g_sysMouse (ignoring the given name and number)
                if ( modWorking.btnButton.bBtnType == DT_MOUSEBUTTON || modWorking.btnButton.bBtnType == DT_MOUSEAXE )
                {
                    modWorking.btnButton.parentDevice = &g_sysMouse;
                }
                //   2. If bBtnType is of type DT_KEYBUTTON, set gGUID to that of SysKeyboard
                else if ( modWorking.btnButton.bBtnType == DT_KEYBUTTON )
                {
                    gGUID = GUID_SysKeyboard;
                    int found = FindDeviceinList(gGUID);
                    if (found != -1)
                        modWorking.btnButton.parentDevice = &g_devList[found];
                    else
                        modWorking.btnButton.parentDevice = NULL;
                }
                //   3. otherwise, look up the name and number using FindDeviceinList, and set gGUID to that
                else
                {
                    found = FindDeviceinList(pszDeviceName, bDeviceNr, true);
                    if (found != -1)
                    {
                        gGUID = g_devList[found].guidInstance;
                        modWorking.btnButton.parentDevice = &g_devList[found];
                    }
                    else
                    {
                        gGUID = GUID_NULL;
                        modWorking.btnButton.parentDevice = NULL;
                    }
                }
            }

becomes

Code:
    case CHK_MODIFIER:
        // Modifiers format: controlnum bOffset bAxisID bBtnType bModType fToggle fStatus dwSpecific
        if ( dwSection == CHK_MODIFIERS || pController )
        {
            int controlnum = 0;
            MODIFIER modWorking;

            ZeroMemory(&modWorking, sizeof(modWorking));

            unsigned int tOffset, tAxisID, tBtnType, tModType, tToggle, tStatus, tSpecific;

            if (sscanf(pszLine, "%u %x %u %u %u %u %u %x", &controlnum, &tOffset, &tAxisID,
                    &tBtnType, &tModType, &tToggle, &tStatus, &tSpecific) != 8)
                return false;

            // done to overcome issues with sscanf and "small" data blocks
            modWorking.btnButton.bOffset = tOffset;
            modWorking.btnButton.bAxisID = tAxisID;
            modWorking.btnButton.bBtnType = tBtnType;
            modWorking.bModType = tModType;
            modWorking.fToggle = tToggle;
            modWorking.fStatus = tStatus;
            modWorking.dwSpecific = tSpecific; // looks stupid, but unsigned int might not always be DWORD32
            
            // Now we need to assign parentdevice. If we have a valid gGUID, we'll use that...
            int found = FindDeviceinList(gGUID);
            if (found != -1)
                modWorking.btnButton.parentDevice = &g_devList[found];
            else
            {
                // ... otherwise, we do the following in order:
                //   1. If bBtnType is of type DT_MOUSEBUTTON or DT_MOUSEAXE, set gGUID to that of g_sysMouse (ignoring the given name and number)
                if ( modWorking.btnButton.bBtnType == DT_MOUSEBUTTON || modWorking.btnButton.bBtnType == DT_MOUSEAXE )
                {
                    modWorking.btnButton.parentDevice = &g_sysMouse;
                }
                //   2. If bBtnType is of type DT_KEYBUTTON, set gGUID to that of SysKeyboard
                else if ( modWorking.btnButton.bBtnType == DT_KEYBUTTON )
                {
                    gGUID = GUID_SysKeyboard;
                    int found = FindDeviceinList(gGUID);
                    if (found != -1)
                        modWorking.btnButton.parentDevice = &g_devList[found];
                    else
                        modWorking.btnButton.parentDevice = NULL;
                }
                //   3. otherwise, look up the name and number using FindDeviceinList, and set gGUID to that
                else
                {
                    found = FindDeviceinList(pszDeviceName, bDeviceNr, true);
                    if (found != -1)
                    {
                        gGUID = g_devList[found].guidInstance;
                        modWorking.btnButton.parentDevice = &g_devList[found];
                    }
                    else
                    {
                        DebugWrite(_T("ProcessKey: couldn't find a device in g_devList for %s %d\n"), pszDeviceName, bDeviceNr);
                        gGUID = GUID_NULL;
                        modWorking.btnButton.parentDevice = NULL;
                    return false;
                    }
                }
            }
 
Last edited:
OP
D

DETOMINE

New member
I'm glad we are finally able to reproduce the bug.

Just for my information, did the full dump help compared to the minimal one?
So it's tied up with the macros, I should have tried that (with/without memory pack and with/without macros). :s

edit : Should we expect a 2.3d version soon?
 
OP
D

DETOMINE

New member
Thanks a lot, it works fine :D.

Shouldn't you call it 2.3d?
It may be misleading if we have two 2.3c version, don't you think?
 

Top