Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segfault when clicking mouse buttons randomly, etc #559

Open
veksha opened this issue Oct 5, 2018 · 1 comment
Open

Segfault when clicking mouse buttons randomly, etc #559

veksha opened this issue Oct 5, 2018 · 1 comment

Comments

@veksha
Copy link

veksha commented Oct 5, 2018

started tr1 game, level 0. was all fine. was running around for a long time.
then I started to press mouse buttons randomly (we can see Test_SecondaryMouseDown in a back trace below)
and jumping around at the same time (space/ctrl/shift/x, etc) . so I recieved segfault.

Thread 1 "OpenTomb" received signal
SIGSEGV
source /home/yura/git/OpenTomb/src/room.cpp:384:10187:beg:0x5555556ad474

Line:
int x = (int)(pos[0] - room->transform[12 + 0]) / TR_METERING_SECTORSIZE;
-------------------^^^
error here.
When I jumped up one frame on the call stack (physics_bullet.cpp:84) I noticed
that m_cont->sector was null.
So argument m_cont->sector->pos can have garbage address. am I wrong?

back trace:

#0  0x00005555556ad474 in Room_GetSectorRaw (room=0x55555711b2c0, pos=0x4c) at /home/yura/git/OpenTomb/src/room.cpp:384
#1  0x0000555555617ceb in bt_engine_ClosestRayResultCallback::addSingleResult (this=0x7fffffffe530, rayResult=..., normalInWorldSpace=true) at /home/yura/git/OpenTomb/src/physics/physics_bullet.cpp:84
#2  0x00005555556c7010 in btCollisionWorld::BridgeTriangleRaycastCallback::reportHit (this=0x7fffffffdf90, hitNormalLocal=..., hitFraction=0.126754627, partId=0, triangleIndex=7) at /home/yura/git/OpenTomb/extern/bullet/BulletCollision/CollisionDispatch/btCollisionWorld.cpp:373
#3  0x00005555556ef8d7 in btTriangleRaycastCallback::processTriangle (this=0x7fffffffdf90, triangle=0x7fffffffda40, partId=0, triangleIndex=7) at /home/yura/git/OpenTomb/extern/bullet/BulletCollision/NarrowPhaseCollision/btRaycastCallback.cpp:112
#4  0x00005555556d7d5e in btBvhTriangleMeshShape::MyNodeOverlapCallback::processNode (this=0x7fffffffdcb0, nodeSubPart=0, nodeTriangleIndex=7) at /home/yura/git/OpenTomb/extern/bullet/BulletCollision/CollisionShapes/btBvhTriangleMeshShape.cpp:152
#5  0x000055555572cbfd in btQuantizedBvh::walkStacklessQuantizedTreeAgainstRay (this=0x55555728de00, nodeCallback=0x7fffffffdcb0, raySource=..., rayTarget=..., aabbMin=..., aabbMax=..., startNodeIndex=0, endNodeIndex=15) at /home/yura/git/OpenTomb/extern/bullet/BulletCollision/BroadphaseCollision/btQuantizedBvh.cpp:665
#6  0x000055555572cfac in btQuantizedBvh::reportBoxCastOverlappingNodex (this=0x55555728de00, nodeCallback=0x7fffffffdcb0, raySource=..., rayTarget=..., aabbMin=..., aabbMax=...) at /home/yura/git/OpenTomb/extern/bullet/BulletCollision/BroadphaseCollision/btQuantizedBvh.cpp:786
#7  0x000055555572cf3f in btQuantizedBvh::reportRayOverlappingNodex (this=0x55555728de00, nodeCallback=0x7fffffffdcb0, raySource=..., rayTarget=...) at /home/yura/git/OpenTomb/extern/bullet/BulletCollision/BroadphaseCollision/btQuantizedBvh.cpp:776
#8  0x00005555556d7e0c in btBvhTriangleMeshShape::performRaycast (this=0x55555710d860, callback=0x7fffffffdf90, raySource=..., rayTarget=...) at /home/yura/git/OpenTomb/extern/bullet/BulletCollision/CollisionShapes/btBvhTriangleMeshShape.cpp:159
#9  0x00005555556c790a in btCollisionWorld::rayTestSingleInternal (rayFromTrans=..., rayToTrans=..., collisionObjectWrap=0x7fffffffe150, resultCallback=...) at /home/yura/git/OpenTomb/extern/bullet/BulletCollision/CollisionDispatch/btCollisionWorld.cpp:390
#10 0x00005555556c6ebf in btCollisionWorld::rayTestSingle (rayFromTrans=..., rayToTrans=..., collisionObject=0x55555728e130, collisionShape=0x55555710d860, colObjWorldTransform=..., resultCallback=...) at /home/yura/git/OpenTomb/extern/bullet/BulletCollision/CollisionDispatch/btCollisionWorld.cpp:269
#11 0x00005555556cec6d in btSingleRayCallback::process (this=0x7fffffffe3d0, proxy=0x555556fb8210) at /home/yura/git/OpenTomb/extern/bullet/BulletCollision/CollisionDispatch/btCollisionWorld.cpp:913
#12 0x00005555556c10ef in BroadphaseRayTester::Process (this=0x7fffffffe330, leaf=0x5555570ed640) at /home/yura/git/OpenTomb/extern/bullet/BulletCollision/BroadphaseCollision/btDbvtBroadphase.cpp:223
#13 0x00005555556c0bd2 in btDbvt::rayTestInternal (this=0x555555b497a8, root=0x55555602b880, rayFrom=..., rayTo=..., rayDirectionInverse=..., signs=0x7fffffffe3e8, lambda_max=32768, aabbMin=..., aabbMax=..., policy=...) at /home/yura/git/OpenTomb/extern/bullet/BulletCollision/BroadphaseCollision/btDbvt.h:998
#14 0x00005555556bdfef in btDbvtBroadphase::rayTest (this=0x555555b497a0, rayFrom=..., rayTo=..., rayCallback=..., aabbMin=..., aabbMax=...) at /home/yura/git/OpenTomb/extern/bullet/BulletCollision/BroadphaseCollision/btDbvtBroadphase.cpp:231
#15 0x00005555556c8f86 in btCollisionWorld::rayTest (this=0x555555b35980, rayFromWorld=..., rayToWorld=..., resultCallback=...) at /home/yura/git/OpenTomb/extern/bullet/BulletCollision/CollisionDispatch/btCollisionWorld.cpp:932
#16 0x0000555555606c25 in Physics_RayTest (result=0x7fffffffe620, from=0x7fffffffe608, to=0x7fffffffe614, cont=0x7fffffffe5e0, filter=32767) at /home/yura/git/OpenTomb/src/physics/physics_bullet.cpp:561
#17 0x0000555555694ede in Test_SecondaryMouseDown () at /home/yura/git/OpenTomb/src/engine_debug.cpp:60
#18 0x0000555555692f59 in Engine_PollSDLEvents () at /home/yura/git/OpenTomb/src/engine.cpp:650
#19 0x00005555556934cc in Engine_MainLoop () at /home/yura/git/OpenTomb/src/engine.cpp:866
#20 0x00005555556a48d7 in main (argc=1, argv=0x7fffffffe858) at /home/yura/git/OpenTomb/src/main_SDL.cpp:15

@TeslaRus
Copy link
Contributor

thanks for report, I will see it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants