Illegal instruction in kernel32.org?

Having trouble playing a game, post here

Illegal instruction in kernel32.org?

PostPosted by Carewolf » Mon Jan 31, 2011 11:57 am

I have had great success with running almost all recent games on my old Windows 2000 machine. The only one that hasn't worked so far has been a dotNet35 game.

That is until Two Worlds 2 that I am currently trying to trick to run. The OCW wrapper seems to solve all the link dependencies, but I then get a runtime crash, which according to the DrWatson log is caused by an illegal instruction, a form of MOVQ. I can not quite tell which x86 extension this precise form of MOVQ, but I suspect it an extension to MMX introduced with one of the later SSE extensions. My machine has two Athlon MP1800 processors (Palomino), which does not support SSE2 or above.
As far as I can tell the exception is triggered in a function called kernel32!processIdToSessionId, it doesn't appear to be one of the functions supported by the wrapper according to the readme, but I still find it more likely that this is implemented by the wrapper, and the wrapper has been written or compiled with SSE2(or above) support, generating instructions not suitable for my processor.
Can this be true? Or is something else confusing the system and making it use incorrect instruction-set extensions?
Carewolf
 
Posts: 3
Joined: Mon Jan 31, 2011 11:28 am

Re: Illegal instruction in kernel32.org?

PostPosted by OldBoy2k » Tue Feb 15, 2011 2:49 pm

Hi there,

welcome to win2kgaming forum and thanks for posting about this issue.The wrapper is programmed without SSE2 CPU requirement and in fact programmed to set "SSE2 present by default" so the reason why you can't get the game to work is simply because it requires SSE2 to run.

I replied about another SSE2 question regarding Eve Online here:
click: SSE2 + Eve Online

Maybe you can get Two Worlds 2 working with a non-SSE2 compiled compiled library similar to the unofficial SSE2 fix for Borderlands.

BR
OldBoy2k
OldBoy2k
 
Posts: 1351
Joined: Fri Feb 15, 2008 5:10 pm

Re: Illegal instruction in kernel32.org?

PostPosted by Carewolf » Thu Feb 17, 2011 2:28 pm

Thanks for the info. I am not familier with windows programming, but I suspected the kernel32! prefix for the function-name was a namespace indicator for the kernel32.dll, which leaves me a bit more confused than if it was in the game binary or supplied libraries.
Carewolf
 
Posts: 3
Joined: Mon Jan 31, 2011 11:28 am

Re: Illegal instruction in kernel32.org?

PostPosted by OldBoy2k » Thu Feb 17, 2011 7:17 pm

Some exceptions are reported as "error in kernel32!blabla-API",thats nothing unusual.In this case its sometimes necessary to also look at the other hooked game libraries which could have missing exports and lead to these first and second chance exceptions.

A SSE2 exception for example can easily be found if the profiling procedure in Dependency Walker ends with "Second chance exception 0xC000001D (Illegal Instruction) occurred in "blabla.EXE" at address 0x1234567 by thread 1."

BR
OldBoy2k
 
Posts: 1351
Joined: Fri Feb 15, 2008 5:10 pm

Re: Illegal instruction in kernel32.org?

PostPosted by Carewolf » Fri Feb 18, 2011 12:29 pm

You are right. When running it in dependency walker I get:
GetProcAddress(0x7B000000 [KERNEL32.DLL], "IsProcessorFeaturePresent") called from "TWOWORLDS2.EXE" at address 0x00B3B5D7 and returned 0x7B003820.
First chance exception 0xC000001D (Illegal Instruction) occurred in "TWOWORLDS2.EXE" at address 0x009FC60A.
Second chance exception 0xC000001D (Illegal Instruction) occurred in "TWOWORLDS2.EXE" at address 0x009FC60A.
Exited "TWOWORLDS2.EXE" (process 0x5AC) with code 128 (0x80).

So the exception seems to be in the program binary, but it does happen after an isprocessorfeaturePresent call. Did I understand you correctly that the wrapper deliberately reports SSE2 to trick some programs into running, when they check for SSE2? If it is compiled with the intel compiler, it migh be worth disabling that override, and hope they have a non-SSE2 fallback, which can have been automatically generated by the compiler. Is it possible to disable? (I couldn't find anything about it in the readme).
Carewolf
 
Posts: 3
Joined: Mon Jan 31, 2011 11:28 am

Re: Illegal instruction in kernel32.org?

PostPosted by OldBoy2k » Fri Feb 18, 2011 3:53 pm

Not that i'm aware of.You could either use KDW Kernel or try OCW Wrapper version 1.6/1.7.The SSE2 chip set extensions have been implemented in AMD CPUs from K8 socket upwards.Don't expect that there are still new games out there who take care of SSE1 compatibility.Either they got compiled to work with SSE1 or they use SSE2 extensions.

BR
OldBoy2k
OldBoy2k
 
Posts: 1351
Joined: Fri Feb 15, 2008 5:10 pm

Re: Illegal instruction in kernel32.org?

PostPosted by admin » Mon Feb 28, 2011 1:20 am

The latest kernel32 wrapper currently does a proper check for SSE2, some older versions just always said SSE2 was available. It may be a problem of them half implementing a non SSE2 code path or the check is for some other feature (maybe SSE3).

My book says that an sse2 movq instruction (to an xmm register) will execute incorrectly on a mmx capable (intel) processors but not throw an exception. I'm going to guess that AMD is catching the invalid opcode here. There really isn't anything that can be done short of contacting the authors (or patching the game which would be a big work).

-oldcigarette
admin
Site Admin
 
Posts: 2
Joined: Sun Feb 03, 2008 6:12 am


Return to Troubleshooting

Who is online

Users browsing this forum: No registered users and 0 guests

cron