UOX3 v0.99.3a Violated Me!

Found a bug in UOX3? Or experienced a server crash? Perhaps you've noticed a broken feature? Post the details here!
Post Reply
Mindless Automaton
UOX3 Apprentice
Posts: 189
Joined: Wed May 10, 2006 3:48 am
Has thanked: 0
Been thanked: 1 time
Contact:

UOX3 v0.99.3a Violated Me!

Post by Mindless Automaton »

I grabbed a copy of development branch last night, built debug with no issues, left server running, got this going on:

Code: Select all

Unhandled exception at 0x00000001402CA7AD in UOX3_debug.exe: 
0xC0000005: Access violation reading location 0x0000000025E00DAC. occurred
at this point (debugging in MS VStudio 2017?

Code: Select all

	constexpr bool _Subscript(size_t _Pos) const
		{	// subscript nonmutable sequence
		return ((_Array[_Pos / _Bitsperword]
			& ((_Ty)1 << _Pos % _Bitsperword)) != 0);
		}
i will leave it up if you would like any more info about that. Could be completely my fault, who knows. :)

Thanks!
Mindless Automaton
Linux - UOX3 - 0.99.5 dev branch
Win10Pro 19042.572 - UOX3 0.99.3a; Razor 1.0.14; Client 7.0.87.11 or 4.0.11c (Patch 0)
User avatar
Xuri
Site Admin
Posts: 3704
Joined: Mon Jun 02, 2003 9:11 am
Location: Norway
Has thanked: 48 times
Been thanked: 8 times
Contact:

Post by Xuri »

Any chance you could post the call stack that appears in a tab somewhere in the bottom half of Visual Studio when you encounter that error? That would let us see where exactly in UOX3's code things start to fall apart :P
-= Ho Eyo He Hum =-
Mindless Automaton
UOX3 Apprentice
Posts: 189
Joined: Wed May 10, 2006 3:48 am
Has thanked: 0
Been thanked: 1 time
Contact:

Post by Mindless Automaton »

Of course power went out or something caused the PC to reset. Anyways, I was able to start up and crash again. Here is

Code: Select all

UOX3_debug.exe!std::bitset<7>::_Subscript(unsigned __int64 _Pos) Line 92
	at c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.16.27023\include\bitset(92)
UOX3_debug.exe!std::bitset<7>::test(unsigned __int64 _Pos) Line 393
	at c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.16.27023\include\bitset(393)
UOX3_debug.exe!CBaseObject::isDeleted() Line 1603
	at c:\uox3 default\source\cbaseobject.cpp(1603)
UOX3_debug.exe!ValidateObject(const CBaseObject * toValidate) Line 195
	at c:\uox3 default\source\funcdecl.h(195)
UOX3_debug.exe!CWorldMain::CheckAutoTimers() Line 1465
	at c:\uox3 default\source\uox3.cpp(1465)
UOX3_debug.exe!main(int argc, char * * argv) Line 2787
	at c:\uox3 default\source\uox3.cpp(2787)
[External Code]
Also fyi, I am using the Community-made Spawn.dfn & Default UOX3 Worldfiles..
Mindless Automaton
Linux - UOX3 - 0.99.5 dev branch
Win10Pro 19042.572 - UOX3 0.99.3a; Razor 1.0.14; Client 7.0.87.11 or 4.0.11c (Patch 0)
User avatar
Xuri
Site Admin
Posts: 3704
Joined: Mon Jun 02, 2003 9:11 am
Location: Norway
Has thanked: 48 times
Been thanked: 8 times
Contact:

Post by Xuri »

Ahh... I've seen this one myself, but it only seems to happen when running the game in debug mode via Visual Studio. Something special way VS keeps references to objects that have been deleted... when running a release build, these references are NULL after objects are deleted, but in debug they have some other value which can break some of the logic. I dug into it a while back, but couldn't really make any headway in resolving it. :/

Thankfully it seems to be restricted to debug mode only (unless your experience says otherwise?)...
-= Ho Eyo He Hum =-
Mindless Automaton
UOX3 Apprentice
Posts: 189
Joined: Wed May 10, 2006 3:48 am
Has thanked: 0
Been thanked: 1 time
Contact:

Post by Mindless Automaton »

Thankfully it seems to be restricted to debug mode only (unless your experience says otherwise?)...
Yep, appears to be debug only. Release chugs along just fine.

Thanks!
Mindless Automaton
Linux - UOX3 - 0.99.5 dev branch
Win10Pro 19042.572 - UOX3 0.99.3a; Razor 1.0.14; Client 7.0.87.11 or 4.0.11c (Patch 0)
Mindless Automaton
UOX3 Apprentice
Posts: 189
Joined: Wed May 10, 2006 3:48 am
Has thanked: 0
Been thanked: 1 time
Contact:

Post by Mindless Automaton »

Ok, this is similar, but not with debug version:

Code: Select all

Unhandled exception thrown: read access violation.
this was 0x1E8EBCB61C0.

Code: Select all

bool CBaseObject::isDeleted( void ) const
{
	return objSettings.test( BIT_DELETED );
}

Code: Select all

	UOX3.exe!CBaseObject::isDeleted() Line 1602	C++
 	UOX3.exe!ValidateObject(const CBaseObject * toValidate) Line 195	C++
 	UOX3.exe!CWorldMain::CheckAutoTimers() Line 1465	C++
 	UOX3.exe!main(int argc, char * * argv) Line 2787	C++
 	[External Code]	
Mindless Automaton
Linux - UOX3 - 0.99.5 dev branch
Win10Pro 19042.572 - UOX3 0.99.3a; Razor 1.0.14; Client 7.0.87.11 or 4.0.11c (Patch 0)
User avatar
Xuri
Site Admin
Posts: 3704
Joined: Mon Jun 02, 2003 9:11 am
Location: Norway
Has thanked: 48 times
Been thanked: 8 times
Contact:

Post by Xuri »

That's still running it through Visual Studio, right?
-= Ho Eyo He Hum =-
Mindless Automaton
UOX3 Apprentice
Posts: 189
Joined: Wed May 10, 2006 3:48 am
Has thanked: 0
Been thanked: 1 time
Contact:

Post by Mindless Automaton »

Xuri wrote: Fri Oct 30, 2020 6:54 pm That's still running it through Visual Studio, right?
I start by running UOX3.exe.

When it crashes it asks me if I want to debug with VS2017 and then it opens it up in there.
Mindless Automaton
Linux - UOX3 - 0.99.5 dev branch
Win10Pro 19042.572 - UOX3 0.99.3a; Razor 1.0.14; Client 7.0.87.11 or 4.0.11c (Patch 0)
Mindless Automaton
UOX3 Apprentice
Posts: 189
Joined: Wed May 10, 2006 3:48 am
Has thanked: 0
Been thanked: 1 time
Contact:

Post by Mindless Automaton »

Mindless Automaton wrote: Sat Oct 31, 2020 6:16 am
Xuri wrote: Fri Oct 30, 2020 6:54 pm That's still running it through Visual Studio, right?
I start by running UOX3.exe.

When it crashes it asks me if I want to debug with VS2017 and then it opens it up in there.
Spoiler
BIT_DELETED 1 const unsigned int
- objSettings { size=7 } std::bitset<7>
[0] <Unable to read memory>
[1] <Unable to read memory>
[2] <Unable to read memory>
[3] <Unable to read memory>
[4] <Unable to read memory>
[5] <Unable to read memory>
[6] <Unable to read memory>
- [Raw View] {_Array=0x000002741c92a0a4 {???} } std::bitset<7>
- _Array 0x000002741c92a0a4 {???} unsigned long[1]
[0] <Unable to read memory>
- this 0x000002741c929ff0 {tags={ size=??? } title={...} mana=??? ...} CBaseObject *
__vfptr <Unable to read memory> void * *
- tags { size=??? } std::map<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,__TAGMAP_STRUCT__,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,__TAGMAP_STRUCT__> > >
- [comparator] less std::_Compressed_pair<std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::_Compressed_pair<std::allocator<std::_Tree_node<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,__TAGMAP_STRUCT__>,void *> >,std::_Tree_val<std::_Tree_simple_types<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,__TAGMAP_STRUCT__> > >,1>,1>
+ [Raw View] {_Myval2=allocator } std::_Compressed_pair<std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::_Compressed_pair<std::allocator<std::_Tree_node<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,__TAGMAP_STRUCT__>,void *> >,std::_Tree_val<std::_Tree_simple_types<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,__TAGMAP_STRUCT__> > >,1>,1>
- [allocator] allocator std::_Compressed_pair<std::allocator<std::_Tree_node<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,__TAGMAP_STRUCT__>,void *> >,std::_Tree_val<std::_Tree_simple_types<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,__TAGMAP_STRUCT__> > >,1>
+ [Raw View] {_Myval2={_Myhead=??? _Mysize=??? } } std::_Compressed_pair<std::allocator<std::_Tree_node<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,__TAGMAP_STRUCT__>,void *> >,std::_Tree_val<std::_Tree_simple_types<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,__TAGMAP_STRUCT__> > >,1>
- [Raw View] {...} std::map<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,__TAGMAP_STRUCT__,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,__TAGMAP_STRUCT__> > >
+ std::_Tree<std::_Tmap_traits<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,__TAGMAP_STRUCT__,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,__TAGMAP_STRUCT__> >,0> > {...} std::_Tree<std::_Tmap_traits<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,__TAGMAP_STRUCT__,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,__TAGMAP_STRUCT__> >,0> >
- title {...} std::basic_string<char,std::char_traits<char>,std::allocator<char> >
[size] <Unable to read memory>
[capacity] <Unable to read memory>
- [allocator] allocator std::_Compressed_pair<std::allocator<char>,std::_String_val<std::_Simple_types<char> >,1>
- [Raw View] {_Myval2={_Bx={_Buf=0x000002741c92a008 <Error reading characters of string.> _Ptr=??? _Alias=0x000002741c92a008 <Error reading characters of string.> } ...} } std::_Compressed_pair<std::allocator<char>,std::_String_val<std::_Simple_types<char> >,1>
std::allocator<char> {...} std::allocator<char>
+ _Myval2 {_Bx={_Buf=0x000002741c92a008 <Error reading characters of string.> _Ptr=??? _Alias=0x000002741c92a008 <Error reading characters of string.> } ...} std::_String_val<std::_Simple_types<char> >
[Dimensions] <Unable to read memory>
[] <Unable to display value>
- [Raw View] {...} std::basic_string<char,std::char_traits<char>,std::allocator<char> >
- std::_String_alloc<std::_String_base_types<char,std::allocator<char> > > {_Mypair=allocator } std::_String_alloc<std::_String_base_types<char,std::allocator<char> > >
- _Mypair allocator std::_Compressed_pair<std::allocator<char>,std::_String_val<std::_Simple_types<char> >,1>
+ [Raw View] {_Myval2={_Bx={_Buf=0x000002741c92a008 <Error reading characters of string.> _Ptr=??? _Alias=0x000002741c92a008 <Error reading characters of string.> } ...} } std::_Compressed_pair<std::allocator<char>,std::_String_val<std::_Simple_types<char> >,1>
mana <Unable to read memory>
stamina <Unable to read memory>
weight <Unable to read memory>
objType <Unable to read memory>
FilePosition <Unable to read memory>
x <Unable to read memory>
y <Unable to read memory>
z <Unable to read memory>
id <Unable to read memory>
colour <Unable to read memory>
dir <Unable to read memory>
serial <Unable to read memory>
multis <Unable to read memory>
spawnserial <Unable to read memory>
owner <Unable to read memory>
race <Unable to read memory>
+ name {...} UString
strength <Unable to read memory>
dexterity <Unable to read memory>
intelligence <Unable to read memory>
hitpoints <Unable to read memory>
st2 <Unable to read memory>
dx2 <Unable to read memory>
in2 <Unable to read memory>
visible <Unable to read memory>
hidamage <Unable to read memory>
lodamage <Unable to read memory>
scriptTrig <Unable to read memory>
carve <Unable to read memory>
worldNumber <Unable to read memory>
instanceID <Unable to read memory>
poisoned <Unable to read memory>
+ objSettings { size=7 } std::bitset<7>
+ resistances 0x000002741c92a0a8 {???, ???, ???, ???, ???, ???, ???, ???, ???, ???, ???} unsigned short[11]
oldLocX <Unable to read memory>
oldLocY <Unable to read memory>
oldLocZ <Unable to read memory>
oldTargLocX <Unable to read memory>
oldTargLocY <Unable to read memory>
fame <Unable to read memory>
karma <Unable to read memory>
kills <Unable to read memory>
64bit build.. i will try 32 bit.
Mindless Automaton
Linux - UOX3 - 0.99.5 dev branch
Win10Pro 19042.572 - UOX3 0.99.3a; Razor 1.0.14; Client 7.0.87.11 or 4.0.11c (Patch 0)
Mindless Automaton
UOX3 Apprentice
Posts: 189
Joined: Wed May 10, 2006 3:48 am
Has thanked: 0
Been thanked: 1 time
Contact:

Post by Mindless Automaton »

Mindless Automaton wrote: Sat Oct 31, 2020 4:32 pm 64bit build.. i will try 32 bit.
No issues with 32 bit crashing.

Just out of curiosity, is there a way to view what 'objects' are removed during garbage collection?
Mindless Automaton
Linux - UOX3 - 0.99.5 dev branch
Win10Pro 19042.572 - UOX3 0.99.3a; Razor 1.0.14; Client 7.0.87.11 or 4.0.11c (Patch 0)
User avatar
Xuri
Site Admin
Posts: 3704
Joined: Mon Jun 02, 2003 9:11 am
Location: Norway
Has thanked: 48 times
Been thanked: 8 times
Contact:

Post by Xuri »

How consistently are you seeing this crash with the 64-bit build?

To see what objects are removed during garbage collection, you could try setting a break-point in void CollectGarbage( void ) in uox3.cpp, and step through that function when the time comes for garbage collection :P
-= Ho Eyo He Hum =-
Post Reply