OpenJK crashes when switching classes (SBD, deka)

Posts
142
Likes
59
UPDATED because I found the real reason.

How to reproduce:

1) Choose last skin with bounty hunter
2) Get to the screen where you can distribute the points.
3) Click on join again, and choose a class, which has fewer skins than bounty hunter
(SBD, deka, soldier) -> crash

Backtrace:
Code:
#0  0xf72831cb in __strcmp_ssse3 () from /usr/lib32/libc.so.6
#1  0x0805e297 in Cvar_Set2 (var_name=<optimized out>, value=0x97f2bd20 <error: Cannot access memory at address 0x97f2bd20>, defaultFlags=16384,
  force=qtrue) at ~/repos/OpenJK/codemp/qcommon/cvar.cpp:550
#2  0x0805eb3e in Cvar_VM_Set (var_name=0xd6facb73 "model", value=0x97f2bd20 <error: Cannot access memory at address 0x97f2bd20>, vmslot=VM_UI)
  at ~/repos/OpenJK/codemp/qcommon/cvar.cpp:743
#3  0x080bcedb in CL_UISystemCalls (args=0xffe18930) at ~/repos/OpenJK/codemp/client/cl_uiapi.cpp:538
#4  0x08077c80 in VM_DllSyscall (arg=3) at ~/repos/OpenJK/codemp/qcommon/vm.cpp:97
#5  0xd6f9b10c in trap_Cvar_Set () from ./MBII/uii386.so
#6  0xd6f7d308 in UI_FeederSelection () from ./MBII/uii386.so
#7  0xd6f83ad3 in UI_RunMenuScript () from ./MBII/uii386.so
#8  0xd6f8e9c2 in Item_RunScript () from ./MBII/uii386.so
#9  0xd6f91919 in Item_Action () from ./MBII/uii386.so
#10 0xd6f9a766 in Menu_HandleKey () from ./MBII/uii386.so
#11 0xd6f7f0aa in _UI_KeyEvent () from ./MBII/uii386.so
#12 0xd6f85ec4 in vmMain () from ./MBII/uii386.so
#13 0x08078130 in VM_Call (vm=0xb7c4e0c, callnum=3) at ~/repos/OpenJK/codemp/qcommon/vm.cpp:302
#14 0x080bd992 in UIVM_KeyEvent (key=141, down=qtrue) at ~/repos/OpenJK/codemp/client/cl_uiapi.cpp:67
#15 0x0805c7bb in Com_EventLoop () at  ~/repos/OpenJK/codemp/qcommon/common.cpp:904
#16 0x0805c9b5 in Com_Frame () at ~/repos/OpenJK/codemp/qcommon/common.cpp:1501
#17 0x0804c0fe in main (argc=4, argv=0xffe27704) at ~/repos/OpenJK/shared/sys/sys_main.cpp:743
 
Last edited:
Posts
37
Likes
8
Seems as though you are using linux. I sadly though can not fix this issue but just for the hell of it I can give you and the current programmer an idea of what may be happening. This appears to be a ui only bug in ui_main.c in feeder selection, thats basically the place where the models are sorted and picked to display on ui (more or else) the fact that all models you pick use the commonly shared BOTH_WALK1 animation (including droideka) but not the SBD was an invaluble clue to what may be the proplem. SBD uses a special animation SBD_WALK_GUN for animation display. So the bug propably happens when you pick SBD and set its SBD_WALK_GUN animation then you try to load droidekas it will try to load SBD_WALK_GUN, which doesnt exist for droidekas animation set. If you want to try a cheeseball way to fix this without having the source code, try this... go into MBAssets3 models->players->droideka->animation.cfg theres a line with
BOTH_WALK1 25 12 0 23 //without shield
make an additional line right below that
SBD_WALK_GUN 25 12 0 23 //without shield
that *may* fix it. Be careful not to overwrite BOTH_WALK1, thats super needed. By adding in an identifyer for the sbd's walk animation by having it set to the original walk animation frames may be a nice cheeseball fix. Test it out, let me know if it works for you. If it does, apply for dev team, commit changes, win! LOL
GL my friend
 
Posts
142
Likes
59
Way to reproduce:
1) get to an empty server (EU official was mine)
2) join as bounty hunter
3) after the window appears where you can use points
4) click on join and SBD(or deka) icon -> crash
 
Posts
37
Likes
8
Strange, doesnt seem to reproduce it for me. Of course I am running win7, this seems to be a linux only issue, and sadly no one gives a shit about linux LOL. I do though, but was my little fix any help? or do you not understand how to edit game files? If you dont thats cool, programming/modding is hard work. It could also be how models are parsed (read in) on linux that would cause an access violation. I am afaid you propably just wont be able to play Deka and SBD ever again. Those classes are broken anyways, the less we see of them the better LOL... If you want, I can supply the suspected fix for you if you dont know how todo it yourself.
 
Posts
142
Likes
59
I think I can replace files, but doesn't your solution solve something between deka and sbd? I don't have to do anything with deka to get the crash, so I don't see how editing deka config could help. And there is no animation.cfg for sbd.

and don't know which file to edit for the bounty hunter. Also it seems that after deka I can choose sbd without crash.

Another idea: maybe the important thing is to choose a skin in the first class, that is later than the last existing skin for sbd.

Yep, it also crashes after choosing the last skin for bounty hunter, than trying soldier

I think moving this to support means someone doesn't consider it to be a bug in mbii. I can see that UI_FeederSelection is called on FEEDER_Q3HEAD with the index of the older class skin(probably when handling the uiclass uiScript) which is out of bounds for the new class.
That index is probably used on an array, which leads to the crash. It may "only" read an invalid value sometimes because the memory it points to is reachable, but still it's a bug in mbii imo.

