Pages: [1]
  Print  
Author Topic: Error: opstack corrupted in compiled code  (Read 17320 times)
Dihoruar
Nub


Cakes 2
Posts: 24


« on: December 15, 2011, 10:01:13 AM »

I've been experimenting with making a mod for oa. Everything works just fine as long as I build the code to .dll's.
But when I try to play the mod with the qvm's I build, After 5 seconds I get the error: "opstack corrupted in compiled code".
Does someone know what is causing this and how I can fix it?

Dihoruar
Logged
grey matter
Member


Cakes 8
Posts: 381

>9k


« Reply #1 on: December 15, 2011, 01:34:32 PM »

Which version of the engine are you using on which platform?
Logged

This space is for rent.
Dihoruar
Nub


Cakes 2
Posts: 24


« Reply #2 on: December 16, 2011, 05:58:10 AM »

Since I mentioned I tested the mod with the dll's I'm using windows (windows 7 to be more precise).
I'm using openarena 0.8.1 and the 1.29 gamesource from quake3.
Logged
Gig
In the year 3000
***

Cakes 45
Posts: 4394


WWW
« Reply #3 on: December 16, 2011, 06:28:02 AM »

Gamesource from Q3? Are you planning to create a mod for Quake3, and test it will work under OpenArena, too... or a mod expressly created for OpenArena (in that case, I suppose it would be good to start from current game logic -a recent DO NOT LINK[/b]) h t t p s : / / openarena . wikia . com/wiki/OAX]OAX version-, instead of from old 0.8.1 game logic)?

I'm sorry I don't know how to create a "real" mod, but maybe you can start from here:
(DO NOT LINK) h t t p s : / / openarena . wikia . com/wiki/Mod#External_links

Logged

I never want to be aggressive, offensive or ironic with my posts. If you find something offending in my posts, read them again searching for a different mood there. If you still see something bad with them, please ask me infos. I can be wrong at times, but I never want to upset anyone.
Dihoruar
Nub


Cakes 2
Posts: 24


« Reply #4 on: December 16, 2011, 06:36:25 AM »

I did used those links Smiley. And about using 0.8.5 instead... Well don't get me wrong but I like 0.8.1 more then 0.8.5. But again, that's just my opinion. But for the sake of good will I tried it too with 0.8.5 -> caused same error.
 
But I still don't get why the dll's are working without causing any problem/errors.  and the qvm's make it crash 5 second after beginning a match (like with /map oasago2).

Dihoruar
Logged
Gig
In the year 3000
***

Cakes 45
Posts: 4394


WWW
« Reply #5 on: December 16, 2011, 06:42:54 AM »

Do you wanna try post a console log? (With or without "developer 1" mode)

Have you tried using recent executables, like version 26?
Logged

I never want to be aggressive, offensive or ironic with my posts. If you find something offending in my posts, read them again searching for a different mood there. If you still see something bad with them, please ask me infos. I can be wrong at times, but I never want to upset anyone.
Dihoruar
Nub


Cakes 2
Posts: 24


« Reply #6 on: December 16, 2011, 06:50:43 AM »

Here you go Smiley,
console output with developer 1:
http://pastebin.com/r4LUvtfR

Dihoruar

EDIT: will try with the new executable too.
Logged
Gig
In the year 3000
***

Cakes 45
Posts: 4394


WWW
« Reply #7 on: December 16, 2011, 06:55:52 AM »

Uhm... that "openarena-0.8.1\test\uix86.dll: Kan opgegeven module niet vinden." should be something like "The specified module could not be found." in English.
I don't know what to think, I suppose you have to wait for answers from someone more technical than me. In the meanwhile, are you using sv_pure 0 or 1?
Logged

I never want to be aggressive, offensive or ironic with my posts. If you find something offending in my posts, read them again searching for a different mood there. If you still see something bad with them, please ask me infos. I can be wrong at times, but I never want to upset anyone.
Dihoruar
Nub


Cakes 2
Posts: 24


« Reply #8 on: December 16, 2011, 07:01:03 AM »

Ye indeed. It's dutch but translated into English it should indeed be The specified module could not be found..
I'm using pure 0 cause pure 1 makes the game unplayable. I get weird things like "no item to use" everytime I shoot, eventhought I haven't bind it like that. And the score is changing when I shoot or pickup a weapon/ammo.

Btw: batch file for starting the mod with dll's :
Quote
openarena.exe +set sv_pure 0 +set fs_game test +set vm_game 0 +set vm_cgame 0 +set vm_ui 0

And batch file for starting the mod with qvm's:
Quote
openarena.exe +set sv_pure 0 +set fs_game test2

(so I've got two separated folders, one for testing the dll's  and one for testing the qvm's)

Dihoruar
Logged
Gig
In the year 3000
***

Cakes 45
Posts: 4394


WWW
« Reply #9 on: December 16, 2011, 07:13:48 AM »

So, the log you posted above is about your .dll test folder, not your .qvm test folder, right? But again, are you trying to make a Q3 or OA mod?
Logged

I never want to be aggressive, offensive or ironic with my posts. If you find something offending in my posts, read them again searching for a different mood there. If you still see something bad with them, please ask me infos. I can be wrong at times, but I never want to upset anyone.
Dihoruar
Nub


Cakes 2
Posts: 24


« Reply #10 on: December 16, 2011, 07:19:37 AM »

Hm no sorry, I edited the batch file before posting it here, It was having another folder name. The test folder in the output is the qvm folder for 100% sure. And it has this startup script:

Quote
openarena.exe +set sv_pure 0 +set fs_game test

(So again I just typed test and test2 to make clear I used two different folders, in real they have other names. Sorry for the unclear explaination)

Dihoruar

EDIT: An OA mod
Logged
Gig
In the year 3000
***

Cakes 45
Posts: 4394


WWW
« Reply #11 on: December 16, 2011, 08:50:52 AM »

Sorry for my ignorance, by what and why are you using from Q3 1.29? Maybe the tutorials you found refer to q3 or ioq3 and should not be applied at the letter, but instead somehow adapted to fit OpenArena.

Anyway, I'm sorry but this it out of my knowledge... others will help you.
Logged

I never want to be aggressive, offensive or ironic with my posts. If you find something offending in my posts, read them again searching for a different mood there. If you still see something bad with them, please ask me infos. I can be wrong at times, but I never want to upset anyone.
grey matter
Member


Cakes 8
Posts: 381

>9k


« Reply #12 on: December 16, 2011, 09:17:15 AM »

ioquake3 did some security changes to the Quake 3 virtual machine (QVM) format. From the top of my hat, there *should be no problems with that, as long as you are *not using a qvm built for the new ioquake3 on an id Quake3 install. QVMs work quite different than shared libs Wink

If you don't mind, could you provide some details as to what you've actually changed for your mod? Does an unmodified QVM built from source work on your system?
Like Gig already mentioned, there's no need to use any sourcecode from id Quake 3, it might actually break things if you do and use it with OpenArena.

I don't know why you'd get the error you've posted, apart from having a corrupted qvm file on disk or in memory.

If you want to test your changes with sv_pure 1, you'll need to wrap the qvms inside a pk3. You should also consider removing all those maps and other 3rd party content from your developer installation of OpenArena.
Logged

This space is for rent.
Dihoruar
Nub


Cakes 2
Posts: 24


« Reply #13 on: December 16, 2011, 10:25:44 AM »

Quote
If you don't mind, could you provide some details as to what you've actually changed for your mod?
  • Added team classes -> defender, attacker, roamer, sniper with assigned weapons. (enabled/disabled by new cvar)
  • Added extra teaminfo under playername when look at you teammate (normally only name, now + health + armor, also enabled/disabled by a new cvar)
  • Added extra training option, giving bots only one weapon by a new cvar. Bot's also can't pick up any other weapons when this cvar is enabled. (For extra training against this weapon)
  • And added some cvar for setting spectator movement speed. Server admins can change this speed just like g_speed. Or they can lock the spectators.

Quote
Does an unmodified QVM built from source work on your system?
Need to work now, but I will test it this night.

Quote
Like Gig already mentioned, there's no need to use any sourcecode from id Quake 3, it might actually break things if you do and use it with OpenArena.
If Nothing else will work, I will use the oa source, But like you can imagine, I only do this when no one has another idea since searching up all code changes I made will take some time...  Tongue

Thanks for your help so far, I will give an update about the qvms from unmodified source later this night.

Dihoruar
Logged
grey matter
Member


Cakes 8
Posts: 381

>9k


« Reply #14 on: December 16, 2011, 02:55:34 PM »

I only do this when no one has another idea since searching up all code changes I made will take some time...  Tongue

You should really take a look at version control like git or subversion. That way you can easily create a .diff and also merge updates from other forks.

The poor man's method is to sandwhich his changes between comments like
Code:
/* mymod added */
new.stuff();
/* end mymod */

I think if you manage to add options to control these features via q3_ui, it might even find its way into OA Smiley
Logged

This space is for rent.
Gig
In the year 3000
***

Cakes 45
Posts: 4394


WWW
« Reply #15 on: December 16, 2011, 03:16:03 PM »

Using a "stock" OA installation (without third-party pk3s) sounds a nice suggestion. Of course, you can use a different installation folder and DO NOT LINK[/b]) h t t p s : / / openarena . wikia . com/wiki/Homepath#Can_I_change_the_directory_to_where_configuration_and_autodownloaded_files_are_saved.3F]a different homepath folder.

