Stride: Physics error "Pair not present" - TopDownRPG and Physics Sample

Created on 9 Aug 2018  路  7Comments  路  Source: stride3d/stride

TopDownRPG crashes at runtime after upgrading in GameStudio v3.0.0.3 Dev build
Also occurs with a new 3.0.0.3 dev build generated sample.

Physics Sample displays the same "Pair not present" error
when switching screens after "Shoot the cubes"

System
OS/device including version:
Windows 8.1 64bit, 8GB AMD FX 6350 6 core

Graphics Chipset
AMD Radeon HD 7700 Series
Memory Size 1024 MB
Radeon Software Version 17.4.4


VS 2017 Debugger


System.Exception
HResult=0x80131500
Message=Pair not present.
Source=Xenko.Physics
StackTrace:
at Xenko.Physics.Simulation.ContactRemoval(ContactPoint contact, PhysicsComponent component0, PhysicsComponent component1) in C:\Users\Greg\Documents\Xenko\sources\engine\Xenko.Physics\Simulation.cs:line 1077
at Xenko.Physics.Simulation.EndContactTesting() in C:\Users\Greg\Documents\Xenko\sources\engine\Xenko.Physics\Simulation.cs:line 1214
at Xenko.Physics.Bullet2PhysicsSystem.Update(GameTime gameTime) in C:\Users\Greg\Documents\Xenko\sources\engine\Xenko.Physics\Bullet2PhysicsSystem.cs:line 105
at Xenko.Games.GameSystemCollection.Update(GameTime gameTime) in C:\Users\Greg\Documents\Xenko\sources\engine\Xenko.Games\GameSystemCollection.cs:line 98
at Xenko.Games.GameBase.Update(GameTime gameTime) in C:\Users\Greg\Documents\Xenko\sources\engine\Xenko.Games\GameBase.cs:line 918
at Xenko.Games.GameBase.UpdateAndProfile(GameTime gameTime) in C:\Users\Greg\Documents\Xenko\sources\engine\Xenko.Games\GameBase.cs:line 926
at Xenko.Games.GameBase.TickInternal() in C:\Users\Greg\Documents\Xenko\sources\engine\Xenko.Games\GameBase.cs:line 677
at Xenko.Games.GameBase.Tick() in C:\Users\Greg\Documents\Xenko\sources\engine\Xenko.Games\GameBase.cs:line 510
at Xenko.Games.GamePlatform.Tick() in C:\Users\Greg\Documents\Xenko\sources\engine\Xenko.Games\GamePlatform.cs:line 173
at Xenko.Games.GamePlatform.OnRunCallback() in C:\Users\Greg\Documents\Xenko\sources\engine\Xenko.Games\GamePlatform.cs:line 143
at Xenko.Games.GameWindowWinforms.<>c__DisplayClass19_0.b__0() in C:\Users\Greg\Documents\Xenko\sources\engine\Xenko.Games\Desktop\GameWindow.Windows.Desktop.cs:line 196
at Xenko.Games.WindowsMessageLoop.Run(Control form, RenderCallback renderCallback, Boolean useApplicationDoEvents) in C:\Users\Greg\Documents\Xenko\sources\engine\Xenko.Games\Desktop\WindowsMessageLoop.cs:line 226
at Xenko.Games.GameWindowWinforms.Run() in C:\Users\Greg\Documents\Xenko\sources\engine\Xenko.Games\Desktop\GameWindow.Windows.Desktop.cs:line 188
at Xenko.Games.GamePlatform.Run(GameContext gameContext) in C:\Users\Greg\Documents\Xenko\sources\engine\Xenko.Games\GamePlatform.cs:line 120
at Xenko.Games.GameBase.Run(GameContext gameContext) in C:\Users\Greg\Documents\Xenko\sources\engine\Xenko.Games\GameBase.cs:line 462
at TopDownRPG2.TopDownRPG2App.Main(String[] args) in C:\Users\Greg\Documents\XenkoProjects\TopDownRPG2\TopDownRPG2\TopDownRPG2.Windows\TopDownRPG2App.cs:line 11

Call Stack


Xenko.Games.dll!Xenko.Games.GameBase.TickInternal() Line 677 C#
Xenko.Games.dll!Xenko.Games.GameBase.Tick() Line 510 C#
Xenko.Games.dll!Xenko.Games.GamePlatform.Tick() Line 173 C#
Xenko.Games.dll!Xenko.Games.GamePlatform.OnRunCallback() Line 143 C#
Xenko.Games.dll!Xenko.Games.GameWindowWinforms.Run.AnonymousMethod__0() Line 196 C#
Xenko.Games.dll!Xenko.Games.WindowsMessageLoop.Run(System.Windows.Forms.Control form, Xenko.Games.WindowsMessageLoop.RenderCallback renderCallback, bool useApplicationDoEvents) Line 226 C#
Xenko.Games.dll!Xenko.Games.GameWindowWinforms.Run() Line 188 C#
Xenko.Games.dll!Xenko.Games.GamePlatform.Run(Xenko.Games.GameContext gameContext) Line 120 C#
Xenko.Games.dll!Xenko.Games.GameBase.Run(Xenko.Games.GameContext gameContext) Line 462 C#
TopDownRPG2.Windows.exe!TopDownRPG2.TopDownRPG2App.Main(string[] args) Line 11 C#


Runtime Crash


at Xenko.Physics.Simulation.ContactRemoval(ContactPoint contact, PhysicsCompo
nent component0, PhysicsComponent component1) in C:\Users\Greg\Documents\Xenko\s
ources\engine\Xenko.Physics\Simulation.cs:line 1077
at Xenko.Physics.Simulation.EndContactTesting() in C:\Users\Greg\Documents\Xe
nko\sources\engine\Xenko.Physics\Simulation.cs:line 1214
at Xenko.Physics.Bullet2PhysicsSystem.Update(GameTime gameTime) in C:\Users\G
reg\Documents\Xenko\sources\engine\Xenko.Physics\Bullet2PhysicsSystem.cs:line 10
5
at Xenko.Games.GameSystemCollection.Update(GameTime gameTime) in C:\Users\Gre
g\Documents\Xenko\sources\engine\Xenko.Games\GameSystemCollection.cs:line 98
at Xenko.Games.GameBase.Update(GameTime gameTime) in C:\Users\Greg\Documents\
Xenko\sources\engine\Xenko.Games\GameBase.cs:line 918
at Xenko.Games.GameBase.UpdateAndProfile(GameTime gameTime) in C:\Users\Greg\
Documents\Xenko\sources\engine\Xenko.Games\GameBase.cs:line 926
at Xenko.Games.GameBase.TickInternal() in C:\Users\Greg\Documents\Xenko\sourc
es\engine\Xenko.Games\GameBase.cs:line 630
System.Exception: Pair not present.
at Xenko.Physics.Simulation.ContactRemoval(ContactPoint contact, PhysicsCompo
nent component0, PhysicsComponent component1) in C:\Users\Greg\Documents\Xenko\s
ources\engine\Xenko.Physics\Simulation.cs:line 1077
at Xenko.Physics.Simulation.EndContactTesting() in C:\Users\Greg\Documents\Xe
nko\sources\engine\Xenko.Physics\Simulation.cs:line 1214
at Xenko.Physics.Bullet2PhysicsSystem.Update(GameTime gameTime) in C:\Users\G
reg\Documents\Xenko\sources\engine\Xenko.Physics\Bullet2PhysicsSystem.cs:line 10
5
at Xenko.Games.GameSystemCollection.Update(GameTime gameTime) in C:\Users\Gre
g\Documents\Xenko\sources\engine\Xenko.Games\GameSystemCollection.cs:line 98
at Xenko.Games.GameBase.Update(GameTime gameTime) in C:\Users\Greg\Documents\
Xenko\sources\engine\Xenko.Games\GameBase.cs:line 918
at Xenko.Games.GameBase.UpdateAndProfile(GameTime gameTime) in C:\Users\Greg\
Documents\Xenko\sources\engine\Xenko.Games\GameBase.cs:line 926
at Xenko.Games.GameBase.TickInternal() in C:\Users\Greg\Documents\Xenko\sourc
es\engine\Xenko.Games\GameBase.cs:line 630

Unhandled Exception: System.Exception: Pair not present.
at Xenko.Physics.Simulation.ContactRemoval(ContactPoint contact, PhysicsCompo
nent component0, PhysicsComponent component1) in C:\Users\Greg\Documents\Xenko\s
ources\engine\Xenko.Physics\Simulation.cs:line 1077
at Xenko.Physics.Simulation.EndContactTesting() in C:\Users\Greg\Documents\Xe
nko\sources\engine\Xenko.Physics\Simulation.cs:line 1214
at Xenko.Physics.Bullet2PhysicsSystem.Update(GameTime gameTime) in C:\Users\G
reg\Documents\Xenko\sources\engine\Xenko.Physics\Bullet2PhysicsSystem.cs:line 10
5
at Xenko.Games.GameSystemCollection.Update(GameTime gameTime) in C:\Users\Gre
g\Documents\Xenko\sources\engine\Xenko.Games\GameSystemCollection.cs:line 98
at Xenko.Games.GameBase.Update(GameTime gameTime) in C:\Users\Greg\Documents\
Xenko\sources\engine\Xenko.Games\GameBase.cs:line 918
at Xenko.Games.GameBase.UpdateAndProfile(GameTime gameTime) in C:\Users\Greg\
Documents\Xenko\sources\engine\Xenko.Games\GameBase.cs:line 926
at Xenko.Games.GameBase.TickInternal() in C:\Users\Greg\Documents\Xenko\sourc
es\engine\Xenko.Games\GameBase.cs:line 677
at Xenko.Games.GameBase.Tick() in C:\Users\Greg\Documents\Xenko\sources\engin
e\Xenko.Games\GameBase.cs:line 510
at Xenko.Games.GamePlatform.Tick() in C:\Users\Greg\Documents\Xenko\sources\e
ngine\Xenko.Games\GamePlatform.cs:line 173
at Xenko.Games.GamePlatform.OnRunCallback() in C:\Users\Greg\Documents\Xenko\
sources\engine\Xenko.Games\GamePlatform.cs:line 143
at Xenko.Games.GameWindowWinforms.<>c__DisplayClass19_0.b__0() in C:\Use
rs\Greg\Documents\Xenko\sources\engine\Xenko.Games\Desktop\GameWindow.Windows.De
sktop.cs:line 196
at Xenko.Games.WindowsMessageLoop.Run(Control form, RenderCallback renderCall
back, Boolean useApplicationDoEvents) in C:\Users\Greg\Documents\Xenko\sources\e
ngine\Xenko.Games\Desktop\WindowsMessageLoop.cs:line 226
at Xenko.Games.GameWindowWinforms.Run() in C:\Users\Greg\Documents\Xenko\sour
ces\engine\Xenko.Games\Desktop\GameWindow.Windows.Desktop.cs:line 188
at Xenko.Games.GamePlatform.Run(GameContext gameContext) in C:\Users\Greg\Doc
uments\Xenko\sources\engine\Xenko.Games\GamePlatform.cs:line 120
at Xenko.Games.GameBase.Run(GameContext gameContext) in C:\Users\Greg\Documen
ts\Xenko\sources\engine\Xenko.Games\GameBase.cs:line 462
at TopDownRPG2.TopDownRPG2App.Main(String[] args) in C:\Users\Greg\Documents\
XenkoProjects\TopDownRPG2\TopDownRPG2\TopDownRPG2.Windows\TopDownRPG2App.cs:line
11

image

image

area-Physics bug help wanted

Most helpful comment

I stumbled on this issue too before 3.0 release and was quite surprised.

Please note that it's due to a check that happens only in debug mode (not sure if we didn't notice it in 2.x because mostly running physics samples against Xenko release, or if something changed since).

Since it seems to work OK in release build (ignored), I focused on other higher priority fixes as this one seems not trivial to fix. I guess it is now time to fix it.

All 7 comments

@Kryptos-FR Think we could take a look at this?
@xen2
This is a fairly serious issue rendering physics unusable and yet... not a label has been applied.
Bug? or Feature?

I stumbled on this issue too before 3.0 release and was quite surprised.

Please note that it's due to a check that happens only in debug mode (not sure if we didn't notice it in 2.x because mostly running physics samples against Xenko release, or if something changed since).

Since it seems to work OK in release build (ignored), I focused on other higher priority fixes as this one seems not trivial to fix. I guess it is now time to fix it.

@aurodev as a temporary workaround, please disable the debug exception

Thanks. Will do.

Keeping the issue open because we still need to fix the underlying issue.

It seems that CleanContacts() should use currentFrameContacts instead of previousFrameContacts.
That makes "Pair not present" no longer happen.

Thanks @EternalTamago !

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tebjan picture tebjan  路  4Comments

Domvel picture Domvel  路  4Comments

WhitePhoera picture WhitePhoera  路  3Comments

Qibbi picture Qibbi  路  4Comments

CharlesWoodhill picture CharlesWoodhill  路  3Comments