Access Violation

Do you need help? Ask here!

Bug reporting belongs here: http://developer.wz2100.net/newticket
User avatar
lav_coyote25
Professional
Professional
Posts: 3434
Joined: 08 Aug 2006, 23:18

Access Violation

Post by lav_coyote25 »

bug ticket made - fixitfixitfixitfixit... :scream: :scream: :scream: :stressed: :stressed: :stressed: :stressed: :stressed: :stare: :stare: :stare: :stare: :3 :3 :3 xD xD xD xD

Code: Select all

-------------------

Error occured on Tuesday, July 7, 2009 at 21:55:48.

Program: C:\Warzone 2100 222trnkrc1final\warzone2100.exe(warzone2100)
Command line: "C:\Warzone 2100 222trnkrc1final\warzone2100.exe" "--fullscreen" "--resolution" "1280x1024" "--cheat" 
Version: Version 2.2.1
Distributor: wz2100.net
Compiled on: Jun 21 2009 11:34:24
Compiled by: GCC 4.2.1-sjlj (mingw32-2)
Executed on: Tue Jul 07 21:29:40 2009

Pointers: 32bit

Compiled against PhysicsFS version: 1.0.1
Running with PhysicsFS version: 1.0.1

Misc Data:
[09:29:43]OpenGL Vendor : NVIDIA Corporation
[09:29:43]OpenGL Renderer : GeForce 6600 GT/PCI/SSE2
[09:29:43]OpenGL Version : 2.1.2
[09:29:45]OpenAL Vendor: Creative Labs Inc.
[09:29:45]OpenAL Version: 1.1
[09:29:45]OpenAL Renderer: Software
[09:29:45]Using language: System locale
[09:30:12]Current Level/map is Sk-nextmissions-T1


C:\Warzone 2100 222trnkrc1final\warzone2100.exe caused an Access Violation at location 004933d3 in module C:\Warzone 2100 222trnkrc1final\warzone2100.exe Reading from location 06887ff8.


Registers:
eax=06887ff8 ebx=0686d0c8 ecx=04080101 edx=06887ff8 esi=00000680 edi=00000101
eip=004933d3 esp=0022f960 ebp=0022f9a8 iopl=0         nv up ei ng nz ac po cy
cs=001b  ss=0023  ds=0023  es=0023  fs=003b  gs=0000             efl=00210297

Call stack:
004933D3  C:\Warzone 2100 222trnkrc1final\warzone2100.exe:004933D3  world_coord  /home/admins/wz2.2/2.2.1/src/map.h:225
0049446A  C:\Warzone 2100 222trnkrc1final\warzone2100.exe:0049446A  moveUpdateDroid  /home/admins/wz2.2/2.2.1/src/move.c:3078
00438FC0  C:\Warzone 2100 222trnkrc1final\warzone2100.exe:00438FC0  droidUpdate  /home/admins/wz2.2/2.2.1/src/droid.c:847
0047F866  C:\Warzone 2100 222trnkrc1final\warzone2100.exe:0047F866  gameLoop  /home/admins/wz2.2/2.2.1/src/loop.c:299
00481C8C  C:\Warzone 2100 222trnkrc1final\warzone2100.exe:00481C8C  runGameLoop  /home/admins/wz2.2/2.2.1/src/main.c:649
005805AA  C:\Warzone 2100 222trnkrc1final\warzone2100.exe:005805AA
00580792  C:\Warzone 2100 222trnkrc1final\warzone2100.exe:00580792
00580249  C:\Warzone 2100 222trnkrc1final\warzone2100.exe:00580249
004010A7  C:\Warzone 2100 222trnkrc1final\warzone2100.exe:004010A7  __mingw_CRTStartup  /home/ron/devel/debian/mingw32-runtime/mingw32-runtime-3.13/build_dir/src/mingw-runtime-3.13-20070825-1/crt1.c:237
00401123  C:\Warzone 2100 222trnkrc1final\warzone2100.exe:00401123
User avatar
Zarel
Elite
Elite
Posts: 5770
Joined: 03 Jan 2008, 23:35
Location: Minnesota, USA

Re: Access Violation

Post by Zarel »

Code: Select all

004933D3  warzone2100.exe:004933D3  world_coord  /tags/2.2.1/src/map.h:225
0049446A  warzone2100.exe:0049446A  moveUpdateDroid  /tags/2.2.1/src/move.c:3078
Um... we're missing a few intermediate function calls...

moveUpdateDroid calls moveDroidTo which calls moveDroidToBase which calls world_coord a whole bunch of times, none of which look like a possible an access violation.
User avatar
lav_coyote25
Professional
Professional
Posts: 3434
Joined: 08 Aug 2006, 23:18

Re: Access Violation

Post by lav_coyote25 »

thats all that is in the report.... and there is nothing in the stderr.txt file :3 :3 :3 :3 :D
User avatar
lav_coyote25
Professional
Professional
Posts: 3434
Joined: 08 Aug 2006, 23:18

Re: Access Violation

Post by lav_coyote25 »

:mad; :mad; :stressed: :stressed: :scream: :scream: :stare: :stare: :3 :3 xD

Code: Select all

-------------------

Error occured on Wednesday, July 8, 2009 at 21:17:01.

Program: C:\Warzone 2100 222trnkrc1final\warzone2100.exe(warzone2100)
Command line: "C:\Warzone 2100 222trnkrc1final\warzone2100.exe" "--fullscreen" "--resolution" "1280x1024" "--cheat" 
Version: Version 2.2.1
Distributor: wz2100.net
Compiled on: Jun 21 2009 11:34:24
Compiled by: GCC 4.2.1-sjlj (mingw32-2)
Executed on: Wed Jul 08 20:39:17 2009

Pointers: 32bit

Compiled against PhysicsFS version: 1.0.1
Running with PhysicsFS version: 1.0.1

Misc Data:
[08:39:19]OpenGL Vendor : NVIDIA Corporation
[08:39:19]OpenGL Renderer : GeForce 6600 GT/PCI/SSE2
[08:39:19]OpenGL Version : 2.1.2
[08:39:21]OpenAL Vendor: Creative Labs Inc.
[08:39:21]OpenAL Version: 1.1
[08:39:21]OpenAL Renderer: Software
[08:39:21]Using language: System locale
[08:39:46]Current Level/map is Sk-nextmissions-T1
[08:40:16]Current Level/map is Sk-nextmissions-T1


C:\Warzone 2100 222trnkrc1final\warzone2100.exe caused an Access Violation at location 004933d3 in module C:\Warzone 2100 222trnkrc1final\warzone2100.exe Reading from location 0672aff8.


Registers:
eax=0672aff8 ebx=066ecc60 ecx=040801ea edx=0672aff8 esi=00000600 edi=00000101
eip=004933d3 esp=0022f960 ebp=0022f9a8 iopl=0         nv up ei ng nz ac po cy
cs=001b  ss=0023  ds=0023  es=0023  fs=003b  gs=0000             efl=00210297

Call stack:
004933D3  C:\Warzone 2100 222trnkrc1final\warzone2100.exe:004933D3  world_coord  /home/admins/wz2.2/2.2.1/src/map.h:225
0049446A  C:\Warzone 2100 222trnkrc1final\warzone2100.exe:0049446A  moveUpdateDroid  /home/admins/wz2.2/2.2.1/src/move.c:3078
00438FC0  C:\Warzone 2100 222trnkrc1final\warzone2100.exe:00438FC0  droidUpdate  /home/admins/wz2.2/2.2.1/src/droid.c:847
0047F866  C:\Warzone 2100 222trnkrc1final\warzone2100.exe:0047F866  gameLoop  /home/admins/wz2.2/2.2.1/src/loop.c:299
00481C8C  C:\Warzone 2100 222trnkrc1final\warzone2100.exe:00481C8C  runGameLoop  /home/admins/wz2.2/2.2.1/src/main.c:649
005805AA  C:\Warzone 2100 222trnkrc1final\warzone2100.exe:005805AA
00580792  C:\Warzone 2100 222trnkrc1final\warzone2100.exe:00580792
00580249  C:\Warzone 2100 222trnkrc1final\warzone2100.exe:00580249
004010A7  C:\Warzone 2100 222trnkrc1final\warzone2100.exe:004010A7  __mingw_CRTStartup  /home/ron/devel/debian/mingw32-runtime/mingw32-runtime-3.13/build_dir/src/mingw-runtime-3.13-20070825-1/crt1.c:237
00401123  C:\Warzone 2100 222trnkrc1final\warzone2100.exe:00401123
User avatar
lav_coyote25
Professional
Professional
Posts: 3434
Joined: 08 Aug 2006, 23:18

Re: Access Violation

Post by lav_coyote25 »

so --- when is it going to be looked at??? bump it to the front. xD
User avatar
Zarel
Elite
Elite
Posts: 5770
Joined: 03 Jan 2008, 23:35
Location: Minnesota, USA

Re: Access Violation

Post by Zarel »

Well, apparently a lot of people are getting this bug. I have no idea... I wish Buginator would come back. :(
cybersphinx
Inactive
Inactive
Posts: 1695
Joined: 01 Sep 2006, 19:17

Re: Access Violation

Post by cybersphinx »

What exactly is an "access violation" in Windows? I've looked at this and some other Windows crashdumps, and when I look at the code it supposedly crashed in, it looks like something completely harmless that shouldn't even be able to crash the game...
User avatar
lav_coyote25
Professional
Professional
Posts: 3434
Joined: 08 Aug 2006, 23:18

Re: Access Violation

Post by lav_coyote25 »

i have no idea what it is - the only error report that comes out is what i have put up here... no other. and there is no warning - just a complete out of game to the desktop - no ms error report eithe. :stare: i thought maybe it was due to one or more of the ai trying to build something on top of something elese... i have seen that happen more than once... other than that...dunno. O_o
User avatar
Zarel
Elite
Elite
Posts: 5770
Joined: 03 Jan 2008, 23:35
Location: Minnesota, USA

Re: Access Violation

Post by Zarel »

cybersphinx wrote:What exactly is an "access violation" in Windows? I've looked at this and some other Windows crashdumps, and when I look at the code it supposedly crashed in, it looks like something completely harmless that shouldn't even be able to crash the game...
access violation == segfault. It's what happens when you try dereference a pointer that points to an invalid memory address.

I'm completely lost by the code it crashed in, too. It doesn't even make sense:

004933D3 warzone2100.exe:004933D3 world_coord 2.2.1/src/map.h:225
0049446A warzone2100.exe:0049446A moveUpdateDroid 2.2.1/src/move.c:3078

move.c:3078 doesn't call world_coord at all, it calls moveDroidTo (which could plausibly be skipped with moveDroidToBase, but that's not an inline function; maybe it got inlined somehow? It's plausibly a bug in moveDroidToBase, do you see anything there?)
User avatar
lav_coyote25
Professional
Professional
Posts: 3434
Joined: 08 Aug 2006, 23:18

Re: Access Violation

Post by lav_coyote25 »

O_o code + lav_coyote25 = :stressed: :gonk: O_o :stare: :scream: :stressed: :3
cybersphinx
Inactive
Inactive
Posts: 1695
Joined: 01 Sep 2006, 19:17

Re: Access Violation

Post by cybersphinx »

Zarel wrote:access violation == segfault.
That's what I guessed, yes. I just wanted to make sure, because the indicated code in this (and a few other) crashdumps cannot segfault.
I'm completely lost by the code it crashed in, too. It doesn't even make sense:

004933D3 warzone2100.exe:004933D3 world_coord 2.2.1/src/map.h:225
0049446A warzone2100.exe:0049446A moveUpdateDroid 2.2.1/src/move.c:3078

move.c:3078 doesn't call world_coord at all, it calls moveDroidTo (which could plausibly be skipped with moveDroidToBase, but that's not an inline function; maybe it got inlined somehow? It's plausibly a bug in moveDroidToBase, do you see anything there?)
Well, moveUpdateDroid calls moveDroidTo which is basically an (unecessary?) alias for moveDroidToBase, which calls world_coord four times (src/move.c:385-388,396-399):

Code: Select all

fmx2 = psDroid->sMove.asPath[psDroid->sMove.numPoints -1].x;
fmy2 = psDroid->sMove.asPath[psDroid->sMove.numPoints -1].y;
fmx2 = world_coord(fmx2) + TILE_UNITS / 2;
fmy2 = world_coord(fmy2) + TILE_UNITS / 2;
fmx1 = psDroid->sMove.asPath[psDroid->sMove.numPoints -2].x;
fmy1 = psDroid->sMove.asPath[psDroid->sMove.numPoints -2].y;
fmx1 = world_coord(fmx1) + TILE_UNITS / 2;
fmy1 = world_coord(fmy1) + TILE_UNITS / 2;
Maybe the compiler optimized those as (example for the first and third line)

Code: Select all

fmx2 = world_coord(psDroid->sMove.asPath[psDroid->sMove.numPoints -1].x) + TILE_UNITS / 2;
and inlined world_coord, then we have

Code: Select all

fmx2 = (psDroid->sMove.asPath[psDroid->sMove.numPoints -1].x) << 7 + TILE_UNITS / 2;
If that theory is correct, the problem is that psDroid->sMove.asPath[psDroid->sMove.numPoints - 1] is invalid (though I have no idea how that could happen). If not, the debug info is complete garbage.
cybersphinx
Inactive
Inactive
Posts: 1695
Joined: 01 Sep 2006, 19:17

Re: Access Violation

Post by cybersphinx »

lav_coyote25 wrote:i have seen that happen more than once...
Do you happen to have a savegame that can reliably reproduce this bug?
User avatar
Buginator
Professional
Professional
Posts: 3285
Joined: 04 Nov 2007, 02:20

Re: Access Violation

Post by Buginator »

cybersphinx wrote: Maybe the compiler optimized those as (example for the first and third line)

Code: Select all

fmx2 = world_coord(psDroid->sMove.asPath[psDroid->sMove.numPoints -1].x) + TILE_UNITS / 2;
and inlined world_coord, then we have

Code: Select all

fmx2 = (psDroid->sMove.asPath[psDroid->sMove.numPoints -1].x) << 7 + TILE_UNITS / 2;
If that theory is correct, the problem is that psDroid->sMove.asPath[psDroid->sMove.numPoints - 1] is invalid (though I have no idea how that could happen). If not, the debug info is complete garbage.
psDroid->sMove.asPath[psDroid->sMove.numPoints is 0, since the droid can't build there, and when we -1 it... (or -2) then boom.

See http://developer.wz2100.net/changeset/7822
This will make it so it don't crash... but the real problem still needs to be fixed. (the droid shouldn't be going to that location to build, since it is a invalid location)
and it ends here.
User avatar
lav_coyote25
Professional
Professional
Posts: 3434
Joined: 08 Aug 2006, 23:18

Re: Access Violation

Post by lav_coyote25 »

yes i have a save game - made just moments prior to the exit... cant upload due to the lack of space. :(
User avatar
lav_coyote25
Professional
Professional
Posts: 3434
Joined: 08 Aug 2006, 23:18

Re: Access Violation

Post by lav_coyote25 »

here is a new one - says multiple calls to turn off...

Code: Select all

-------------------

Error occured on Monday, July 13, 2009 at 01:04:14.

Program: C:\Warzone 2100 222trnkrc1final\warzone2100.exe(warzone2100)
Command line: "C:\Warzone 2100 222trnkrc1final\warzone2100.exe" "--fullscreen" "--resolution" "1280x1024" "--cheat" 
Version: Version 2.2.1
Distributor: wz2100.net
Compiled on: Jun 21 2009 11:34:24
Compiled by: GCC 4.2.1-sjlj (mingw32-2)
Executed on: Sun Jul 12 22:05:25 2009

Pointers: 32bit

Compiled against PhysicsFS version: 1.0.1
Running with PhysicsFS version: 1.0.1

Misc Data:
[10:05:28]OpenGL Vendor : NVIDIA Corporation
[10:05:28]OpenGL Renderer : GeForce 6600 GT/PCI/SSE2
[10:05:28]OpenGL Version : 2.1.2
[10:05:29]OpenAL Vendor: Creative Labs Inc.
[10:05:29]OpenAL Version: 1.1
[10:05:29]OpenAL Renderer: Software
[10:05:29]Using language: System locale
[10:05:55]Current Level/map is Sk-psycho250-T1


C:\Warzone 2100 222trnkrc1final\warzone2100.exe caused an Access Violation at location 0044238c in module C:\Warzone 2100 222trnkrc1final\warzone2100.exe Reading from location 066bc180.

Log message: error   |10:56:54: [turnOffMultiMsg] multiple calls to turn off
Log message: last message repeated 2 times
Log message: last message repeated 2 times (total 4 repeats)
Log message: last message repeated 4 times (total 8 repeats)
Log message: last message repeated 8 times (total 16 repeats)
Log message: last message repeated 16 times (total 32 repeats)
Log message: last message repeated 32 times (total 64 repeats)
Log message: last message repeated 64 times (total 128 repeats)
Log message: last message repeated 128 times (total 256 repeats)

Registers:
eax=00023055 ebx=066bc174 ecx=000000bd edx=00006f54 esi=000000fa edi=000000bd
eip=0044238c esp=048bfde8 ebp=048bfe10 iopl=0         nv up ei ng nz ac pe cy
cs=001b  ss=0023  ds=0023  es=0023  fs=003b  gs=0000             efl=00010293

Call stack:
0044238C  C:\Warzone 2100 222trnkrc1final\warzone2100.exe:0044238C  TileIsOccupied  /home/admins/wz2.2/2.2.1/src/map.h:105
0040C6A3  C:\Warzone 2100 222trnkrc1final\warzone2100.exe:0040C6A3  fpathAStarRoute  /home/admins/wz2.2/2.2.1/src/astar.c:455
004426C4  C:\Warzone 2100 222trnkrc1final\warzone2100.exe:004426C4  fpathExecute  /home/admins/wz2.2/2.2.1/src/fpath.c:588
00580DFC  C:\Warzone 2100 222trnkrc1final\warzone2100.exe:00580DFC  SDL_GetThreadID
0058A449  C:\Warzone 2100 222trnkrc1final\warzone2100.exe:0058A449  SDL_ThreadID
77C3A3B0  C:\WINDOWS\system32\msvcrt.dll:77C3A3B0  _endthreadex
7C80B729  C:\WINDOWS\system32\kernel32.dll:7C80B729  GetModuleFileNameA