Please use "edit" function next time. //LoU
 
Last edited by a moderator:
Posts
142
Likes
59
This got pretty messy. To reiterate (aka bump):

When I switch a class the skin's index is carried over: if I chose the second skin for the old class, then when I choose the new class the second skin will be selected by default. The problem is when the new class doesn't have that many skins. Then comes the crash.

I can select the first skin and then change class and then skin again, but it's annoying. I would be happy if the index wasn't reused, and when a new class is chosen, the first skin would be selected by default.
 

Subaru

Not a car!
Donator
Movie Battles II Team Retired
Posts
216
Likes
173
At some point, I'll just have it remember the last skin you chose for a given class, and then use that (with bounds checking...).
 
Posts
1,013
Likes
572
I just straight up crash when I pick Drodika. I never crash as a SBD only for droidka.
No tricks or anything I just join a server and pick that class, and just crash after the spawn count down.
I am effectively locked out of playing the droidka class.

I never have this issue with any other class except droidka, and I only had this issue since the last update.
 
Last edited:

Supa

The Serial Stacker
Movie Battles II Team Retired
Posts
914
Likes
356
I can't replicate this with the build of OpenJK we've got in beta, so I'm assuming it was an issue with our out of date mbii.x86.exe.

EDIT: Question, are you running linux?
 
Last edited:
Posts
1,013
Likes
572
I can't replicate this with the build of OpenJK we've got in beta, so I'm assuming it was an issue with our out of date mbii.x86.exe.

EDIT: Question, are you running linux?
No, regular win 7.
I managed to fix it, I just selected MB2 client under the launcher and stopped using steam to play.
The game looks like shit, but it doesnt crash.
 
Posts
142
Likes
59
I just straight up crash when I pick Drodika. I never crash as a SBD only for droidka.
No tricks or anything I just join a server and pick that class, and just crash after the spawn count down.
I am effectively locked out of playing the droidka class.

I never have this issue with any other class except droidka, and I only had this issue since the last update.

The title is wrong. I later realized my bug has nothing to do with sbd or deka class (they have the fewest skins, that's why it happened for them). Your bug is a different thing.
 

Supa

The Serial Stacker
Movie Battles II Team Retired
Posts
914
Likes
356
No, regular win 7.
I managed to fix it, I just selected MB2 client under the launcher and stopped using steam to play.
The game looks like shit, but it doesnt crash.
That was a question for @Szunti. I noticed in his logs the linux binaries, so I thought he may be running on a Linux, in which I'll have to hunt down a team member or beta tester that has a capable linux install of the game to double-check this problem on the latest OpenJK MBII compiled build.
 
Posts
142
Likes
59
Archlinux, and I compiled openjk myself from GitHub - JACoders/OpenJK: Community effort to maintain and improve Jedi Academy + Jedi Outcast released by Raven Software. I can't use the mbii.i386 because its dependencies are too old (arch has only the latest versions in the repositories).

I don't want to use the mbii.i386 either, because last time I found the source on github (which I'm not even sure is the real one) it was way behind openjk and the changes were trivial (default values for cvars).
 

Supa

The Serial Stacker
Movie Battles II Team Retired
Posts
914
Likes
356
Alright, well unfortunately I wouldn't be able to duplicate it in any case. We'll be including a new MBII OpenJK compile with the next release, so hopefully that fixes whatever problem you're having with your own compile.
 

Spaghetti

Ghost
R2D2
Movie Battles II Team Retired
Posts
1,637
Likes
1,640
Archlinux, and I compiled openjk myself from GitHub - JACoders/OpenJK: Community effort to maintain and improve Jedi Academy + Jedi Outcast released by Raven Software. I can't use the mbii.i386 because its dependencies are too old (arch has only the latest versions in the repositories).
Well, given how Arch is on the bleeding edge, I'm not too surprised something is broken.

The current Linux version of the MBII OpenJK was compiled by @Cat Lady. If you want to have a go at it yourself for your own platform, the repository is publicly available here: GitHub - MBII/OpenJK: Community effort to maintain and improve Jedi Academy + Jedi Outcast released by Raven Software
 
Posts
142
Likes
59
What happens when you switch class? Which skin is selected by default?

Well, given how Arch is on the bleeding edge, I'm not too surprised something is broken.

The current Linux version of the MBII OpenJK was compiled by @Cat Lady. If you want to have a go at it yourself for your own platform, the repository is publicly available here: GitHub - MBII/OpenJK: Community effort to maintain and improve Jedi Academy + Jedi Outcast released by Raven Software
I guess you never used Arch. It uses the latest released stable version. People do the same on ubuntu with adding a bunch of unofficial repositories.

I am quite sure the bug is the missing bounds checking in mbii. Thanks for repo link.
 
Posts
142
Likes
59
This got pretty messy. To reiterate (aka bump):
When I switch a class the skin's index is carried over: if I chose the second skin for the old class, then when I choose the new class the second skin will be selected by default. The problem is when the new class doesn't have that many skins. Then comes the crash.
At some point, I'll just have it remember the last skin you chose for a given class, and then use that (with bounds checking...).
And an older post from me, with the function names from the backtrace:
I can see that UI_FeederSelection is called on FEEDER_Q3HEAD with the index of the older class skin(probably when handling the uiclass uiScript) which is out of bounds for the new class.
That index is probably used on an array, which leads to the crash. It may "only" read an invalid value sometimes because the memory it points to is reachable, but still it's a bug in mbii imo.

I don't know what else could I add.
 
Top