[Fixed] Custom wad crash

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Post Reply
User avatar
*Viper*
Posts: 88
Joined: Tue Jul 15, 2003 4:47 pm
Contact:

Custom wad crash

Post by *Viper* »

I have been working on an arena-type level for Doom2, where you can pick your monsters/weapons. I have the Heretic / Hexen monsters in there as well, if you have sprite wads for them. And also you can set up some walls if you want to.

Everything is fine for the first group of monsters you fight, but it crashes sometime after that. It could be a few battles later, but it will crash, and always with the same error:

Code: Select all

Code: ACCESS_VIOLATION
Tried to read address 00000004
Flags: 00000000
Address: 0040acc1

Windows NT 5.1 Build 2600 

GS=0000  FS=003b  ES=0023  DS=0023
EAX=00601f90  EBX=00000000  ECX=0000001f  EDX=00000000
ESI=0a7fe458  EDI=00000001
EBP=0a7fe4c0  EIP=0040acc1  ESP=0012fc64  CS=001b  SS=0023
EFlags=00010246
 CF- PF+ AF- ZF+ SF- TF- IF+ DF- OF- NT- RF+ VM- AC- VI- VP-

FPU State:
 ControlWord=027f StatusWord=0020 TagWord=ffff
 ErrorOffset=00425dc7
 ErrorSelector=011c001b
 DataOffset=0012fbc0
 DataSelector=ffff0023
 Cr0NpxState=00000000

MM0=00fefdfe00fefdfe
MM1=00fefdfe00fefdfe
MM2=80c49c0000000000
MM3=cb00000000000000
MM4=0000000000000000
MM5=0a7fe45800000001
MM6=0a7fe4c000601f90
MM7=000000230012fc64

Running threads:
00000d78 at 0040acc1*
00000680
00000cbc
00000890
0000077c
00000f98
00000ef0
000008cc
00000c74

Loaded modules:
00400000 - 0060ffff *zdoom.exe
77f50000 - 77ff5fff  ntdll.dll
77e60000 - 77f44fff  kernel32.dll
71950000 - 71a33fff  COMCTL32.dll
77c10000 - 77c62fff  msvcrt.dll
77c70000 - 77caffff  GDI32.dll
77d40000 - 77dc5fff  USER32.dll
77dd0000 - 77e5afff  ADVAPI32.dll
78000000 - 7806dfff  RPCRT4.dll
772d0000 - 77332fff  SHLWAPI.dll
71ad0000 - 71ad7fff  WSOCK32.dll
71ab0000 - 71ac4fff  WS2_32.dll
71aa0000 - 71aa7fff  WS2HELP.dll
76b40000 - 76b6bfff  WINMM.dll
10000000 - 10086fff  fmod.dll
77be0000 - 77bf3fff  MSACM32.dll
771b0000 - 772c9fff  ole32.dll
763b0000 - 763f4fff  comdlg32.dll
773d0000 - 77bc3fff  SHELL32.dll
5ad70000 - 5ada3fff  uxtheme.dll
76f50000 - 76f57fff  wtsapi32.dll
76360000 - 7636efff  WINSTA.dll
76f90000 - 76f9ffff  Secur32.dll
51080000 - 510d5fff  dsound.dll
77c00000 - 77c06fff  VERSION.dll
72d20000 - 72d28fff  wdmaud.drv
72d10000 - 72d17fff  msacm32.drv
77bd0000 - 77bd6fff  midimap.dll
5ef80000 - 5ef83fff  KsUser.dll
76fd0000 - 77047fff  CLBCATQ.DLL
77120000 - 771aafff  OLEAUT32.dll
77050000 - 77114fff  COMRes.dll
6ce10000 - 6ce44fff  dinput8.dll
688f0000 - 688f8fff  HID.DLL
76670000 - 76753fff  SETUPAPI.DLL
01660000 - 0167cfff  iair_usb.dll
72280000 - 722a7fff  DINPUT.dll
51000000 - 51046fff  ddraw.dll
73bc0000 - 73bc5fff  DCIMAN32.dll
0b390000 - 0b3b9fff  events.dll
0b4d0000 - 0b4d6fff  idle.dll

Bytes near EIP:
0040acb1: 8b 46 50 8b 88 a8 01 00 00 8b 14 8d 70 a0 5d 00
0040acc1: 8b 7a 04 83 ff 0c 7c 05 83 ff 0d 75 58 6a fc 6a
0040acd1: f2 8d 4e 28 56 8b c7 c6 46 12 01 e8 ef 4e 05 00

ZDoom version 2.0.47

Command line:
 E:\Doom\ZDoom\zdoom.exe -iwad E:\Doom\HDoom2.wad -file E:\Doom\Pwads\Arena5.wad -warp 01 -skill 4
IWAD: HDoom2.wad

Current map: MAP01

viewx = 167772160
viewy = 33554432
viewz = 16515072
viewangle = 2186998995

Possible call trace:
 0040acc1  BOOM
 00409e4e  call 004607a0
 00409e6b  call 0040ac10
 004f3ba6  call [eax+0xc]
 004f3ff4  call 004f3940
 004f517e  call 004f3d90
 004ee910  call 004ee870
 0047637d  call 004ee900
 0046d510  call 004f4030
 0046d5e5  call 0046d1f0
 00425bd7  call 0046d570
 00425a6e  call 0042a840
 00425a56

Stack Contents:
0012fc64: 00000001 0012fcc8 00000000 00000001  ················
0012fc74: 0000037f 799a7241 00409e4e 00409e6b  ···Ar·yN·@·k·@·
0012fc84: 00000001 00000009 004f3ba6 00000001  ·········;O·····
0012fc94: 00000000 42b40000 618d3d4b 004f3ff4  ·······BK=·a·?O·
0012fca4: 00000000 00000001 00000009 00000000  ················
0012fcb4: 00c7d178 0012fca8 0012fe14 00510acc  x·············Q·
0012fcc4: 00000000 0012fe20 004f517e 0000017e  ···· ···~QO·~···
0012fcd4: 0000026e 00000000 06306f35 00c88cd8  n·······5o0·····
0012fce4: 40ceba78 7ad1c793 2476bbd1 bed14123  x··@···z··v$#A··
0012fcf4: 7a99d2ec 7eef6621 d02ce559 6d6f6f44  ···z!f·~Y·,·Doom
0012fd04: 7475412e 616f6c6f 6b730064 00736e69  .Autoload·skins·
0012fd14: 5e91ed48 57bfa5c7 15e94d49 28263b9a  H··^···WIM···;&(
0012fd24: 1aab01a2 e9fa50fa 30bddc5c befafe11  ·····P··\··0····
0012fd34: f7c531b9 236149be 42c1b9ee bd473aea  ·1···Ia#···B·:G·
0012fd44: 89e4402e ac133305 27badb2f b29ff562  .@···3··/··'b···
0012fd54: e2e4fd79 46d40b7a 00548580 7994051f  y···z··F··T····y
0012fd64: 004ee910 00000002 0012fd78 0047637d  ··N·····x···}cG·
0012fd74: 00548580 005485b0 00000005 00000001  ··T···T·········
0012fd84: 00000a28 0000026e 00000094 00000005  (···n···········
0012fd94: 00000001 00000a28 00000002 771c0a00  ····(··········w
0012fda4: 772b4580 772b4578 771c0a3c 772b4580  ·E+wxE+w<··w·E+w
0012fdb4: 771c7c89 00000000 0012fdc8 0012fdcc  ·|·w············
0012fdc4: 00000000 00159178 77e777ef 771e218b  ····x····w·w·!·w
0012fdd4: 0015a178 0012fe1c 772b4308 771e211b  x········C+w·!·w
0012fde4: 772b4534 772b4510 0012fe10 0000017e  4E+w·E+w····~···
0012fdf4: 0000026e 0012fe6c 00000000 0000026e  n···l·······n···
0012fe04: 0000017e 00000000 799c391f 79daec0f  ~········9·y···y
0012fe14: 0012fe60 00510aef ffffffff 0012fe6c  `·····Q·····l···
0012fe24: 0046d510 ffffffff 77e79c90 7ffdf000  ··F········w···
0012fe34: 00000000 00000000 0000026e 0000017e  ········n···~···
0012fe44: 00000001 000f4240 ffffffff 00000276  ····@B······v···
0012fe54: 000001a0 77e60000 0012fe28 0012fe88  ·······w(·······
0012fe64: 00510af9 00000000 0012fe98 0046d5e5  ··Q···········F·
0012fe74: 77e79f93 00000000 7ffdf000 0012fe74  ···w·······t···
0012fe84: 0012f88c 0012ffb0 0042b8f0 005259e8  ··········B··YR·
0012fe94: 00000000 0012ffc0 00425bd7 00400000  ·········[B···@·
0012fea4: 00000000 00152370 00000003 00000094  ····p#··········
0012feb4: 00000005 00000001 00000a28 00000002  ········(·······
0012fec4: b1fa2c00 b1fa2c08 b1fa2c08 b1fa2c20  ·,···,···,·· ,··
0012fed4: 8052f4fb 00000001 00000013 e37ed000  ··R···········~·
0012fee4: e37ee000 e37ef000 e37f0000 e37f1000  ··~···~·······
0012fef4: e37f2000 e37f3000 e37f4000 e37f5000  · ··0··@··P·
0012ff04: e37f6000 e37f7000 8052f184 00000000  ·`··p···R·····
0012ff14: 00000000 e37ed000 ff0ed020 00000300  ······~· ·······
0012ff24: 0001de0c 00000001 0000000b 00000000  ················
0012ff34: 01000001 000027ed 8053e4a0 00425a6e  ·····'····S·nZB·
0012ff44: 0000036d 00000004 7ffdf000 0000000b  m··············
0012ff54: 81ff4000 00152370 00000044 00153860  ·@··p#··D···`8··
0012ff64: 00153810 001538c0 00000000 00000000  ·8···8··········
0012ff74: 00000000 00000000 00000000 00000000  ················
0012ff84: 00000000 00000001 00000003 00000000  ················
0012ff94: ffffffff ffffffff ffffffff 00000000  ················
0012ffa4: 00000000 0012feb0 b1fa2d10 0012ffe0  ·········-······
0012ffb4: 0042b8f0 00522cd0 00000000 0012fff0  ··B··,R·········
0012ffc4: 77e7eb69 0000036d 00000004 7ffdf000  i··wm··········
0012ffd4: 00000045 0012ffc8 b1fa2d0c ffffffff  E········-······
0012ffe4: 77e9bb86 77e95a18 00000000 00000000  ···w·Z·w········
0012fff4: 00000000 00425a56 00000000           ····VZB·····
I have the wad on my site, http://www.geocities.com/rndess1980 if anyone wants to look at it. (Since it is a free host, I'm not sure how much bandwidth I have to use, so the site may be suspended at some time)

I don't think it is anything I did, but you never know what simple thing you could miss :P

*Viper*
User avatar
Kate
... in rememberance ...
Posts: 2975
Joined: Tue Jul 15, 2003 8:06 pm

Post by Kate »

I got it to happen to me after defeating D'Sparil with an SSG and I was about to battle 6 maulotaurs with the same weapon(yes, I'm that brave(or stupid if you want to call it that))
User avatar
Xaser
 
 
Posts: 10772
Joined: Sun Jul 20, 2003 12:15 pm
Contact:

Post by Xaser »

Hmm... I don't quite know what's wrong, but if you need an example of an Arena where you can pick your enemies, download my Kill Stuff wad. I haven't really uploaded this one to a site, yet, but it can be found as an attachment in this post.

Maybe it's the Heretic/Hexen Monsters that are doing it, because my wad doesn't include those. Maybe you can compare your wad to mine?
Guest

Post by Guest »

Well, I have tried it without any of the heretic/hexen items or monsters spawning in, and I still get the crash.

I wonder if I am overshooting one of my array's bounds somewhere. I guess I will have to go over my scripts with a fine tooth comb tomorrow.
I got it to happen to me after defeating D'Sparil with an SSG and I was about to battle 6 maulotaurs with the same weapon(yes, I'm that brave(or stupid if you want to call it that))
I've done some interesting fights as well. My two favorite ones are about 10 Pain elementals (Lost Souls everywhere :P ... At least you get to work on your dodging skills :D ), or about 100-200 mixed Barons / Hell knights, only with a SSG.
User avatar
*Viper*
Posts: 88
Joined: Tue Jul 15, 2003 4:47 pm
Contact:

Post by *Viper* »

Well, I have tried it without any of the heretic/hexen ...
Hmmm... My turn to forget to log in when I post :lol:



Edit: Is there any way to log messages to a log file? I've tried print and printbold with logging on, but they didn't go into the logfile. Maybe with that I would be able to see if it is anything I did in my scripts that is causing it to crash.

Edit2: After a lot of testing, I've figured out that the crash was coming from the ClearInventory(); special. Once I removed that, the crashes stopped as well. I've uploaded a fixed version to my site in case anyone wants it.
User avatar
randi
Site Admin
Posts: 7746
Joined: Wed Jul 09, 2003 10:30 pm
Contact:

Post by randi »

Did you make sure to give the player a weapon when you used clearinventory? The game doesn't like it when the player has no weapons at all. (If you want a minimal weapon, a fist will do.)
User avatar
*Viper*
Posts: 88
Joined: Tue Jul 15, 2003 4:47 pm
Contact:

Post by *Viper* »

Yeah, the player had weapons.

The way it worked was this: You stepped into a teleporter which used the clearinventory special, then any weapons you had selected to use were given to you right after.

I have changed the code a lot since I posted this, but the code was something like this:

Code: Select all

 ClearInventory();

 for (i = 0; i < 30; i++) // 29 weapons = Doom, Heretic, & Hexen weapons
 {
  if (Weapons[i] == 1) // If the player selected to have that weapon
   GiveInventory(ReturnWeapon(i),1); // Return weapon is a function I wrote that
                                     // just returns the summoning string
                                     // based on the weapon number
 }
