-
Notifications
You must be signed in to change notification settings - Fork 7.9k
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
Getting malloc(): memory corruption
#185
Comments
Please, try to use OpenCV 2.4 to see if its a OpenPose-OpenCV error |
Hi,
I'm using Tesla K80 w/ 12GB of idle memory.
…On Mon, Aug 7, 2017 at 9:49 PM, Timothy Callemein ***@***.***> wrote:
Hello @chuckcho <https://github.com/chuckcho>, What GPU are you using?
Does it have sufficient memory to allocate?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#185 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AMu8TCS1hB40E_gPzxFi_eiIwWRXGvjrks5sV-j3gaJpZM4OszEV>
.
--
Chuck Cho
@ Dextro.co
[email protected]
|
try to run it with "sudo" |
Also try with valgrind but note it can take around 24 hours to crash because valgrind slows things down a lot. |
Hello! I think I have the same problem as you. I ran valgrind, but I'm not really proficient at reading the output. Can you see anything wrong, except for valgrind crashing for some reason? (I haven't tried compiling with opencv 2 yet, but that is the next step.) |
I agree. You're seeing the same error. I'm not sure yet, if it's related to the malloc crash; there could be additional problems. Unfortunately, I don't know opencv and C++ well enough to spot the problem. The code looks fine but it is very scary that it accesses a raw pointer instead of using a method. I have a few ideas that I will look into in the next few days:
|
Some progress but not enough. I have not tried '1' yet. That got the process to run further but it crashes again. That last crash looks like it happened when the process was exiting. I did get a openpose window and it drew a bunch of pictures quickly. Unfortunately, I didn't see any poses. I think the code called from Sounds bad but I hope that these code areas are main problem: Both functions are accessing a cv:Mat. Given the checks in the code, I suspect the memory wasn't allocated properly or accessing the raw internal data ptr no longer works as expected. |
Yeah! I found the major problem: The fix is to change to cv:Mat(rows, cols, type) instead. I also changed src/openpose/core/opOutputToCvMat.cpp OpOutputToCvMat::formatToCvMat Finally, in src/openpose/utilities/openCv.cpp function floatPtrToUCharCvMat I still get a crash when the executable exits in I suspect there might be more compiler related problems but at least we know where to look. |
(I'm sorry it took me some hours to do the fix based on @swframe answer) Thank you @swframe and everyone else for your feed-back! I've just pushed a fixed based on @swframe message:
I cannot replicate it at the moment since I have a different OpenCV version and I cannot uninstall it right now... So any further feed-back is welcome! Please, let me know if it works now. Thanks! |
Thank you very much for your help! I've pulled the new version and compiled. The example works (tried with face/hands in video, as well as with the example media. I don't know if this is relevant, but the issue that got fixed (using parentheses instead of swirly brackets) is also present in any other program when compiling with g++ without adding the flag -std=c++11 or -std=c++0x. However I tried recompiling opencv with ENABLE_CXX11 but no effect. -std=c++11 is already in the 'COMMON_FLAGS' parameter in openpose, so I don't think the issue is there either. |
Good to hear that. If you find the exit crashing reason, just let me know and I'll also fix it, since I cannot debug it myself I have no idea where it comes from. Thanks! |
FYI: I googled the protobuf on-exit crash. It is caused when a proto message has a field reference to another message and that referenced message is freed twice. There is better way to allocate the referenced message. Unfortunately, I was not able to find the code that is doing the improper allocation; it seems to be in caffe. I will see if I can enable additional logging (or if valgrind can help). |
OK thanks. The interesting part is that only happen with some compiled OpenCV versions, it did not happen e.g. with the default |
Duplicated of #68. Fixed there. |
Issue summary
It built with a problem. When I run it on sample images, it complains about
memory corruption
. Please advise.Executed command (if any)
OpenPose output (if any)
Type of issue
Your system configuration
Operating system
Distributor ID: Ubuntu
Description: Ubuntu 14.04.5 LTS
Release: 14.04
Codename: trusty
CUDA version
CUDA Version 8.0.61
cuDNN version:
#define CUDNN_MAJOR 6
#define CUDNN_MINOR 0
#define CUDNN_PATCHLEVEL 21
GPU model
Tesla K80
Caffe version
Default from OpenPose
OpenCV version
OpenCV 3.3.0 built w/ CMake Compiler + gcc v4.8.4
The text was updated successfully, but these errors were encountered: