Monday, 24.07.2017, 07:41
Приветствую Вас Гость
Register | Login | RSS
Jedi Academy Server Security
[ New messages · Users · Forum rules · Search · RSS ]
Page 1 of 11
Forum » JASS » English forum » Unexpected crash when calling a function from a pointer (It is intriguing.)
Unexpected crash when calling a function from a pointer
StarfallDate: Thursday, 27.06.2013, 10:16 | Message # 1
Group: User
Messages: 1
Reputation: 0
Status: Offline
Now, I use a plugin intended for a specific mod dll in order to have more freedom, and I declare functions inside the mod as function pointers in order to save code and memory or simply because it is otherwise near-impossible. This is one such declaration:

Code
void (*Info_SetValueForKey)( char *s, const char *key, const char *value ) = (void(*)(char*, const char*, const char*)) SETVALUEFORKEY;
(In this particular example, this is not necessary, but it is just an example anyway.)
This declaration of the pointer normally works completely fine, I can call the function whenever I want and it does not cause memory corruption or crashes. Just for the record, I tried it on at least five different servers, including servers with Windows Server 2008, Windows 7, Windows Server 2003 and dedicated servers like those from AoWC or MamoothGames.

However, yesterday when I tried to install it regularly on some other VPS, it caused an access violation crash when I called that function above. The location for the access violation was the SETVALUEFORKEY offset. I have matching versions for the mod and the plugin, and I know the address is correct. Here are some of the things I tried to fix the issue: (Note: This happens with every function/variable pointer declared in the same fashion.)

* Install Visual C++ 2010 runtimes.
* Use Visual C++ 2008 to compile the plugin. (I normally use 2010)
* Compilation in debug mode.
* Compilation without dependencies. (Like msvcr100.dll)
* Deleting the mod folder and using my folder that works fine on my homehost.
* Clearing GameData contents and replacing them with my homehost files.
* Using different engines. (jamp, jampDed, OpenJK)
* Running the engines in administrator mode.
* Running the engines in various compability modes.

None of those attempts to fix the issue worked, and it makes me think that something is wrong with the VPS itself, but I can't figure out what.
Any ideas? I really need help with this one.

Added (27.06.2013, 10:16)
---------------------------------------------
I figured out that the VPS I have been trying to install it on is x64. It might be affecting something, but I am not sure what; because the plugin can load, meaning that the operating system can recognize the file.

 
WEAPON_XDate: Saturday, 10.08.2013, 08:49 | Message # 2
Group: User
Messages: 12
Reputation: 0
Status: Offline
i don't know if that would be a problem, because the target game itself doesn't run in x64 mode.

maybe it has something to do with admin privileges, although i see you tried that already.

If you can install the actual visual studio express or w/e and debug on vps it would be great.
 
Forum » JASS » English forum » Unexpected crash when calling a function from a pointer (It is intriguing.)
Page 1 of 11
Search: