jk2mp.exe and jk2Ded.exe crash on startup

Discussions about modding, questions, mod requests or just show off what you're working on.
Post Reply
sithmartyr
Posts: 8
Joined: 21 Aug 2015, 00:31

jk2mp.exe and jk2Ded.exe crash on startup

Post by sithmartyr »

I am compiling the JK2 Source code from the jedis/jedioutcast repository.

I am using Microsoft Visual Studio Ultimate 2013.

jk2mp.exe and jk2Ded.exe crash upon loading QVM files compiled with older compilers.

The debug call stack appears as shown:
Image




The program itself looks like this when it has crashed:
Image

I have tried modifying the function (VM_CallCompiled) it seems to crash at, but with no luck.
Any suggestions on what to edit or where to look to modify the code to load these older QVMs?
User avatar
Tr!Force
Posts: 433
Joined: 26 Feb 2015, 12:25
Location: Chile
Contact:

Re: jk2mp.exe and jk2Ded.exe crash on startup

Post by Tr!Force »

what qvms are u trying to load?
u cant load 1.03/4 qvms on 1.02, or 1.02 qvms on 1.04
i mean:

[1.02]jk2mp/jk2ded = can load only[1.02]qvm's
------
[1.03]jk2mp/jk2ded = can load only [1.03 and 1.04]qvm's
[1.04]jk2mp/jk2ded = can load only [1.03 and 1.04]qvm's
Last edited by Tr!Force on 24 Jan 2016, 23:07, edited 1 time in total.
Image
"The dark side? I've been there. Do your worst." - Kyle Katarn
  • JK2 & JK3 Code-Mod Developer
  • Jedi Knight Plus Mod Project: Click Here
  • E-Mail: triforce@gznetwork.com
  • Discord: TriForce#8785
User avatar
Daggolin
Administrator
Posts: 794
Joined: 23 Feb 2015, 13:05

Re: jk2mp.exe and jk2Ded.exe crash on startup

Post by Daggolin »

What are your intentions?
Do you need a "clean" jk2 source or could you base your "mod" on jk2mv?
I am not exactly sure, but I think we had issues regarding qvms, too. As far as I remember ouned solved it by porting some of the ioquake3 qvm code.
sithmartyr
Posts: 8
Joined: 21 Aug 2015, 00:31

Re: jk2mp.exe and jk2Ded.exe crash on startup

Post by sithmartyr »

I am trying to load the 1.04 QVMs located in assets5.pk3.

My intentions are to create a clean and original source to start fresh from without compile errors and that runs with no problems.
User avatar
Tr!Force
Posts: 433
Joined: 26 Feb 2015, 12:25
Location: Chile
Contact:

Re: jk2mp.exe and jk2Ded.exe crash on startup

Post by Tr!Force »

u compiled the jkded in debug or release mode?
Image
"The dark side? I've been there. Do your worst." - Kyle Katarn
  • JK2 & JK3 Code-Mod Developer
  • Jedi Knight Plus Mod Project: Click Here
  • E-Mail: triforce@gznetwork.com
  • Discord: TriForce#8785
sithmartyr
Posts: 8
Joined: 21 Aug 2015, 00:31

Re: jk2mp.exe and jk2Ded.exe crash on startup

Post by sithmartyr »

Tr!Force wrote:u compiled the jkded in debug or release mode?
I've tried both. The one you see above where I listed the call stack was a Debug build. Neither release or debug run without crashing.
User avatar
Tr!Force
Posts: 433
Joined: 26 Feb 2015, 12:25
Location: Chile
Contact:

Re: jk2mp.exe and jk2Ded.exe crash on startup

Post by Tr!Force »

ouned already converted the 1.04 project to work with vs2013 u may try this: https://github.com/ouned/JK2-1.04
Image
"The dark side? I've been there. Do your worst." - Kyle Katarn
  • JK2 & JK3 Code-Mod Developer
  • Jedi Knight Plus Mod Project: Click Here
  • E-Mail: triforce@gznetwork.com
  • Discord: TriForce#8785
sithmartyr
Posts: 8
Joined: 21 Aug 2015, 00:31

