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

[Mac] Demo does not run - "Attempt to free invalid pointer" #1892

Closed
rupang818 opened this issue Mar 14, 2021 · 11 comments
Closed

[Mac] Demo does not run - "Attempt to free invalid pointer" #1892

rupang818 opened this issue Mar 14, 2021 · 11 comments

Comments

@rupang818
Copy link

Issue Summary

With the files generated from running the CMake, I am trying to run the simple demo, but it it showing the message "Attempt to free invalid pointer 0x7feac270d5c0"

Here's the CMake GUI setting, if it helps:
Screen Shot 2021-03-13 at 5 54 51 PM
(Note WITH_QT is on, WITH_GTK is off, per this comment)

Executed Command (if any)

./build/examples/openpose/openpose.bin --video examples/media/video.avi

OpenPose Output (if any)

Starting OpenPose demo...
Configuring OpenPose...
Starting thread(s)...
---------------------------------- WARNING ----------------------------------
We have introduced an additional boost in accuracy in the CUDA version of about 0.2% with respect to the CPU/OpenCL versions. We will not port this to CPU given the considerable slow down in speed it would add to it. Nevertheless, this accuracy boost is almost insignificant so the CPU/OpenCL versions can be safely used.
-------------------------------- END WARNING --------------------------------
src/tcmalloc.cc:333] Attempt to free invalid pointer 0x7feac270d5c0

Errors (if any)

Attempt to free invalid pointer 0x7feac270d5c0

Type of Issue

Select the topic(s) on your post, delete the rest:

  • Execution error

Your System Configuration

  1. Whole console output:
    Starting OpenPose demo...
    Configuring OpenPose...
    Starting thread(s)...
    ---------------------------------- WARNING ----------------------------------
    We have introduced an additional boost in accuracy in the CUDA version of about 0.2% with respect to the CPU/OpenCL versions. We will not port this to CPU given the considerable slow down in speed it would add to it. Nevertheless, this accuracy boost is almost insignificant so the CPU/OpenCL versions can be safely used.
    -------------------------------- END WARNING --------------------------------
    src/tcmalloc.cc:333] Attempt to free invalid pointer 0x7feac270d5c0

  2. OpenPose version: Latest github master branch (latest commit id: 1f1aa9c)

  3. General configuration:

    • Installation mode: CMake, then makefile
    • Operating system : macOS
    • Operating system version : 11.2 (20D64) - Big Sur
    • Release or Debug mode?: release
    • Compiler:
      • Apple clang version 12.0.0 (clang-1200.0.32.29)
      • Target: x86_64-apple-darwin20.3.0
      • Thread model: posix
      • InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
  4. Non-default settings:

    • 3-D Reconstruction module added?: no
    • Any other custom CMake configuration with respect to the default version?: no
  5. 3rd-party software:

    • Caffe version: 1.0.0
    • CMake version (cmake --version in Ubuntu): 3.19.6
    • OpenCV version: 4.5.1
  6. No GPU issue

  7. If CPU-only mode issue:

    • CPU brand & model: 2.4 GHz 8-Core Intel Core i9
    • Total RAM memory available: 64GB ram
  8. If Python API:

    • Python version: 3.6.5
    • Numpy version (python -c "import numpy; print numpy.version.version" in Ubuntu): 1.20.1
@stale
Copy link

stale bot commented Jun 11, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale/old label Jun 11, 2021
@stale stale bot closed this as completed Jan 9, 2022
@Cliwo
Copy link

Cliwo commented Jan 15, 2022

Did you solve the problem? I'm having same one..

OS : Mac 11.3.1

@tejacques
Copy link

tejacques commented Jan 18, 2022

Also having the same issue. Installed caffe from homebrew and used that instead of building from source.

@tejacques
Copy link

If helpful, when I try to build from source with the openpose fork, there are two issues. The first is that the latest version of protobuf seems incompatible with the fork, causing the following error:

[  3%] Building CXX object src/caffe/CMakeFiles/caffe.dir/util/io.cpp.o
~/Projects/openpose/3rdparty/caffe/src/caffe/util/io.cpp:57:57: error: too many arguments to function call, expected single argument 'total_bytes_limit', have 2 arguments
  coded_input->SetTotalBytesLimit(kProtoReadBytesLimit, 536870912);
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                       ^~~~~~~~~
/usr/local/include/google/protobuf/io/coded_stream.h:406:8: note: 'SetTotalBytesLimit' declared here
  void SetTotalBytesLimit(int total_bytes_limit);
       ^
1 error generated.

This can be fixed by removing the second argument in the specified file.

The second issue I have not been able to address is this linker error:

% make -j`sysctl -n hw.logicalcpu`
[  3%] Built target openpose_lib
[  3%] Linking CXX shared library libopenpose.dylib
Undefined symbols for architecture x86_64:
  "caffe::Net<float>::CopyTrainedLayersFrom(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >)", referenced from:
      op::NetCaffe::initializationOnThread() in netCaffe.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [src/openpose/libopenpose.1.7.0.dylib] Error 1
make[1]: *** [src/openpose/CMakeFiles/openpose.dir/all] Error 2

@elcchan99
Copy link

Same error here as well on 12.1 with M1 chip

@0tist
Copy link

0tist commented Jan 24, 2022

got the same error, any fix for that?

@Jaykob
Copy link

Jaykob commented Feb 15, 2022

+1

@atabak-cve
Copy link

Didn't face the second issue on 12.2.1 intel mac.

@elcchan99
Copy link

I resolved the Attempt to free invalid pointer on OSX issue.
See my comment in another issue thread:
#1902 (comment)

@rajhlinux
Copy link

I had the exact same issue as to tejacques for compiling "Caffe" (Deep Learning Project on github). The solution was to remove the 2nd argument as stated by tejacques.

@greatdex
Copy link

I resolved the Attempt to free invalid pointer on OSX issue. See my comment in another issue thread: #1902 (comment)

This was the issue, and I solved it by following your steps, thanks @elcchan99 !

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

No branches or pull requests

9 participants