Commit Graph

25666 Commits (b7caf1f36e8638760605401c0feae56f2b79d7fd)
 

Author SHA1 Message Date
jvoisin e51669c05d Don't assign a variable passed by value 4 years ago
psi29a f27d7c66ff Merge branch 'racy_deadcode' into 'master'
Remove both racy and useless code.

See merge request OpenMW/openmw!896
4 years ago
CedricMocquillon 86d137363e Check if the archive is opened before adding a file to it and clear state on close 4 years ago
fredzio b13afd758c Remove both racy and useless code.
Actor's position can be determined in 3 ways:
1/ as a result of physics simulation
2/ after a script require a relative position change (SetPos, Move)
3/ absolutely set from games mechanics event (teleport) or script
(PositionCell)

In case 1/, RefData::mPosition is updated with the physics simulation result
In case 2/, when RefData::mPosition is updated, physics simulation is informed of the change and update accordingly
In case 3/, when RefData::mPosition is updated, the physics simulation state is reset

In all 3 cases, we don't need to check the RefData::mPosition to get a
correct behaviour.

TSAN reported the following data race:
  Read of size 4 at 0x7b50005b75b0 by thread T12 (mutexes: write M656173, write M84859534346343880):
    #0 ESM::Position::asVec3() const /build/openmw/openmw/master2/.build/freebsd/TSAN/../../.././components/esm/defs.hpp:55:27 (openmw+0xb809d5)
    #1 MWPhysics::Actor::updateWorldPosition() /build/openmw/openmw/master2/.build/freebsd/TSAN/../../../apps/openmw/mwphysics/actor.cpp:131:59 (openmw+0xb809d5)
    #2 MWPhysics::Actor::setPosition(osg::Vec3f const&) /build/openmw/openmw/master2/.build/freebsd/TSAN/../../../apps/openmw/mwphysics/actor.cpp:177:5 (openmw+0xb809d5)
    #3 MWPhysics::PhysicsTaskScheduler::updateActorsPositions() /build/openmw/openmw/master2/.build/freebsd/TSAN/../../../apps/openmw/mwphysics/mtphysics.cpp:524:28 (openmw+0xb91ac0)
    #4 MWPhysics::PhysicsTaskScheduler::afterPostStep() /build/openmw/openmw/master2/.build/freebsd/TSAN/../../../apps/openmw/mwphysics/mtphysics.cpp:614:13 (openmw+0xb915e7)
    #5 MWPhysics::PhysicsTaskScheduler::worker()::$_5::operator()() const /build/openmw/openmw/master2/.build/freebsd/TSAN/../../../apps/openmw/mwphysics/mtphysics.cpp:498:45 (openmw+0xb915e7)
    #6 void Misc::Barrier::wait<MWPhysics::PhysicsTaskScheduler::worker()::$_5>(MWPhysics::PhysicsTaskScheduler::worker()::$_5&&) /build/openmw/openmw/master2/.build/freebsd/TSAN/../../.././components/misc/barrier.hpp:30:21 (openmw+0xb915e7)
    #7 MWPhysics::PhysicsTaskScheduler::worker() /build/openmw/openmw/master2/.build/freebsd/TSAN/../../../apps/openmw/mwphysics/mtphysics.cpp:498:31 (openmw+0xb915e7)
    #8 MWPhysics::PhysicsTaskScheduler::PhysicsTaskScheduler(float, btCollisionWorld*, MWRender::DebugDrawer*)::$_0::operator()() const /build/openmw/openmw/master2/.build/freebsd/TSAN/../../../apps/openmw/mwphysics/mtphysics.cpp:162:45 (openmw+0xb92630)
    #9 decltype(std::__1::forward<MWPhysics::PhysicsTaskScheduler::PhysicsTaskScheduler(float, btCollisionWorld*, MWRender::DebugDrawer*)::$_0>(fp)()) std::__1::__invoke<MWPhysics::PhysicsTaskScheduler::PhysicsTaskScheduler(float, btCollisionWorld*, MWRender::DebugDrawer*)::$_0>(MWPhysics::PhysicsTaskScheduler::PhysicsTaskScheduler(float, btCollisionWorld*, MWRender::DebugDrawer*)::$_0&&) /usr/include/c++/v1/type_traits:3899:1 (openmw+0xb92630)
    #10 void std::__1::__thread_execute<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, MWPhysics::PhysicsTaskScheduler::PhysicsTaskScheduler(float, btCollisionWorld*, MWRender::DebugDrawer*)::$_0>(std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, MWPhysics::PhysicsTaskScheduler::PhysicsTaskScheduler(float, btCollisionWorld*, MWRender::DebugDrawer*)::$_0>&, std::__1::__tuple_indices<>) /usr/include/c++/v1/thread:280:5 (openmw+0xb92630)
    #11 void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, MWPhysics::PhysicsTaskScheduler::PhysicsTaskScheduler(float, btCollisionWorld*, MWRender::DebugDrawer*)::$_0> >(void*) /usr/include/c++/v1/thread:291:5 (openmw+0xb92630)

  Previous write of size 8 at 0x7b50005b75b0 by main thread:
    #0 memcpy /wrkdirs/usr/ports/devel/llvm-devel/work-default/llvm-project-3f6753efe1990a928ed120bd907940a9fb3e2fc3/compiler-rt/lib/tsan/../sanitizer_common/sanitizer_common_interceptors.inc:827:5 (openmw+0x55a057)
    #1 MWWorld::RefData::setPosition(ESM::Position const&) /build/openmw/openmw/master2/.build/freebsd/TSAN/../../../apps/openmw/mwworld/refdata.cpp:216:19 (openmw+0xa3de1c)
    #2 MWWorld::World::moveObject(MWWorld::Ptr const&, MWWorld::CellStore*, float, float, float, bool) /build/openmw/openmw/master2/.build/freebsd/TSAN/../../../apps/openmw/mwworld/worldimp.cpp:1130:26 (openmw+0xa57300)
    #3 MWWorld::World::moveObject(MWWorld::Ptr const&, float, float, float, bool, bool) /build/openmw/openmw/master2/.build/freebsd/TSAN/../../../apps/openmw/mwworld/worldimp.cpp:1253:16 (openmw+0xa580c8)
    #4 MWWorld::World::doPhysics(float, unsigned long long, unsigned int, osg::Stats&) /build/openmw/openmw/master2/.build/freebsd/TSAN/../../../apps/openmw/mwworld/worldimp.cpp:1530:17 (openmw+0xa5af8f)
    #5 MWWorld::World::updatePhysics(float, bool, unsigned long long, unsigned int, osg::Stats&) /build/openmw/openmw/master2/.build/freebsd/TSAN/../../../apps/openmw/mwworld/worldimp.cpp:1862:13 (openmw+0xa61a7c)
    #6 OMW::Engine::frame(float) /build/openmw/openmw/master2/.build/freebsd/TSAN/../../../apps/openmw/engine.cpp:333:42 (openmw+0xcce9e7)
    #7 OMW::Engine::go() /build/openmw/openmw/master2/.build/freebsd/TSAN/../../../apps/openmw/engine.cpp:935:14 (openmw+0xcd86ed)
    #8 runApplication(int, char**) /build/openmw/openmw/master2/.build/freebsd/TSAN/../../../apps/openmw/main.cpp:296:17 (openmw+0xcbffac)
    #9 wrapApplication(int (*)(int, char**), int, char**, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) /build/openmw/openmw/master2/.build/freebsd/TSAN/../../../components/debug/debugging.cpp:205:15 (openmw+0x1335442)
    #10 main /build/openmw/openmw/master2/.build/freebsd/TSAN/../../../apps/openmw/main.cpp:308:12 (openmw+0xcc008a)
:wqa
4 years ago
psi29a 3696187737 Merge branch 'free_as_in_av' into 'master'
Use av_free and maybe get Coverity to understand

See merge request OpenMW/openmw!892
4 years ago
CedricMocquillon b61249841e Update lookup only after sorting files 4 years ago
Evil Eye 54d32817d5 Use av_free and maybe get Coverity to understand 4 years ago
psi29a 3920477618 Merge branch 'moving_lighting_method_to_graphics' into 'master'
Moving Lighting Method from Advanced -> Visuals to Graphics -> Lighting

See merge request OpenMW/openmw!883
4 years ago
psi29a c4fde03542 Merge branch 'ObjectPagingMergeIssue' into 'master'
Share state

See merge request OpenMW/openmw!879
4 years ago
psi29a e596f62107 Merge branch 'Terrain-Selection-Issues' into 'master'
Various fixes for the editor's "Terrain land editing" mode (fixes #5473, #6022, #6023, #6024, #6035, #6036)

Closes #6036, #6035, #6024, #6023, #6022, and #5473

See merge request OpenMW/openmw!840
4 years ago
Thunderforge 4a15868c0e Moving Lighting Method from Advanced -> Visuals to Graphics -> Lighting
The plan is to add additional options to this new tab, and since it's of similar status as the Shaders settings, it makes sense to put them next to them on the Graphics page.
4 years ago
Alexei Dobrohotov fea5c0ac1a Merge branch 'armour_error_fix' into 'master'
Fixed data subrecord name for Armour record used in error