Re: jk2mp.exe and jk2Ded.exe crash on startup

Post by sithmartyr »

I'll give it a shot on compiling that repository, hopefully I have better luck with that one. If not, I'll be extremely confused.....and I'll probably be back here.....
User avatar
Tr!Force
Posts: 433
Joined: 26 Feb 2015, 12:25
Location: Chile
Contact:

Re: jk2mp.exe and jk2Ded.exe crash on startup

Post by Tr!Force »

yeah, is weird... tell us if this one works
Image
"The dark side? I've been there. Do your worst." - Kyle Katarn
  • JK2 & JK3 Code-Mod Developer
  • Jedi Knight Plus Mod Project: Click Here
  • E-Mail: triforce@gznetwork.com
  • Discord: TriForce#8785
User avatar
Daggolin
Administrator
Posts: 794
Joined: 23 Feb 2015, 13:05

Re: jk2mp.exe and jk2Ded.exe crash on startup

Post by Daggolin »

Well, what do you want that "clean base" for? We tried not to make too "extreme" changes to jk2 in jk2mv and the main-focus of jk2mv is compatibility. So anything you want to do with the jk2 code should also be possible with the jk2mv code base, with additional fixes etc.

If your issues remain you could try looking into what jk2mv changed regarding qvm files and port the same changes to your codebase.
User avatar
fau
Staff
Posts: 433
Joined: 16 Aug 2015, 01:01
Location: Warsaw / Poland
Contact:

Re: jk2mp.exe and jk2Ded.exe crash on startup

Post by fau »

VM_CallCompiled
Don't even remind me of this crap…
Just use jk2mv - this is a clean base. Original jk2mp source is not. Or try vm_game 1 vm_cgame 1 vm_ui 1 if you must. Just don't waste your time writing patches for the original code.
sithmartyr
Posts: 8
Joined: 21 Aug 2015, 00:31

Re: jk2mp.exe and jk2Ded.exe crash on startup

Post by sithmartyr »

Daggolin wrote:Well, what do you want that "clean base" for? We tried not to make too "extreme" changes to jk2 in jk2mv and the main-focus of jk2mv is compatibility. So anything you want to do with the jk2 code should also be possible with the jk2mv code base, with additional fixes etc.

If your issues remain you could try looking into what jk2mv changed regarding qvm files and port the same changes to your codebase.
I definitely agree with you, jk2mv is impressive even as-is. I'd just prefer to start off somewhere with very minimal changes, I mainly just want the game to work when compiled so I can test out changes and fixes.
fau wrote:
VM_CallCompiled
Don't even remind me of this crap…
Just use jk2mv - this is a clean base. Original jk2mp source is not. Or try vm_game 1 vm_cgame 1 vm_ui 1 if you must. Just don't waste your time writing patches for the original code.
Yeah, it's been a pain in the ass. I'll test out those cvars with the compiled executable I created.

Also the repository you linked to works flawlessly when compiled, no issues at all.
User avatar
ouned
Administrator
Posts: 596
Joined: 23 Feb 2015, 13:03
Location: Gliese581c

Re: jk2mp.exe and jk2Ded.exe crash on startup

Post by ouned »

the problem is modern operating system security :P
the only changes you need are these:
https://github.com/ouned/JK2-1.04/blob/ ... .cpp#L1028

cant explain the problem now as I have to go in a minute, sorry.. lol

EDIT:
Basically JK2 is converting qvm virtual bytecode to native code (like a JIT compiler) to gain speed over the interpreter.
If it is an old compiler (VS till 2008 ??) it doesn't have the DEP bit field in the PE header set, so on execution windows knows that it can't enable DEP for this process. If you compile the same code on a new compiler which automatically sets the DEP bit field it gets activated on runtime and does what it is supposed to do: protecting data from being executed.
Yeah shitty explanation, here is more: https://en.wikipedia.org/wiki/Data_Execution_Prevention
You can also tell the compiler to not enable DEP but you shouldn't do that.
Post Reply
Created by Matti from StylesFactory.pl and Warlords of Draenor (modified by jk2.info)
Powered by phpBB® Forum Software © phpBB Limited
 

 

cron