If you start from Quake 3 source code, maybe you could directly create a standard Quake3 mod instead of an OA mod... many mods designed for Q3 work with OA, too.
Logged

I never want to be aggressive, offensive or ironic with my posts. If you find something offending in my posts, read them again searching for a different mood there. If you still see something bad with them, please ask me infos. I can be wrong at times, but I never want to upset anyone.
Dihoruar
Nub


Cakes 2
Posts: 24


« Reply #16 on: December 17, 2011, 07:14:41 AM »

Using a "stock" OA installation (without third-party pk3s) sounds a nice suggestion. Of course, you can use a different installation folder and DO NOT LINK[/b]) h t t p s : / / openarena . wikia . com/wiki/Homepath#Can_I_change_the_directory_to_where_configuration_and_autodownloaded_files_are_saved.3F]a different homepath folder.
I tried it, gave me the same error

If you start from Quake 3 source code, maybe you could directly create a standard Quake3 mod instead of an OA mod... many mods designed for Q3 work with OA, too.
Mabye that's a good idea, I downloaded the ioquake3 engine + pak0 from quake 3 arena, I tried to play my mod in it, and again the same error. So we can conclude this has nothing to do with an incompatibility between my mod and OpenArena.

Btw: http://www.quakewiki.net/archives/code3arena/articles/article11.shtml#codingstylecrash
I searched for "fallthrough;" in every file. Nothing found, and afaik Is every case (from all switched I added) closed by a break.

Dihoruar
Logged
Gig
In the year 3000
***

Cakes 45
Posts: 4394


WWW
« Reply #17 on: December 17, 2011, 07:40:59 AM »

And running your mod without ioquake3, but with standard q3, instead?

And why starting from q3 1.29 instead of 1.32?
Logged

I never want to be aggressive, offensive or ironic with my posts. If you find something offending in my posts, read them again searching for a different mood there. If you still see something bad with them, please ask me infos. I can be wrong at times, but I never want to upset anyone.
Dihoruar
Nub


Cakes 2
Posts: 24


« Reply #18 on: December 17, 2011, 07:54:42 AM »

And running your mod without ioquake3, but with standard q3, instead?
Also gives the same error

And why starting from q3 1.29 instead of 1.32?
Hm good question, If I remember correctly the 1.32 was throwing some weird errors when I tried to build the code.
But still, do you think it has something to do with me using an older source version? Since the dll's are working perfectly..
What about if I try it with the 1.32 batch files for compiling the qvm's.. Guess that won't be possible, right?

Dihoruar
Logged
Gig
In the year 3000
***

Cakes 45
Posts: 4394


WWW
« Reply #19 on: December 17, 2011, 08:12:15 AM »

I don't know enough (or well, I don't know anything) about qvm compiling.

Maybe you may try to PM Sago007, asking him to read this thread.
Logged

I never want to be aggressive, offensive or ironic with my posts. If you find something offending in my posts, read them again searching for a different mood there. If you still see something bad with them, please ask me infos. I can be wrong at times, but I never want to upset anyone.
Dihoruar
Nub


Cakes 2
Posts: 24


« Reply #20 on: December 17, 2011, 08:26:21 AM »

Done,

btw maybe nice to know: It seems it only happens when I move. Like say I can keep shooting around while standing on my place, then nothing happens. But as soon as I move.. like after 2 steps I get this error.

Afaik I haven't changed a thing about the players movement, and I also haven't added code which is executed while moving..

Dihoruar
Logged
grey matter
Member


Cakes 8
Posts: 381

>9k


« Reply #21 on: December 17, 2011, 08:36:35 AM »

I never ever ran into that problem with the ioquake3 codebase. You should really be using either the ioquake3 code or the *latest 1.32c id Quake 3 code.
Did you try an umodified qvm yet? If it crashes as well, you know it's due to crappy code base Smiley

Like already said, QVMs are very different from shared libs (.dll, .so, .dylib) (it's a whole separate Virtual Machine inside Q3, no "easy" native code). Since the codebase also includes the compiler used to create qvms (q3lcc), the problem might very well be caused by using such an old version.
Logged

This space is for rent.
sago007
Posts a lot
*

Cakes 62
Posts: 1664


Open Arena Developer


WWW
« Reply #22 on: December 17, 2011, 01:35:42 PM »

Things that can cause problems that I can think of:

Undefined behaviour in C
This will cause the JIT compiler to make optimizations mistakes. Because the dlls are normally compiled with debug-information they would behave much differently.

Changing engine depending data structures
While must structures in the game, cgame and q3ui can be changed the engine makes some assumptions about a few.

I guess that the problem could also be a recursive function that cannot be tail-optimized. The virtual machine will overflow much faster than native programs.
Logged

There are nothing offending in my posts.
Pages: [1]
  Print  
 
Jump to: