bulletphysics / bullet3

Bullet Physics SDK: real-time collision detection and multi-physics simulation for VR, games, visual effects, robotics, machine learning etc.
http://bulletphysics.org
Other
12.47k stars 2.87k forks source link

Issues found by PVS-Studio #1074

Closed skhrenov closed 3 years ago

skhrenov commented 7 years ago

Hello, I have found a few bugs using PVS-Studio analyzer. PVS-Studio is a static code analyzer for C, C++ and C#: https://www.viva64.com/en/pvs-studio/

Analyzer warnings:

In addition, I suggest having a look at the emails, sent from @pvs-studio.com.

Best regards, Sergey Hrenov, PVS-Studio Team

erwincoumans commented 7 years ago

Thanks for the review, the 1st and 3rd are valid issues we need to fix. The 2nd seems pointless, since we check for 0 pointer, so there is nothing to be freed.

erwincoumans commented 7 years ago

Both issues are address in this commit: https://github.com/bulletphysics/bullet3/commit/ad2099e107174759cf6d4d80469fd6c157858b89 Since the 2nd one isn't an issue, no action is needed. Thanks!

erwincoumans commented 5 years ago

Thanks for the report! Most of the issues were in examples, which are less strictly developed. Still, good to fix it, now it uses B3_PI: https://github.com/bulletphysics/bullet3/blob/master/examples/SharedMemory/PhysicsClientC_API.cpp#L4145

Oh, and Bullet and PyBullet are still very actively developed and used, in particular for robotics and reinforcement learning.

erwincoumans commented 5 years ago

We should probably get rid of BussIK and also from the Bullet3/OpenCL code, it is not used. Same for enet/tests etc.

erwincoumans commented 5 years ago

tinyrenderer example also fixed, for create cube x,y,z (and not x,y,y)

erwincoumans commented 5 years ago

I'll check it out. Until then, don't restart that example more than a trillion times :)

erwincoumans commented 5 years ago

Is there a way to exclude examples, in particular examples/ThirdPartyLibs? and exclude Bullet/src/Bullet3* ? The OpenCL pipeline is dead/unused, and I have no intention to fix ThirdPartyLibs.