See merge request OpenMW/openmw!882
4 years ago
CedricMocquillon d11a6bd92c Share state 4 years ago
Atahualpa 3a1243a5d0 Rebased branch, reduced code duplication, added comments, adjusted formatting. 4 years ago
Atahualpa ca80aeaaea Fix vertex calculation for cell-border drawing. 4 years ago
Atahualpa d500507dec Resolved merge conflicts with changelog (cont.) 4 years ago
Atahualpa 356efa15a2 Fixes #6035 (circle brush selects outside of circle) and #6036 (some corner vertices not selected). 4 years ago
Atahualpa 425f745d53 Resolved merge conflicts with changelog. 4 years ago
Atahualpa 7be891b440 Directly use Geometry instead of Geode; fix for loop; add size_t type-cast. 4 years ago
Atahualpa 73949d5bd0 Updating the CMake file isn't a bad idea either... 4 years ago
Atahualpa 6c49074765 Remove old references to Cell class. 4 years ago
Atahualpa 008bf64dd9 Second step toward fixing terrain selection issues. 4 years ago
Atahualpa 18ea4d8eb2 First step toward fixing terrain selection issues. 4 years ago
Bret Curtis 373f8636b7
Merge pull request #3092 from akortunov/master
Do not trigger in-game bindings via mouse buttons when controls are disabled
4 years ago
Bret Curtis 523edd0723
Merge pull request #3093 from akortunov/light_crash
Fix crashes on exit in LightManager
4 years ago
psi29a ae66afb219 Merge branch 'less_verbose' into 'master'
Make the code less verbose.

See merge request OpenMW/openmw!874
4 years ago
psi29a e73c0f92b8 Merge branch 'fix_present_tile_crash' into 'master'
Add missing synchronization for present tiles modification

See merge request OpenMW/openmw!878
4 years ago
psi29a e9fbd76e9b Merge branch 'windows_tests' into 'master'
Support running tests and benchmarks for windows

See merge request OpenMW/openmw!839
4 years ago
psi29a 4bc7012104 Merge branch 'pack-default-settings' into 'master'
Pack default settings

Closes #5925

See merge request OpenMW/openmw!822
4 years ago
elsid 959165bcb9
Support running unit tests on gitlab CI for windows
But not actually run them because gitlab fails to do this.
4 years ago
elsid 3ef1b27099
Add missing includes 4 years ago
AnyOldName3 4cedb3549b Decode base64-packed settings files 4 years ago
Benjamin Winger 21f04f0d0f
Fixed data subrecord name for Armour record used in error 4 years ago
AnyOldName3 081650a2e5 Integrate Base64 library with build 4 years ago
AnyOldName3 2b1326cb74 Change namespace to Base64
The functions do Base64 encoding and decoding and do not feed me
delicious almond and meringue based confectionary.
4 years ago
AnyOldName3 d66cc3b7ae Fix undefined behaviour 4 years ago
AnyOldName3 aba735e615 Check in external Base64 implementation
Taken from https://gist.github.com/tomykaira/f0fd86b6c73063283afe550bc5d77594

MIT licenced
4 years ago
elsid a73ffc25c3
Add missing synchronization for present tiles modification
insert/erase can be done from multiple threads simultaneously. mMutex is
already used to synchronize reads so use it for writes too.
4 years ago
psi29a f1f1703441 Merge branch 'fix_navmesh_wait' into 'master'
Fix redundant waiting until navmesh is generated

See merge request OpenMW/openmw!861
4 years ago
Andrei Kortunov 11c57978b6 Fix crashes on exit in the LightManager (bug #6044) 4 years ago
Andrei Kortunov c54ef55ebb Revert "Replace raw pointer by observer_ptr to avoid dangling pointer dereferencing"
This reverts commit 5373cf1cd5.
4 years ago
Andrei Kortunov c11774f278 Do not trigger in-game bindings via mouse buttons when controls are disabled (bug #6047) 4 years ago
psi29a b583c2300c Merge branch 'maybe-fix#5551' into 'master'
Fix #5551

Closes #5551

See merge request OpenMW/openmw!802
4 years ago
psi29a 405e634e09 Merge branch 'fix_light_manager_ub' into 'master'
Fix UB in light initialization

See merge request OpenMW/openmw!877
4 years ago
elsid d520b440aa
Copy LightBuffer data into a new object when changing layout
Before this change LightBuffer copy constructor copied only mData pointer into
a new object. Then memcpy was applied to an overlapping source and destination
that is UB.

Replace configureLayout function by a special constructor. That copies all
mData values and a pointer to a buffer object into a newly allocated object.
4 years ago
Bret Curtis fef9e91510
Merge pull request #3090 from akortunov/warnfix
Fix warning in assert - size_t can not be negative
4 years ago
Bret Curtis 46da65a568
Merge pull request #3091 from akortunov/master
Discard button press events during save loading
4 years ago
AnyOldName3 c2e4eda825 Merge branch '6013-fix' into 'master'
Retain draw callback

Closes #6013 and #5967

See merge request OpenMW/openmw!875
4 years ago
madsbuvi f3e17e7c52 Don't redundantly call notify on every frame. 4 years ago
Andrei Kortunov e38063dcdb Discard button press events during save loading (bug #5619) 4 years ago