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

Crash when opening vehicle stats (t) with Debug build #130

Closed
Hiradur opened this Issue Mar 28, 2015 · 11 comments

Comments

Projects
None yet
4 participants
@Hiradur
Contributor

Hiradur commented Mar 28, 2015

RoR crashes when pressing T while sitting in a vehicle when multithreading is disabled for debug builds.

gdb:

Program terminated with signal SIGABRT, Aborted.
#0  0x00007fc2dcaddcc9 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56  ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  0x00007fc2dcaddcc9 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00007fc2dcae10d8 in __GI_abort () at abort.c:89
#2  0x00007fc2dcad6b86 in __assert_fail_base (
    fmt=0x7fc2dcc283d0 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", 
    assertion=assertion@entry=0x833556 "fScalar != 0.0", 
    file=file@entry=0x833530 "/usr/local/include/OGRE/OgreVector3.h", 
    line=line@entry=193, 
    function=function@entry=0x8699c0 <_ZZNK4Ogre7Vector3dvEfE19__PRETTY_FUNCTION__> "Ogre::Vector3 Ogre::Vector3::operator/(Ogre::Real) const") at assert.c:92
#3  0x00007fc2dcad6c32 in __GI___assert_fail (
    assertion=0x833556 "fScalar != 0.0", 
    file=0x833530 "/usr/local/include/OGRE/OgreVector3.h", line=193, 
    function=0x8699c0 <_ZZNK4Ogre7Vector3dvEfE19__PRETTY_FUNCTION__> "Ogre::Vector3 Ogre::Vector3::operator/(Ogre::Real) const") at assert.c:101
#4  0x0000000000526604 in Ogre::Vector3::operator/ (fScalar=0, this=0x8119110)
    at /usr/local/include/OGRE/OgreVector3.h:193
#5  0x00000000006b5a29 in operator/ (fScalar=<optimized out>, this=0x8119110)
    at /home/-/Desktop/rigs-of-rods-upstream/source/main/physics/Beam.cpp:5786
#6  Beam::getGForces (this=this@entry=0x7efc980)
    at /home/-/Desktop/rigs-of-rods-upstream/source/main/physics/Beam.cpp:5760
---Type <return> to continue, or q <return> to quit---
#7  0x000000000066a44f in RoR::GUI::SimUtils::UpdateStats (this=0x3bb30b0, 
    dt=dt@entry=0,00700000022, truck=truck@entry=0x7efc980)
    at /home/-/Desktop/rigs-of-rods-upstream/source/main/gui/panels/GUI_SimUtils.cpp:303
#8  0x000000000069fe30 in RoR::GUIManager::UpdateSimUtils (
    this=<optimized out>, dt=dt@entry=0,00700000022, 
    truck=truck@entry=0x7efc980)
    at /home/-/Desktop/rigs-of-rods-upstream/source/main/gui/GUIManager.cpp:342
#9  0x000000000056aaca in RoRFrameListener::frameStarted (this=0x2404200, 
    evt=...)
    at /home/-/Desktop/rigs-of-rods-upstream/source/main/gameplay/RoRFrameListener.cpp:1437
#10 0x00007fc2df4d6f2c in Ogre::Root::_fireFrameStarted(Ogre::FrameEvent&) ()
   from /usr/local/lib/libOgreMain.so.1.8.1
#11 0x00007fc2df4d87d1 in Ogre::Root::_fireFrameStarted() ()
   from /usr/local/lib/libOgreMain.so.1.8.1
#12 0x00007fc2df4d88d9 in Ogre::Root::renderOneFrame() ()
   from /usr/local/lib/libOgreMain.so.1.8.1
#13 0x00000000007e90a8 in RoR::MainThread::EnterGameplayLoop (
    this=this@entry=0x7fff0eeada00)
    at /home/-/Desktop/rigs-of-rods-upstream/source/main/main_sim/MainThread.cpp:991

@Hiradur Hiradur added the crash label Mar 28, 2015

@Max98

This comment has been minimized.

Show comment
Hide comment
@Max98

Max98 Mar 28, 2015

Contributor

Doesn't crash on Windows. Might be Linux related.

Contributor

Max98 commented Mar 28, 2015

Doesn't crash on Windows. Might be Linux related.

@Hiradur

This comment has been minimized.

Show comment
Hide comment
@Hiradur

Hiradur Mar 31, 2015

Contributor

Probably because assertions are disabled on Windows. Still weird because it looks like a division by 0.

Contributor

Hiradur commented Mar 31, 2015

Probably because assertions are disabled on Windows. Still weird because it looks like a division by 0.

@Max98

This comment has been minimized.

Show comment
Hide comment
@Max98

Max98 Mar 31, 2015

Contributor

Seems like it crashes just right here:

Vector3 acc = cameranodeacc / cameranodecount;

Beam::getGForces (this=this@entry=0x7efc980)
at /home/-/Desktop/rigs-of-rods-upstream/source/main/physics/Beam.cpp:5760

What vehicle did you use?

Contributor

Max98 commented Mar 31, 2015

Seems like it crashes just right here:

Vector3 acc = cameranodeacc / cameranodecount;

Beam::getGForces (this=this@entry=0x7efc980)
at /home/-/Desktop/rigs-of-rods-upstream/source/main/physics/Beam.cpp:5760

What vehicle did you use?

@Hiradur

This comment has been minimized.

Show comment
Hide comment
@Hiradur

Hiradur Apr 1, 2015

Contributor

Agora bus and others

Contributor

Hiradur commented Apr 1, 2015

Agora bus and others

@vorot93

This comment has been minimized.

Show comment
Hide comment
@vorot93

vorot93 Apr 24, 2015

Contributor

Also crashes while on train.

Contributor

vorot93 commented Apr 24, 2015

Also crashes while on train.

@vorot93

This comment has been minimized.

Show comment
Hide comment
@vorot93

vorot93 May 11, 2015

Contributor

I can no longer observe the bug with the latest git release. Please confirm it's obsolete.

Contributor

vorot93 commented May 11, 2015

I can no longer observe the bug with the latest git release. Please confirm it's obsolete.

@Max98 Max98 added this to the RoR 0.4.5 (Nextstable) milestone May 11, 2015

@Hiradur

This comment has been minimized.

Show comment
Hide comment
@Hiradur

Hiradur May 12, 2015

Contributor

It's still there but requires a debug build since it's coming from an assertion. Assertions are deactivated for release builds.

Contributor

Hiradur commented May 12, 2015

It's still there but requires a debug build since it's coming from an assertion. Assertions are deactivated for release builds.

@Hiradur Hiradur changed the title from Crash when opening vehicle stats (t) with multithreading disabled to Crash when opening vehicle stats (t) with multithreading disabled (debug) Jul 6, 2015

@Hiradur Hiradur removed this from the RoR 0.4.5 (Nextstable) milestone Jul 17, 2015

@Hiradur Hiradur changed the title from Crash when opening vehicle stats (t) with multithreading disabled (debug) to Crash when opening vehicle stats (t) Jul 19, 2015

@Hiradur

This comment has been minimized.

Show comment
Hide comment
@Hiradur

Hiradur Jul 19, 2015

Contributor

Actually, I just discovered this also happens with multi-threading enabled. Contrary to when multithreading is disabled it doesn't happen immediately after T is pressed. If you leave the vehicle stats menu open long enough it'll crash.
It was discovered using this vehicle: http://www.rigsofrods.com/threads/118984-Lotus-76-1-for-current-and-future-ror-versions-%28Updated-for-test-build-4%29

Contributor

Hiradur commented Jul 19, 2015

Actually, I just discovered this also happens with multi-threading enabled. Contrary to when multithreading is disabled it doesn't happen immediately after T is pressed. If you leave the vehicle stats menu open long enough it'll crash.
It was discovered using this vehicle: http://www.rigsofrods.com/threads/118984-Lotus-76-1-for-current-and-future-ror-versions-%28Updated-for-test-build-4%29

@Hiradur Hiradur changed the title from Crash when opening vehicle stats (t) to Crash when opening vehicle stats (t) with Debug build Jul 19, 2015

@Hiradur

This comment has been minimized.

Show comment
Hide comment
@Hiradur

Hiradur Jul 19, 2015

Contributor

fixed in my repo

EDIT: Not fixed, only happens less frequently. Circumstances now make me believe it's a race condition.

Contributor

Hiradur commented Jul 19, 2015

fixed in my repo

EDIT: Not fixed, only happens less frequently. Circumstances now make me believe it's a race condition.

@only-a-ptr only-a-ptr added this to the Post-Nextstable milestone Jul 22, 2015

@Hiradur

This comment has been minimized.

Show comment
Hide comment
@Hiradur

Hiradur Aug 6, 2015

Contributor

snippet:

Vector3 Beam::getGForces()
{
    if (cameranodepos[0] >= 0 && cameranodepos[0] < MAX_NODES && cameranodedir[0] >= 0 && cameranodedir[0] < MAX_NODES && cameranoderoll[0] >= 0 && cameranoderoll[0] < MAX_NODES)
    {
        Vector3 acc      = cameranodeacc / cameranodecount;
        cameranodeacc    = Vector3::ZERO;
        cameranodecount  = 0
<snip>
}

getGForces() is called in 3 files: GUI_SimUtils.cpp, TruckHUD.cpp and it's also available through the AngelScript API. If two calls happen in the same frame cameranodecount is 0 for the second call. So that functions needs to check if it's a new frame and if it isn't it should return the previously calculated value.

Contributor

Hiradur commented Aug 6, 2015

snippet:

Vector3 Beam::getGForces()
{
    if (cameranodepos[0] >= 0 && cameranodepos[0] < MAX_NODES && cameranodedir[0] >= 0 && cameranodedir[0] < MAX_NODES && cameranoderoll[0] >= 0 && cameranoderoll[0] < MAX_NODES)
    {
        Vector3 acc      = cameranodeacc / cameranodecount;
        cameranodeacc    = Vector3::ZERO;
        cameranodecount  = 0
<snip>
}

getGForces() is called in 3 files: GUI_SimUtils.cpp, TruckHUD.cpp and it's also available through the AngelScript API. If two calls happen in the same frame cameranodecount is 0 for the second call. So that functions needs to check if it's a new frame and if it isn't it should return the previously calculated value.

@Hiradur Hiradur referenced this issue Aug 7, 2015

Merged

bug fixes #365

@Hiradur Hiradur modified the milestones: Post-Nextstable, 0.4.6.0 Oct 24, 2015

@Hiradur Hiradur self-assigned this Oct 24, 2015

@Hiradur

This comment has been minimized.

Show comment
Hide comment
@Hiradur

Hiradur Nov 18, 2015

Contributor

fixed

Contributor

Hiradur commented Nov 18, 2015

fixed

@Hiradur Hiradur closed this Nov 18, 2015

Hiradur added a commit to Hiradur/rigs-of-rods that referenced this issue Nov 19, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment