Home>

The person who is doing numerical calculations using the c language, and trying to debug using the electric fence because the program seems to be leaking memory.
However, I am not familiar with the PC and I don't know how to install
Please let me know if anyone knows.

Tried

Also brew install electric-fence

Error: No previously deleted formula found.
==>Searching for similarly named formulae ...
Error: No similarly named formulae found.
==>Searching taps ...
==>Searching taps on GitHub ...
Error: No formulae found in taps.


(Some error messages have been omitted.)
Similar results were obtained with brew install ElectricFence.
I couldn't change the uppercase and lowercase letters a little ...

If i use yum or apt-get, you will be told that there is no such command.

Supplemental information (FW/tool version etc.)

gcc version 8.2.0
My mac is high sierra version 10.13.6

c
  • Answer # 1

      

    Also brew install electric-fence

    Are some sites mentioned that you can installElectric Fenceon MacOS X that way? (I don't think so ...)

    Electric Fence was used more than 10 years ago and it was easy to use, so I've used it several times, but it is no longer maintained and can be installed on a new OS. It is a little uncertain whether it can be used.

    Electric Fence * Indicates that the original author page is a candidate for deletion due to a broken link.

    As a result of testing, Ubuntu 16.04 on Linux was able to install and use it with theapt-getcommand. If you are using MacOS X,brew(Homebrew) is not possible, and you will have to download the source file and compile and build it yourself.

    In the first place, however, Electric Fence does not detect memory leaks when usingmalloc. It is illegal outside the memory area allocated bymalloc. To detect unwanted access.
    In that sense, if you can install it on your MacOS X, you will not be able to meet your final requirements. According to the questioner's past questions, it seems that you should be familiar with how to use Valgrind because you are using Valgrind. I've never used Valgrind, but it's newer than Electric Fence, is still maintained, and can detect memory leaks.

    Note

      

    If you use yum or apt-get, you will be told that there is no such command.

    yumis a command used in Red Hat Linux, andapt-getis an install package management command used in Debian (debian and ubuntu). Basically not available on MacOS X. There was a related question answer at StackOverflow before, so I will inform you.

    [Development beginner] I want to use yum on mac, but it doesn't work.

  • Answer # 2

    I've never used it on the command line, but can I use Instruments that come with Xcode?

    https://developer.apple.com/documentation/DeveloperTools/Conceptual/InstrumentsUserGuide/CommonMemoryProblems.html

    https://developer.apple.com/documentation/DeveloperTools/Conceptual/InstrumentsUserGuide/Recording,Pausing,andStoppingTraces.html#//apple_ref/doc/uid/TP40004652-CH12-SW2