And when I tested it, I made sure I had some weapons selected.
User avatar
Xaser
 
 
Posts: 10772
Joined: Sun Jul 20, 2003 12:15 pm
Contact:

Post by Xaser »

*Viper* wrote:The way it worked was this: You stepped into a teleporter which used the clearinventory special, then any weapons you had selected to use were given to you right after.
Well, what if you don't pick any weapons?
User avatar
*Viper*
Posts: 88
Joined: Tue Jul 15, 2003 4:47 pm
Contact:

Post by *Viper* »

Clearinventory() crashes if I have weapons selected or not. Without using Clearinventory, I can remove all weapons and ammo and it doesn't crash. The only thing different, is that without using it, the last weapon you had up stays there.

I have attached a small test level. Just go to the squares on the floor and hit your use key. If you select one of the weapons or not, clearinventory will crash. The other one (not using clearinventory, but rather 4 or 5 takeinventorys) will work though.

I am using 47i, in case that matters.
User avatar
randi
Site Admin
Posts: 7746
Joined: Wed Jul 09, 2003 10:30 pm
Contact:

Post by randi »

Fixed for 2.0.48/2.1.0. It crashed because giveinventory wouldn't bring the new weapon up after using clearinventory.
User avatar
Xaser
 
 
Posts: 10772
Joined: Sun Jul 20, 2003 12:15 pm
Contact:

Post by Xaser »

randy wrote:Fixed for 2.0.48/2.1.0. It crashed because giveinventory wouldn't bring the new weapon up after using clearinventory.
Yipee! Arena5.wad will live on!

Viper, you should really upload that to /newstuff soon. That wad rules!
User avatar
*Viper*
Posts: 88
Joined: Tue Jul 15, 2003 4:47 pm
Contact:

Post by *Viper* »

Thanks Xaser.

I still have a few crashes with it yet, so I'd like to get them sorted out before I upload it. It crashes when using the Hexen mage-class boss.

Also... I have no idea how to go about uploading it to /newstuff. I've never released anything I've done. (because most of it sucked :lol:) Most of my stuff I've made is either full of effects, mazes, or a bunch of identical rooms with confusing teleports :twisted: ... nothing worth releasing.

I do have it updated on my site at the top of this thread.
User avatar
Xaser
 
 
Posts: 10772
Joined: Sun Jul 20, 2003 12:15 pm
Contact:

Post by Xaser »

Well, when you're done with it, if you'll email it to me, then I'll be happy to upload it for ya. :) Also, what's your problem with the Mage Boss, anyway? It seems to work fine for me.
User avatar
*Viper*
Posts: 88
Joined: Tue Jul 15, 2003 4:47 pm
Contact:

Post by *Viper* »

The Mage Boss crashes my game if I have a few of them at once (maybe more than 5). The first time they shoot at you, their projectiles go after each other instead of you. After a few of them die, it crashes.

Well, I don't have too much to do on it yet besides figure out that last crash. I think I just have to make a text file and add keyconf options for the heretic/hexen options. Thanks for the offer, I will e-mail it to you when it is finished.
User avatar
Xaser
 
 
Posts: 10772
Joined: Sun Jul 20, 2003 12:15 pm
Contact:

Post by Xaser »

Hmm, I tried what you said, with 5 or more mage bosses (I used 10, to be exact), and I got the crash. I guess it might have to do with the number of homing projectiles running around all over the place. Maybe the thing that determines the home gets confused and bombs out?
Post Reply

Return to “Closed Bugs [GZDoom]”